Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 2351633002: Let ViEEncoder handle resolution changes. (Closed)
Patch Set: Fix perf test Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/video/send_statistics_proxy.cc
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
index d47ccbdfec52b64da17cd2947db8508dd1316e35..e1fc390709c9484074e8eef451fb6f8ea291f03e 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -339,14 +339,27 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
}
}
-void SendStatisticsProxy::SetContentType(
- VideoEncoderConfig::ContentType content_type) {
+// --TODO(perkj) test now!!!!
+void SendStatisticsProxy::OnEncoderReconfigured(
+ const VideoEncoderConfig& config,
+ const std::vector<VideoStream>& streams) {
+ int preferred_bitrate_bps = 0;
+ for (size_t i = 0; i < streams.size(); ++i) {
+ if (i == streams.size() - 1) {
+ preferred_bitrate_bps += streams[i].max_bitrate_bps;
+ } else {
+ preferred_bitrate_bps += streams[i].target_bitrate_bps;
+ }
+ }
sprang_webrtc 2016/09/22 13:06:16 This seems a bit roundabout.. If "preferred" targe
perkj_webrtc 2016/09/26 12:09:42 This is a stat in WebrtcVideoSendStream and and it
sprang_webrtc 2016/09/26 13:47:37 As discussed offline, move to vie encoder and use
+
rtc::CritScope lock(&crit_);
- if (content_type_ != content_type) {
+ stats_.preffered_media_bitrate_bps = preferred_bitrate_bps;
+
+ if (content_type_ != config.content_type) {
uma_container_->UpdateHistograms(rtp_config_, stats_);
- uma_container_.reset(
- new UmaSamplesContainer(GetUmaPrefix(content_type), stats_, clock_));
- content_type_ = content_type;
+ uma_container_.reset(new UmaSamplesContainer(
+ GetUmaPrefix(config.content_type), stats_, clock_));
+ content_type_ = config.content_type;
}
}

Powered by Google App Engine
This is Rietveld 408576698