Add reporting of googContentType via GetStats on send side
BUG=webrtc:8174
Review-Url: https://codereview.webrtc.org/3005193002
Cr-Original-Commit-Position: refs/heads/master@{#19719}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 50864a8f4b911cce51aec715985a929cad86c688
diff --git a/call/video_send_stream.h b/call/video_send_stream.h
index a458203..6dd13ab 100644
--- a/call/video_send_stream.h
+++ b/call/video_send_stream.h
@@ -82,6 +82,8 @@
int number_of_cpu_adapt_changes = 0;
int number_of_quality_adapt_changes = 0;
std::map<uint32_t, StreamStats> substreams;
+ webrtc::VideoContentType content_type =
+ webrtc::VideoContentType::UNSPECIFIED;
};
struct Config {
diff --git a/media/base/mediachannel.h b/media/base/mediachannel.h
index ef245a1..cea85e6 100644
--- a/media/base/mediachannel.h
+++ b/media/base/mediachannel.h
@@ -731,7 +731,8 @@
adapt_changes(0),
avg_encode_ms(0),
encode_usage_percent(0),
- frames_encoded(0) {}
+ frames_encoded(0),
+ content_type(webrtc::VideoContentType::UNSPECIFIED) {}
std::vector<SsrcGroup> ssrc_groups;
// TODO(hbos): Move this to |VideoMediaInfo::send_codecs|?
@@ -752,6 +753,7 @@
int encode_usage_percent;
uint32_t frames_encoded;
rtc::Optional<uint64_t> qp_sum;
+ webrtc::VideoContentType content_type;
};
struct VideoReceiverInfo : public MediaReceiverInfo {
diff --git a/media/engine/webrtcvideoengine.cc b/media/engine/webrtcvideoengine.cc
index 9b6c71c..a613dc6 100644
--- a/media/engine/webrtcvideoengine.cc
+++ b/media/engine/webrtcvideoengine.cc
@@ -1976,6 +1976,8 @@
info.nominal_bitrate = stats.media_bitrate_bps;
info.preferred_bitrate = stats.preferred_media_bitrate_bps;
+ info.content_type = stats.content_type;
+
info.send_frame_width = 0;
info.send_frame_height = 0;
for (std::map<uint32_t, webrtc::VideoSendStream::StreamStats>::iterator it =
diff --git a/pc/statscollector.cc b/pc/statscollector.cc
index 0458e82..08cf464 100644
--- a/pc/statscollector.cc
+++ b/pc/statscollector.cc
@@ -310,6 +310,9 @@
for (const auto& i : ints)
report->AddInt(i.name, i.value);
report->AddString(StatsReport::kStatsValueNameMediaType, "video");
+ report->AddString(
+ StatsReport::kStatsValueNameContentType,
+ webrtc::videocontenttypehelpers::ToString(info.content_type));
}
void ExtractStats(const cricket::BandwidthEstimationInfo& info,
diff --git a/video/send_statistics_proxy.cc b/video/send_statistics_proxy.cc
index bab495d..00dd7bf 100644
--- a/video/send_statistics_proxy.cc
+++ b/video/send_statistics_proxy.cc
@@ -539,6 +539,10 @@
PurgeOldStats();
stats_.input_frame_rate =
round(uma_container_->input_frame_rate_tracker_.ComputeRate());
+ stats_.content_type =
+ content_type_ == VideoEncoderConfig::ContentType::kRealtimeVideo
+ ? VideoContentType::UNSPECIFIED
+ : VideoContentType::SCREENSHARE;
return stats_;
}