Fix VP8 encoder maxFramerate support

By using the top level VideoCodec maxFramerate, the FrameBufferController
would sometimes not use the intended value for each simulcast layer.
In the case of "conference mode", top level maxFramerate was set to 5,
which matches the lower layer but is different from the overall maximum
maxFramerate which would be 60.

Bug: webrtc:11117
Change-Id: I4e1e68184d32675b083cd8e4e73a5291dc8fa620
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161096
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29982}
This commit is contained in:
Florent Castelli
2019-12-02 17:11:18 +01:00
committed by Commit Bot
parent 4011de012f
commit 6c0e94650e

View File

@ -652,10 +652,15 @@ int LibvpxVp8Encoder::InitEncode(const VideoCodec* inst,
vpx_configs_[0].rc_target_bitrate = stream_bitrates[stream_idx_cfg_0];
if (stream_bitrates[stream_idx_cfg_0] > 0) {
uint32_t maxFramerate =
inst->simulcastStream[stream_idx_cfg_0].maxFramerate;
if (!maxFramerate) {
maxFramerate = inst->maxFramerate;
}
frame_buffer_controller_->OnRatesUpdated(
stream_idx_cfg_0,
allocation.GetTemporalLayerAllocation(stream_idx_cfg_0),
inst->maxFramerate);
allocation.GetTemporalLayerAllocation(stream_idx_cfg_0), maxFramerate);
}
frame_buffer_controller_->SetQpLimits(stream_idx_cfg_0,
vpx_configs_[0].rc_min_quantizer,
@ -685,9 +690,13 @@ int LibvpxVp8Encoder::InitEncode(const VideoCodec* inst,
SetStreamState(stream_bitrates[stream_idx] > 0, stream_idx);
vpx_configs_[i].rc_target_bitrate = stream_bitrates[stream_idx];
if (stream_bitrates[stream_idx] > 0) {
uint32_t maxFramerate = inst->simulcastStream[stream_idx].maxFramerate;
if (!maxFramerate) {
maxFramerate = inst->maxFramerate;
}
frame_buffer_controller_->OnRatesUpdated(
stream_idx, allocation.GetTemporalLayerAllocation(stream_idx),
inst->maxFramerate);
maxFramerate);
}
frame_buffer_controller_->SetQpLimits(stream_idx,
vpx_configs_[i].rc_min_quantizer,