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_fix.h" |
| 12 |
| 13 #include "webrtc/common_types.h" |
| 14 #include "webrtc/modules/audio_coding/codecs/isac/fix/include/audio_decoder_isac
fix.h" |
| 15 #include "webrtc/rtc_base/ptr_util.h" |
| 16 |
| 17 namespace webrtc { |
| 18 |
| 19 rtc::Optional<AudioDecoderIsacFix::Config> AudioDecoderIsacFix::SdpToConfig( |
| 20 const SdpAudioFormat& format) { |
| 21 return STR_CASE_CMP(format.name.c_str(), "ISAC") == 0 && |
| 22 format.clockrate_hz == 16000 && format.num_channels == 1 |
| 23 ? rtc::Optional<Config>(Config()) |
| 24 : rtc::Optional<Config>(); |
| 25 } |
| 26 |
| 27 void AudioDecoderIsacFix::AppendSupportedDecoders( |
| 28 std::vector<AudioCodecSpec>* specs) { |
| 29 specs->push_back({{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}}); |
| 30 } |
| 31 |
| 32 std::unique_ptr<AudioDecoder> AudioDecoderIsacFix::MakeAudioDecoder( |
| 33 Config config) { |
| 34 return rtc::MakeUnique<AudioDecoderIsacFixImpl>(16000); |
| 35 } |
| 36 |
| 37 } // namespace webrtc |
OLD | NEW |