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

Side by Side Diff: webrtc/media/engine/webrtcmediaengine.cc

Issue 2986163002: Audit of kConstants missing the const qualifier (Closed)
Patch Set: rebase + constexpr Created 3 years, 4 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) { 150 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) {
151 return CreateWebRtcMediaEngine( 151 return CreateWebRtcMediaEngine(
152 adm, audio_encoder_factory, audio_decoder_factory, video_encoder_factory, 152 adm, audio_encoder_factory, audio_decoder_factory, video_encoder_factory,
153 video_decoder_factory, audio_mixer, audio_processing); 153 video_decoder_factory, audio_mixer, audio_processing);
154 } 154 }
155 155
156 namespace { 156 namespace {
157 // Remove mutually exclusive extensions with lower priority. 157 // Remove mutually exclusive extensions with lower priority.
158 void DiscardRedundantExtensions( 158 void DiscardRedundantExtensions(
159 std::vector<webrtc::RtpExtension>* extensions, 159 std::vector<webrtc::RtpExtension>* extensions,
160 rtc::ArrayView<const char*> extensions_decreasing_prio) { 160 rtc::ArrayView<const char* const> extensions_decreasing_prio) {
161 RTC_DCHECK(extensions); 161 RTC_DCHECK(extensions);
162 bool found = false; 162 bool found = false;
163 for (const char* uri : extensions_decreasing_prio) { 163 for (const char* uri : extensions_decreasing_prio) {
164 auto it = std::find_if( 164 auto it = std::find_if(
165 extensions->begin(), extensions->end(), 165 extensions->begin(), extensions->end(),
166 [uri](const webrtc::RtpExtension& rhs) { return rhs.uri == uri; }); 166 [uri](const webrtc::RtpExtension& rhs) { return rhs.uri == uri; });
167 if (it != extensions->end()) { 167 if (it != extensions->end()) {
168 if (found) { 168 if (found) {
169 extensions->erase(it); 169 extensions->erase(it);
170 } 170 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // Remove unnecessary extensions (used on send side). 221 // Remove unnecessary extensions (used on send side).
222 if (filter_redundant_extensions) { 222 if (filter_redundant_extensions) {
223 auto it = std::unique( 223 auto it = std::unique(
224 result.begin(), result.end(), 224 result.begin(), result.end(),
225 [](const webrtc::RtpExtension& rhs, const webrtc::RtpExtension& lhs) { 225 [](const webrtc::RtpExtension& rhs, const webrtc::RtpExtension& lhs) {
226 return rhs.uri == lhs.uri && rhs.encrypt == lhs.encrypt; 226 return rhs.uri == lhs.uri && rhs.encrypt == lhs.encrypt;
227 }); 227 });
228 result.erase(it, result.end()); 228 result.erase(it, result.end());
229 229
230 // Keep just the highest priority extension of any in the following list. 230 // Keep just the highest priority extension of any in the following list.
231 static const char* kBweExtensionPriorities[] = { 231 static const char* const kBweExtensionPriorities[] = {
232 webrtc::RtpExtension::kTransportSequenceNumberUri, 232 webrtc::RtpExtension::kTransportSequenceNumberUri,
233 webrtc::RtpExtension::kAbsSendTimeUri, 233 webrtc::RtpExtension::kAbsSendTimeUri,
234 webrtc::RtpExtension::kTimestampOffsetUri}; 234 webrtc::RtpExtension::kTimestampOffsetUri};
235 DiscardRedundantExtensions(&result, kBweExtensionPriorities); 235 DiscardRedundantExtensions(&result, kBweExtensionPriorities);
236 } 236 }
237 237
238 return result; 238 return result;
239 } 239 }
240 240
241 webrtc::Call::Config::BitrateConfig GetBitrateConfigForCodec( 241 webrtc::Call::Config::BitrateConfig GetBitrateConfigForCodec(
(...skipping 15 matching lines...) Expand all
257 } 257 }
258 if (codec.GetParam(kCodecParamMaxBitrate, &bitrate_kbps) && 258 if (codec.GetParam(kCodecParamMaxBitrate, &bitrate_kbps) &&
259 bitrate_kbps > 0) { 259 bitrate_kbps > 0) {
260 config.max_bitrate_bps = bitrate_kbps * 1000; 260 config.max_bitrate_bps = bitrate_kbps * 1000;
261 } else { 261 } else {
262 config.max_bitrate_bps = -1; 262 config.max_bitrate_bps = -1;
263 } 263 }
264 return config; 264 return config;
265 } 265 }
266 } // namespace cricket 266 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/config.cc ('k') | webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_hist.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698