| 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..0f11e4ff1c8a00dccb0724759ba61e3cd8a0bf46 100644
|
| --- a/webrtc/video/send_statistics_proxy.cc
|
| +++ b/webrtc/video/send_statistics_proxy.cc
|
| @@ -339,14 +339,26 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
| }
|
| }
|
|
|
| -void SendStatisticsProxy::SetContentType(
|
| - VideoEncoderConfig::ContentType content_type) {
|
| +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;
|
| + }
|
| + }
|
| +
|
| rtc::CritScope lock(&crit_);
|
| - if (content_type_ != content_type) {
|
| + stats_.preferred_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;
|
| }
|
| }
|
|
|
|
|