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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 return static_cast<size_t>(codec_index) < NumberOfCodecs() | 141 return static_cast<size_t>(codec_index) < NumberOfCodecs() |
142 ? rtc::Maybe<RentACodec::CodecId>( | 142 ? rtc::Maybe<RentACodec::CodecId>( |
143 static_cast<RentACodec::CodecId>(codec_index)) | 143 static_cast<RentACodec::CodecId>(codec_index)) |
144 : rtc::Maybe<RentACodec::CodecId>(); | 144 : rtc::Maybe<RentACodec::CodecId>(); |
145 } | 145 } |
146 | 146 |
147 static rtc::Maybe<CodecId> CodecIdByParams(const char* payload_name, | 147 static rtc::Maybe<CodecId> CodecIdByParams(const char* payload_name, |
148 int sampling_freq_hz, | 148 int sampling_freq_hz, |
149 int channels); | 149 int channels); |
150 static rtc::Maybe<CodecInst> CodecInstById(CodecId codec_id); | 150 static rtc::Maybe<CodecInst> CodecInstById(CodecId codec_id); |
| 151 static rtc::Maybe<CodecId> CodecIdByInst(const CodecInst& codec_inst); |
151 static rtc::Maybe<CodecInst> CodecInstByParams(const char* payload_name, | 152 static rtc::Maybe<CodecInst> CodecInstByParams(const char* payload_name, |
152 int sampling_freq_hz, | 153 int sampling_freq_hz, |
153 int channels); | 154 int channels); |
154 static bool IsCodecValid(const CodecInst& codec_inst); | 155 static bool IsCodecValid(const CodecInst& codec_inst); |
155 | 156 |
156 static inline bool IsPayloadTypeValid(int payload_type) { | 157 static inline bool IsPayloadTypeValid(int payload_type) { |
157 return payload_type >= 0 && payload_type <= 127; | 158 return payload_type >= 0 && payload_type <= 127; |
158 } | 159 } |
159 | 160 |
160 static rtc::ArrayView<const CodecInst> Database(); | 161 static rtc::ArrayView<const CodecInst> Database(); |
161 | 162 |
162 static rtc::Maybe<bool> IsSupportedNumChannels(CodecId codec_id, | 163 static rtc::Maybe<bool> IsSupportedNumChannels(CodecId codec_id, |
163 int num_channels); | 164 int num_channels); |
164 | 165 |
165 static rtc::Maybe<NetEqDecoder> NetEqDecoderFromCodecId(CodecId codec_id, | 166 static rtc::Maybe<NetEqDecoder> NetEqDecoderFromCodecId(CodecId codec_id, |
166 int num_channels); | 167 int num_channels); |
167 }; | 168 }; |
168 | 169 |
169 } // namespace acm2 | 170 } // namespace acm2 |
170 } // namespace webrtc | 171 } // namespace webrtc |
171 | 172 |
172 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_RENT_A_CODEC_H_ | 173 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_RENT_A_CODEC_H_ |
OLD | NEW |