| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |