Chromium Code Reviews

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/codec_owner.cc

Issue 1368933002: Revert of Don't link with audio codecs that we don't use (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@dmove-clean
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 113 matching lines...)
124 return rtc_make_scoped_ptr(new AudioEncoderG722(speech_inst)); 124 return rtc_make_scoped_ptr(new AudioEncoderG722(speech_inst));
125 } else { 125 } else {
126 FATAL() << "Could not create encoder of type " << speech_inst.plname; 126 FATAL() << "Could not create encoder of type " << speech_inst.plname;
127 return rtc::scoped_ptr<AudioEncoder>(); 127 return rtc::scoped_ptr<AudioEncoder>();
128 } 128 }
129 } 129 }
130 130
131 AudioEncoder* CreateRedEncoder(int red_payload_type, 131 AudioEncoder* CreateRedEncoder(int red_payload_type,
132 AudioEncoder* encoder, 132 AudioEncoder* encoder,
133 rtc::scoped_ptr<AudioEncoder>* red_encoder) { 133 rtc::scoped_ptr<AudioEncoder>* red_encoder) {
134 #ifdef WEBRTC_CODEC_RED 134 if (red_payload_type == -1) {
135 if (red_payload_type != -1) { 135 red_encoder->reset();
136 AudioEncoderCopyRed::Config config; 136 return encoder;
137 config.payload_type = red_payload_type;
138 config.speech_encoder = encoder;
139 red_encoder->reset(new AudioEncoderCopyRed(config));
140 return red_encoder->get();
141 } 137 }
142 #endif 138 AudioEncoderCopyRed::Config config;
143 139 config.payload_type = red_payload_type;
144 red_encoder->reset(); 140 config.speech_encoder = encoder;
145 return encoder; 141 red_encoder->reset(new AudioEncoderCopyRed(config));
142 return red_encoder->get();
146 } 143 }
147 144
148 void CreateCngEncoder(int cng_payload_type, 145 void CreateCngEncoder(int cng_payload_type,
149 ACMVADMode vad_mode, 146 ACMVADMode vad_mode,
150 AudioEncoder* encoder, 147 AudioEncoder* encoder,
151 rtc::scoped_ptr<AudioEncoder>* cng_encoder) { 148 rtc::scoped_ptr<AudioEncoder>* cng_encoder) {
152 if (cng_payload_type == -1) { 149 if (cng_payload_type == -1) {
153 cng_encoder->reset(); 150 cng_encoder->reset();
154 return; 151 return;
155 } 152 }
(...skipping 79 matching lines...)
235 } 232 }
236 233
237 const AudioEncoder* CodecOwner::SpeechEncoder() const { 234 const AudioEncoder* CodecOwner::SpeechEncoder() const {
238 RTC_DCHECK(!speech_encoder_ || !external_speech_encoder_); 235 RTC_DCHECK(!speech_encoder_ || !external_speech_encoder_);
239 return external_speech_encoder_ ? external_speech_encoder_ 236 return external_speech_encoder_ ? external_speech_encoder_
240 : speech_encoder_.get(); 237 : speech_encoder_.get();
241 } 238 }
242 239
243 } // namespace acm2 240 } // namespace acm2
244 } // namespace webrtc 241 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/BUILD.gn ('k') | webrtc/modules/audio_coding/main/audio_coding_module.gypi » ('j') | no next file with comments »

Powered by Google App Engine