OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * |
| 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 |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #include "webrtc/api/audio_codecs/isac/audio_decoder_isac_float.h" |
| 12 |
| 13 #include "webrtc/common_types.h" |
| 14 #include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_decoder_isa
c.h" |
| 15 #include "webrtc/rtc_base/ptr_util.h" |
| 16 |
| 17 namespace webrtc { |
| 18 |
| 19 rtc::Optional<AudioDecoderIsacFloat::Config> AudioDecoderIsacFloat::SdpToConfig( |
| 20 const SdpAudioFormat& format) { |
| 21 if (STR_CASE_CMP(format.name.c_str(), "ISAC") == 0 && |
| 22 (format.clockrate_hz == 16000 || format.clockrate_hz == 32000) && |
| 23 format.num_channels == 1) { |
| 24 Config config; |
| 25 config.sample_rate_hz = format.clockrate_hz; |
| 26 return rtc::Optional<Config>(config); |
| 27 } else { |
| 28 return rtc::Optional<Config>(); |
| 29 } |
| 30 } |
| 31 |
| 32 void AudioDecoderIsacFloat::AppendSupportedDecoders( |
| 33 std::vector<AudioCodecSpec>* specs) { |
| 34 specs->push_back({{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}}); |
| 35 specs->push_back({{"ISAC", 32000, 1}, {32000, 1, 56000, 10000, 56000}}); |
| 36 } |
| 37 |
| 38 std::unique_ptr<AudioDecoder> AudioDecoderIsacFloat::MakeAudioDecoder( |
| 39 Config config) { |
| 40 RTC_DCHECK(config.IsOk()); |
| 41 return rtc::MakeUnique<AudioDecoderIsacFloatImpl>(config.sample_rate_hz); |
| 42 } |
| 43 |
| 44 } // namespace webrtc |
OLD | NEW |