Index: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
index 3b6df7550fcc3fa7deb127c8f0172f9d6703ef67..ab31b00609461b1d48c7543d6cfd7bb3180a62ab 100644 |
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
@@ -131,6 +131,15 @@ bool ValidSimulcastResolutions(const VideoCodec& codec, int num_streams) { |
} |
return true; |
} |
+ |
+int NumStreamsDisabled(std::vector<bool>& streams) { |
+ int num_disabled = 0; |
+ for (bool stream : streams) { |
+ if (!stream) |
+ ++num_disabled; |
+ } |
+ return num_disabled; |
+} |
} // namespace |
const float kTl1MaxTimeToDropFrames = 20.0f; |
@@ -944,6 +953,11 @@ void VP8EncoderImpl::PopulateCodecSpecific( |
int VP8EncoderImpl::GetEncodedPartitions(const VideoFrame& input_image, |
bool only_predicting_from_key_frame) { |
+ int bw_resolutions_disabled = 0; |
+ bool bw_available = encoders_.size() > 1; |
+ if (bw_available) |
pbos-webrtc
2015/09/28 15:34:38
int bw_resolutions_disabled = bw_available ? NumSt
åsapersson
2015/09/28 15:47:39
Done.
|
+ bw_resolutions_disabled = NumStreamsDisabled(send_stream_); |
+ |
int stream_idx = static_cast<int>(encoders_.size()) - 1; |
int result = WEBRTC_VIDEO_CODEC_OK; |
for (size_t encoder_idx = 0; encoder_idx < encoders_.size(); |
@@ -994,6 +1008,9 @@ int VP8EncoderImpl::GetEncodedPartitions(const VideoFrame& input_image, |
encoded_images_[encoder_idx]._timeStamp = input_image.timestamp(); |
encoded_images_[encoder_idx].capture_time_ms_ = |
input_image.render_time_ms(); |
+ encoded_images_[encoder_idx].adapt_reason_.bw_available = bw_available; |
+ encoded_images_[encoder_idx].adapt_reason_.bw_resolutions_disabled = |
+ bw_resolutions_disabled; |
int qp = -1; |
vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp); |