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

Side by Side Diff: webrtc/video/payload_router.cc

Issue 2947633003: Allow parsing empty RTCP TargetBitrate messages, but stop sending them. (Closed)
Patch Set: Add comment about using ToString only in tests Created 3 years, 6 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 const BitrateAllocation& bitrate) { 149 const BitrateAllocation& bitrate) {
150 rtc::CritScope lock(&crit_); 150 rtc::CritScope lock(&crit_);
151 if (IsActive()) { 151 if (IsActive()) {
152 if (rtp_modules_.size() == 1) { 152 if (rtp_modules_.size() == 1) {
153 // If spatial scalability is enabled, it is covered by a single stream. 153 // If spatial scalability is enabled, it is covered by a single stream.
154 rtp_modules_[0]->SetVideoBitrateAllocation(bitrate); 154 rtp_modules_[0]->SetVideoBitrateAllocation(bitrate);
155 } else { 155 } else {
156 // Simulcast is in use, split the BitrateAllocation into one struct per 156 // Simulcast is in use, split the BitrateAllocation into one struct per
157 // rtp stream, moving over the temporal layer allocation. 157 // rtp stream, moving over the temporal layer allocation.
158 for (size_t si = 0; si < rtp_modules_.size(); ++si) { 158 for (size_t si = 0; si < rtp_modules_.size(); ++si) {
159 // Don't send empty TargetBitrate messages on streams not being relayed.
160 if (bitrate.GetSpatialLayerSum(si) == 0)
161 break;
162
159 BitrateAllocation layer_bitrate; 163 BitrateAllocation layer_bitrate;
160 for (int tl = 0; tl < kMaxTemporalStreams; ++tl) 164 for (int tl = 0; tl < kMaxTemporalStreams; ++tl)
161 layer_bitrate.SetBitrate(0, tl, bitrate.GetBitrate(si, tl)); 165 layer_bitrate.SetBitrate(0, tl, bitrate.GetBitrate(si, tl));
162 rtp_modules_[si]->SetVideoBitrateAllocation(layer_bitrate); 166 rtp_modules_[si]->SetVideoBitrateAllocation(layer_bitrate);
163 } 167 }
164 } 168 }
165 } 169 }
166 } 170 }
167 171
168 } // namespace webrtc 172 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc ('k') | webrtc/video/payload_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698