Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: webrtc/common_types.cc

Issue 2549233005: Reject XR TargetBitrate items with unsupported layer indices (Closed)
Patch Set: Addressed comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_types.cc
diff --git a/webrtc/common_types.cc b/webrtc/common_types.cc
index aa76768465bb5bcc8dcd1b5eeb84b99473baab64..f5b487f6be0a5280c1e0a7c84f0037edd8e2db4f 100644
--- a/webrtc/common_types.cc
+++ b/webrtc/common_types.cc
@@ -154,9 +154,9 @@ BitrateAllocation::BitrateAllocation() : sum_(0), bitrates_{} {}
bool BitrateAllocation::SetBitrate(size_t spatial_index,
size_t temporal_index,
uint32_t bitrate_bps) {
- RTC_DCHECK_LT(spatial_index, kMaxSpatialLayers);
- RTC_DCHECK_LT(temporal_index, kMaxTemporalStreams);
- RTC_DCHECK_LE(bitrates_[spatial_index][temporal_index], sum_);
+ RTC_CHECK_LT(spatial_index, kMaxSpatialLayers);
+ RTC_CHECK_LT(temporal_index, kMaxTemporalStreams);
+ RTC_CHECK_LE(bitrates_[spatial_index][temporal_index], sum_);
uint64_t new_bitrate_sum_bps = sum_;
new_bitrate_sum_bps -= bitrates_[spatial_index][temporal_index];
new_bitrate_sum_bps += bitrate_bps;
@@ -170,14 +170,14 @@ bool BitrateAllocation::SetBitrate(size_t spatial_index,
uint32_t BitrateAllocation::GetBitrate(size_t spatial_index,
size_t temporal_index) const {
- RTC_DCHECK_LT(spatial_index, kMaxSpatialLayers);
- RTC_DCHECK_LT(temporal_index, kMaxTemporalStreams);
+ RTC_CHECK_LT(spatial_index, kMaxSpatialLayers);
+ RTC_CHECK_LT(temporal_index, kMaxTemporalStreams);
return bitrates_[spatial_index][temporal_index];
}
// Get the sum of all the temporal layer for a specific spatial layer.
uint32_t BitrateAllocation::GetSpatialLayerSum(size_t spatial_index) const {
- RTC_DCHECK_LT(spatial_index, kMaxSpatialLayers);
+ RTC_CHECK_LT(spatial_index, kMaxSpatialLayers);
uint32_t sum = 0;
for (int i = 0; i < kMaxTemporalStreams; ++i)
sum += bitrates_[spatial_index][i];
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698