Implement RTC[In/Out]boundRtpStreamStats.contentType.
Spec: https://henbos.github.io/webrtc-provisional-stats/#dom-rtcinboundrtpstreamstats-contenttype
This already exists as a goog-stat. This CL only plumbs the value to the
new stats collector.
Note: There is currently no distinction between the extension being
missing and it being present but the value being "unspecified". Until
https://crbug.com/webrtc/10529 is fixed, this metric is only exposed if
SCREENSHARE was present.
Bug: webrtc:10452
Change-Id: Ic8723f4d0efb43ab72a560e954676facd3b90659
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131946
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27520}
diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h
index 158ea92..8a1fe56 100644
--- a/api/stats/rtcstats_objects.h
+++ b/api/stats/rtcstats_objects.h
@@ -74,6 +74,12 @@
static const char* const kUnknown;
};
+// https://webrtc.org/experiments/rtp-hdrext/video-content-type/
+struct RTCContentType {
+ static const char* const kUnspecified;
+ static const char* const kScreenshare;
+};
+
// https://w3c.github.io/webrtc-stats/#certificatestats-dict*
class RTC_EXPORT RTCCertificateStats final : public RTCStats {
public:
@@ -418,6 +424,8 @@
// TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
RTCStatsMember<double> gap_discard_rate;
RTCStatsMember<uint32_t> frames_decoded;
+ // https://henbos.github.io/webrtc-provisional-stats/#dom-rtcinboundrtpstreamstats-contenttype
+ RTCStatsMember<std::string> content_type;
};
// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
@@ -438,6 +446,8 @@
RTCStatsMember<double> target_bitrate;
RTCStatsMember<uint32_t> frames_encoded;
RTCStatsMember<double> total_encode_time;
+ // https://henbos.github.io/webrtc-provisional-stats/#dom-rtcoutboundrtpstreamstats-contenttype
+ RTCStatsMember<std::string> content_type;
};
// https://w3c.github.io/webrtc-stats/#transportstats-dict*