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/stats/rtcstats_objects.cc b/stats/rtcstats_objects.cc
index de317aa..7c023d1 100644
--- a/stats/rtcstats_objects.cc
+++ b/stats/rtcstats_objects.cc
@@ -53,6 +53,10 @@
const char* const RTCNetworkType::kVpn = "vpn";
const char* const RTCNetworkType::kUnknown = "unknown";
+// https://webrtc.org/experiments/rtp-hdrext/video-content-type/
+const char* const RTCContentType::kUnspecified = "unspecified";
+const char* const RTCContentType::kScreenshare = "screenshare";
+
// clang-format off
WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
&fingerprint,
@@ -587,7 +591,8 @@
&burst_discard_rate,
&gap_loss_rate,
&gap_discard_rate,
- &frames_decoded)
+ &frames_decoded,
+ &content_type)
// clang-format on
RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
@@ -613,7 +618,8 @@
burst_discard_rate("burstDiscardRate"),
gap_loss_rate("gapLossRate"),
gap_discard_rate("gapDiscardRate"),
- frames_decoded("framesDecoded") {}
+ frames_decoded("framesDecoded"),
+ content_type("contentType") {}
RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
const RTCInboundRTPStreamStats& other)
@@ -634,7 +640,8 @@
burst_discard_rate(other.burst_discard_rate),
gap_loss_rate(other.gap_loss_rate),
gap_discard_rate(other.gap_discard_rate),
- frames_decoded(other.frames_decoded) {}
+ frames_decoded(other.frames_decoded),
+ content_type(other.content_type) {}
RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
@@ -645,7 +652,8 @@
&bytes_sent,
&target_bitrate,
&frames_encoded,
- &total_encode_time)
+ &total_encode_time,
+ &content_type)
// clang-format on
RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
@@ -659,7 +667,8 @@
bytes_sent("bytesSent"),
target_bitrate("targetBitrate"),
frames_encoded("framesEncoded"),
- total_encode_time("totalEncodeTime") {}
+ total_encode_time("totalEncodeTime"),
+ content_type("contentType") {}
RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
const RTCOutboundRTPStreamStats& other)
@@ -668,7 +677,8 @@
bytes_sent(other.bytes_sent),
target_bitrate(other.target_bitrate),
frames_encoded(other.frames_encoded),
- total_encode_time(other.total_encode_time) {}
+ total_encode_time(other.total_encode_time),
+ content_type(other.content_type) {}
RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}