Fix target bitrate handling for a single layer VP9 screenshare

For a single layer vp9, the target bitrate was not set correctly. This
may cause a problem for screenshare case, since target bitrate is
respected in that case. If it were less than a min bitrate, the only
spatial layer was permanently disabled.

Bug: webrtc:10257
Change-Id: I0980349adfc2970f810acc51a3e2a31ecbb2bbd2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125681
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26970}
This commit is contained in:
Ilya Nikolaevskiy
2019-03-05 10:08:35 +01:00
committed by Commit Bot
parent 977b3351b9
commit 9ef5e056f9
3 changed files with 14 additions and 0 deletions

View File

@ -203,6 +203,7 @@ VideoBitrateAllocation SvcRateAllocator::GetAllocationScreenSharing(
codec_.spatialLayers[sl_idx].minBitrate * 1000;
const size_t target_bitrate_bps =
codec_.spatialLayers[sl_idx].targetBitrate * 1000;
RTC_DCHECK_LE(min_bitrate_bps, target_bitrate_bps);
const size_t bitrate_bps = std::min(left_bitrate_bps, target_bitrate_bps);
if (bitrate_bps >= min_bitrate_bps) {