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/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index df2f09c..7427356 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -19,6 +19,7 @@
#include "api/candidate.h"
#include "api/media_stream_interface.h"
#include "api/peer_connection_interface.h"
+#include "api/video/video_content_type.h"
#include "media/base/media_channel.h"
#include "p2p/base/p2p_constants.h"
#include "p2p/base/port.h"
@@ -266,6 +267,10 @@
inbound_video->frames_decoded = video_receiver_info.frames_decoded;
if (video_receiver_info.qp_sum)
inbound_video->qp_sum = *video_receiver_info.qp_sum;
+ // TODO(https://crbug.com/webrtc/10529): When info's |content_info| is
+ // optional, support the "unspecified" value.
+ if (video_receiver_info.content_type == VideoContentType::SCREENSHARE)
+ inbound_video->content_type = RTCContentType::kScreenshare;
}
// Provides the media independent counters (both audio and video).
@@ -322,6 +327,10 @@
outbound_video->total_encode_time =
static_cast<double>(video_sender_info.total_encode_time_ms) /
rtc::kNumMillisecsPerSec;
+ // TODO(https://crbug.com/webrtc/10529): When info's |content_info| is
+ // optional, support the "unspecified" value.
+ if (video_sender_info.content_type == VideoContentType::SCREENSHARE)
+ outbound_video->content_type = RTCContentType::kScreenshare;
}
void ProduceCertificateStatsFromSSLCertificateStats(