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

Side by Side Diff: webrtc/modules/audio_coding/acm2/rent_a_codec.cc

Issue 1677013002: Switch to using new ACM methods for encoder management (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@acm-13
Patch Set: Solar review comments Created 4 years, 8 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 for (const CodecInst& ci : RentACodec::Database()) { 256 for (const CodecInst& ci : RentACodec::Database()) {
257 RentACodec::RegisterCngPayloadType(&cng_payload_types, ci); 257 RentACodec::RegisterCngPayloadType(&cng_payload_types, ci);
258 RentACodec::RegisterRedPayloadType(&red_payload_types, ci); 258 RentACodec::RegisterRedPayloadType(&red_payload_types, ci);
259 } 259 }
260 } 260 }
261 261
262 RentACodec::StackParameters::~StackParameters() = default; 262 RentACodec::StackParameters::~StackParameters() = default;
263 263
264 std::unique_ptr<AudioEncoder> RentACodec::RentEncoderStack( 264 std::unique_ptr<AudioEncoder> RentACodec::RentEncoderStack(
265 StackParameters* param) { 265 StackParameters* param) {
266 RTC_DCHECK(param->speech_encoder); 266 if (!param->speech_encoder)
267 return nullptr;
267 268
268 if (param->use_codec_fec) { 269 if (param->use_codec_fec) {
269 // Switch FEC on. On failure, remember that FEC is off. 270 // Switch FEC on. On failure, remember that FEC is off.
270 if (!param->speech_encoder->SetFec(true)) 271 if (!param->speech_encoder->SetFec(true))
271 param->use_codec_fec = false; 272 param->use_codec_fec = false;
272 } else { 273 } else {
273 // Switch FEC off. This shouldn't fail. 274 // Switch FEC off. This shouldn't fail.
274 const bool success = param->speech_encoder->SetFec(false); 275 const bool success = param->speech_encoder->SetFec(false);
275 RTC_DCHECK(success); 276 RTC_DCHECK(success);
276 } 277 }
(...skipping 25 matching lines...) Expand all
302 } 303 }
303 return encoder_stack; 304 return encoder_stack;
304 } 305 }
305 306
306 std::unique_ptr<AudioDecoder> RentACodec::RentIsacDecoder() { 307 std::unique_ptr<AudioDecoder> RentACodec::RentIsacDecoder() {
307 return CreateIsacDecoder(isac_bandwidth_info_); 308 return CreateIsacDecoder(isac_bandwidth_info_);
308 } 309 }
309 310
310 } // namespace acm2 311 } // namespace acm2
311 } // namespace webrtc 312 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698