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 |
11 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 11 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
12 | 12 |
| 13 #include <utility> |
| 14 |
13 #include "webrtc/base/logging.h" | 15 #include "webrtc/base/logging.h" |
14 #include "webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.h" | 16 #include "webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.h" |
15 #include "webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h" | 17 #include "webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h" |
16 #ifdef WEBRTC_CODEC_G722 | 18 #ifdef WEBRTC_CODEC_G722 |
17 #include "webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.h" | 19 #include "webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.h" |
18 #endif | 20 #endif |
19 #ifdef WEBRTC_CODEC_ILBC | 21 #ifdef WEBRTC_CODEC_ILBC |
20 #include "webrtc/modules/audio_coding/codecs/ilbc/audio_encoder_ilbc.h" | 22 #include "webrtc/modules/audio_coding/codecs/ilbc/audio_encoder_ilbc.h" |
21 #endif | 23 #endif |
22 #ifdef WEBRTC_CODEC_ISACFX | 24 #ifdef WEBRTC_CODEC_ISACFX |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } // namespace | 230 } // namespace |
229 | 231 |
230 RentACodec::RentACodec() = default; | 232 RentACodec::RentACodec() = default; |
231 RentACodec::~RentACodec() = default; | 233 RentACodec::~RentACodec() = default; |
232 | 234 |
233 AudioEncoder* RentACodec::RentEncoder(const CodecInst& codec_inst) { | 235 AudioEncoder* RentACodec::RentEncoder(const CodecInst& codec_inst) { |
234 rtc::scoped_ptr<AudioEncoder> enc = | 236 rtc::scoped_ptr<AudioEncoder> enc = |
235 CreateEncoder(codec_inst, &isac_bandwidth_info_); | 237 CreateEncoder(codec_inst, &isac_bandwidth_info_); |
236 if (!enc) | 238 if (!enc) |
237 return nullptr; | 239 return nullptr; |
238 speech_encoder_ = enc.Pass(); | 240 speech_encoder_ = std::move(enc); |
239 return speech_encoder_.get(); | 241 return speech_encoder_.get(); |
240 } | 242 } |
241 | 243 |
242 RentACodec::StackParameters::StackParameters() { | 244 RentACodec::StackParameters::StackParameters() { |
243 // Register the default payload types for RED and CNG. | 245 // Register the default payload types for RED and CNG. |
244 for (const CodecInst& ci : RentACodec::Database()) { | 246 for (const CodecInst& ci : RentACodec::Database()) { |
245 RentACodec::RegisterCngPayloadType(&cng_payload_types, ci); | 247 RentACodec::RegisterCngPayloadType(&cng_payload_types, ci); |
246 RentACodec::RegisterRedPayloadType(&red_payload_types, ci); | 248 RentACodec::RegisterRedPayloadType(&red_payload_types, ci); |
247 } | 249 } |
248 } | 250 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 298 } |
297 | 299 |
298 AudioDecoder* RentACodec::RentIsacDecoder() { | 300 AudioDecoder* RentACodec::RentIsacDecoder() { |
299 if (!isac_decoder_) | 301 if (!isac_decoder_) |
300 isac_decoder_ = CreateIsacDecoder(&isac_bandwidth_info_); | 302 isac_decoder_ = CreateIsacDecoder(&isac_bandwidth_info_); |
301 return isac_decoder_.get(); | 303 return isac_decoder_.get(); |
302 } | 304 } |
303 | 305 |
304 } // namespace acm2 | 306 } // namespace acm2 |
305 } // namespace webrtc | 307 } // namespace webrtc |
OLD | NEW |