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; |
} |
} |