Add a new function to BitrateAllocation: HasBitrate.

This can be used to determine whether the bitrate of a given spatial and temporal layer has been set in the allocation, even if the value it's set to is zero.
GetBitrate still returns 0 if the queried layer does not have the bitrate set.

Bug: webrtc:8479
Change-Id: I1d982e211da9b052fcccdbf588b67da1a4550c60
Reviewed-on: https://webrtc-review.googlesource.com/17440
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Varga <erikvarga@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20852}
This commit is contained in:
erikvarga@webrtc.org
2017-11-15 14:58:23 +01:00
committed by Commit Bot
parent d7e251378b
commit 01f2ec35a6
6 changed files with 114 additions and 16 deletions

View File

@ -594,8 +594,14 @@ class BitrateAllocation {
size_t temporal_index,
uint32_t bitrate_bps);
bool HasBitrate(size_t spatial_index, size_t temporal_index) const;
uint32_t GetBitrate(size_t spatial_index, size_t temporal_index) const;
// Whether the specific spatial layers has the bitrate set in any of its
// temporal layers.
bool IsSpatialLayerUsed(size_t spatial_index) const;
// Get the sum of all the temporal layer for a specific spatial layer.
uint32_t GetSpatialLayerSum(size_t spatial_index) const;
@ -616,6 +622,7 @@ class BitrateAllocation {
private:
uint32_t sum_;
uint32_t bitrates_[kMaxSpatialLayers][kMaxTemporalStreams];
bool has_bitrate_[kMaxSpatialLayers][kMaxTemporalStreams];
};
// Bandwidth over-use detector options. These are used to drive