From 6c0e94650e6963202e9c92248947a0cb51de4010 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Mon, 2 Dec 2019 17:11:18 +0100 Subject: [PATCH] Fix VP8 encoder maxFramerate support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Erik Språng Cr-Commit-Position: refs/heads/master@{#29982} --- .../video_coding/codecs/vp8/libvpx_vp8_encoder.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc index 42d13a02da..e3776aac92 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc @@ -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,