Reland: googBandwidthLimitedResolution stat is not always set depending on configuration.

TBR=brandtr@webrtc.org,stefan@webrtc.org

Currently |bw_resolutions_disabled| is set per VP8EncoderImpl instance and reported via
OnEncodedImage callback.

Instead move logic to SendStatisticsProxy to determine if resolution is bw limited or not based
on info that is reported to SendStatisticsProxy::OnEncodedImage.

Bug: webrtc:8643
Change-Id: I553cea30dcda34b753b5224f15094a1b7b70a750
Reviewed-on: https://webrtc-review.googlesource.com/31460
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Original-Commit-Position: refs/heads/master@{#21249}
Reviewed-on: https://webrtc-review.googlesource.com/33360
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21319}
This commit is contained in:
Åsa Persson
2017-12-15 15:54:44 +01:00
committed by Commit Bot
parent 570df8b123
commit aa329e7cc3
7 changed files with 210 additions and 88 deletions

View File

@ -254,8 +254,6 @@ TEST_F(TestVp8Impl, OnEncodedImageReportsInfo) {
EXPECT_EQ(kWidth, static_cast<int>(encoded_cb_.encoded_frame_._encodedWidth));
EXPECT_EQ(kHeight,
static_cast<int>(encoded_cb_.encoded_frame_._encodedHeight));
EXPECT_EQ(-1, // Disabled for single stream.
encoded_cb_.encoded_frame_.adapt_reason_.bw_resolutions_disabled);
}
// We only test the encoder here, since the decoded frame rotation is set based

View File

@ -115,15 +115,6 @@ bool ValidSimulcastTemporalLayers(const VideoCodec& codec, int num_streams) {
return true;
}
int NumStreamsDisabled(const std::vector<bool>& streams) {
int num_disabled = 0;
for (bool stream : streams) {
if (!stream)
++num_disabled;
}
return num_disabled;
}
bool GetGfBoostPercentageFromFieldTrialGroup(int* boost_percentage) {
std::string group = webrtc::field_trial::FindFullName(kVp8GfBoostFieldTrial);
if (group.empty())
@ -874,9 +865,6 @@ void VP8EncoderImpl::PopulateCodecSpecific(
int VP8EncoderImpl::GetEncodedPartitions(
const TemporalLayers::FrameConfig tl_configs[],
const VideoFrame& input_image) {
int bw_resolutions_disabled =
(encoders_.size() > 1) ? NumStreamsDisabled(send_stream_) : -1;
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();
@ -949,9 +937,6 @@ int VP8EncoderImpl::GetEncodedPartitions(
codec_.simulcastStream[stream_idx].height;
encoded_images_[encoder_idx]._encodedWidth =
codec_.simulcastStream[stream_idx].width;
// Report once per frame (lowest stream always sent).
encoded_images_[encoder_idx].adapt_reason_.bw_resolutions_disabled =
(stream_idx == 0) ? bw_resolutions_disabled : -1;
int qp_128 = -1;
vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER,
&qp_128);