Karl Wiberg | 7275e18 | 2017-10-25 07:57:40 | [diff] [blame] | 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 "api/audio_codecs/opus/audio_encoder_opus.h" |
| 12 | |
| 13 | #include "modules/audio_coding/codecs/opus/audio_encoder_opus.h" |
| 14 | |
| 15 | namespace webrtc { |
| 16 | |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 17 | absl::optional<AudioEncoderOpusConfig> AudioEncoderOpus::SdpToConfig( |
Karl Wiberg | 7275e18 | 2017-10-25 07:57:40 | [diff] [blame] | 18 | const SdpAudioFormat& format) { |
| 19 | return AudioEncoderOpusImpl::SdpToConfig(format); |
| 20 | } |
| 21 | |
| 22 | void AudioEncoderOpus::AppendSupportedEncoders( |
| 23 | std::vector<AudioCodecSpec>* specs) { |
| 24 | AudioEncoderOpusImpl::AppendSupportedEncoders(specs); |
| 25 | } |
| 26 | |
| 27 | AudioCodecInfo AudioEncoderOpus::QueryAudioEncoder( |
| 28 | const AudioEncoderOpusConfig& config) { |
| 29 | return AudioEncoderOpusImpl::QueryAudioEncoder(config); |
| 30 | } |
| 31 | |
| 32 | std::unique_ptr<AudioEncoder> AudioEncoderOpus::MakeAudioEncoder( |
| 33 | const AudioEncoderOpusConfig& config, |
Karl Wiberg | 17668ec | 2018-03-01 14:13:27 | [diff] [blame] | 34 | int payload_type, |
Danil Chapovalov | 0bc58cf | 2018-06-21 11:32:56 | [diff] [blame] | 35 | absl::optional<AudioCodecPairId> /*codec_pair_id*/) { |
Ivo Creusen | deb1b1b | 2021-11-24 19:29:10 | [diff] [blame^] | 36 | if (!config.IsOk()) { |
| 37 | RTC_DCHECK_NOTREACHED(); |
| 38 | return nullptr; |
| 39 | } |
Karl Wiberg | 7275e18 | 2017-10-25 07:57:40 | [diff] [blame] | 40 | return AudioEncoderOpusImpl::MakeAudioEncoder(config, payload_type); |
| 41 | } |
| 42 | |
| 43 | } // namespace webrtc |