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 11 matching lines...) Expand all Loading... |
22 int channels) { | 22 int channels) { |
23 return CodecIdFromIndex( | 23 return CodecIdFromIndex( |
24 ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels)); | 24 ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels)); |
25 } | 25 } |
26 | 26 |
27 rtc::Maybe<CodecInst> RentACodec::CodecInstById(CodecId codec_id) { | 27 rtc::Maybe<CodecInst> RentACodec::CodecInstById(CodecId codec_id) { |
28 rtc::Maybe<int> mi = CodecIndexFromId(codec_id); | 28 rtc::Maybe<int> mi = CodecIndexFromId(codec_id); |
29 return mi ? rtc::Maybe<CodecInst>(Database()[*mi]) : rtc::Maybe<CodecInst>(); | 29 return mi ? rtc::Maybe<CodecInst>(Database()[*mi]) : rtc::Maybe<CodecInst>(); |
30 } | 30 } |
31 | 31 |
| 32 rtc::Maybe<RentACodec::CodecId> RentACodec::CodecIdByInst( |
| 33 const CodecInst& codec_inst) { |
| 34 return CodecIdFromIndex(ACMCodecDB::CodecNumber(codec_inst)); |
| 35 } |
| 36 |
32 rtc::Maybe<CodecInst> RentACodec::CodecInstByParams(const char* payload_name, | 37 rtc::Maybe<CodecInst> RentACodec::CodecInstByParams(const char* payload_name, |
33 int sampling_freq_hz, | 38 int sampling_freq_hz, |
34 int channels) { | 39 int channels) { |
35 rtc::Maybe<CodecId> codec_id = | 40 rtc::Maybe<CodecId> codec_id = |
36 CodecIdByParams(payload_name, sampling_freq_hz, channels); | 41 CodecIdByParams(payload_name, sampling_freq_hz, channels); |
37 if (!codec_id) | 42 if (!codec_id) |
38 return rtc::Maybe<CodecInst>(); | 43 return rtc::Maybe<CodecInst>(); |
39 rtc::Maybe<CodecInst> ci = CodecInstById(*codec_id); | 44 rtc::Maybe<CodecInst> ci = CodecInstById(*codec_id); |
40 RTC_DCHECK(ci); | 45 RTC_DCHECK(ci); |
41 | 46 |
(...skipping 28 matching lines...) Expand all Loading... |
70 return rtc::Maybe<NetEqDecoder>(); | 75 return rtc::Maybe<NetEqDecoder>(); |
71 const NetEqDecoder ned = ACMCodecDB::neteq_decoders_[*i]; | 76 const NetEqDecoder ned = ACMCodecDB::neteq_decoders_[*i]; |
72 return rtc::Maybe<NetEqDecoder>( | 77 return rtc::Maybe<NetEqDecoder>( |
73 (ned == NetEqDecoder::kDecoderOpus && num_channels == 2) | 78 (ned == NetEqDecoder::kDecoderOpus && num_channels == 2) |
74 ? NetEqDecoder::kDecoderOpus_2ch | 79 ? NetEqDecoder::kDecoderOpus_2ch |
75 : ned); | 80 : ned); |
76 } | 81 } |
77 | 82 |
78 } // namespace acm2 | 83 } // namespace acm2 |
79 } // namespace webrtc | 84 } // namespace webrtc |
OLD | NEW |