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}
This commit is contained in:
Henrik Boström
2019-04-09 13:59:31 +02:00
committed by Commit Bot
parent 7150d8c60f
commit 2e06926c95
5 changed files with 51 additions and 6 deletions

View File

@ -53,6 +53,10 @@ const char* const RTCNetworkType::kWimax = "wimax";
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 @@ WEBRTC_RTCSTATS_IMPL(
&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 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
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 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
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 @@ WEBRTC_RTCSTATS_IMPL(
&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 @@ RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
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 @@ RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
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() {}