blob: 5b6322da4c0eb7d18247ebcb467b54ece8ab08e0 [file] [log] [blame]
Karl Wiberg7275e182017-10-25 09:57:40 +02001/*
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
15namespace webrtc {
16
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020017absl::optional<AudioEncoderOpusConfig> AudioEncoderOpus::SdpToConfig(
Karl Wiberg7275e182017-10-25 09:57:40 +020018 const SdpAudioFormat& format) {
19 return AudioEncoderOpusImpl::SdpToConfig(format);
20}
21
22void AudioEncoderOpus::AppendSupportedEncoders(
23 std::vector<AudioCodecSpec>* specs) {
24 AudioEncoderOpusImpl::AppendSupportedEncoders(specs);
25}
26
27AudioCodecInfo AudioEncoderOpus::QueryAudioEncoder(
28 const AudioEncoderOpusConfig& config) {
29 return AudioEncoderOpusImpl::QueryAudioEncoder(config);
30}
31
32std::unique_ptr<AudioEncoder> AudioEncoderOpus::MakeAudioEncoder(
33 const AudioEncoderOpusConfig& config,
Karl Wiberg17668ec2018-03-01 15:13:27 +010034 int payload_type,
Jonas Oreland6e2b9e22022-03-15 14:29:00 +010035 absl::optional<AudioCodecPairId> /*codec_pair_id*/,
Jonas Orelande62c2f22022-03-29 11:04:48 +020036 const FieldTrialsView* field_trials) {
Ivo Creusendeb1b1b2021-11-24 19:29:10 +000037 if (!config.IsOk()) {
38 RTC_DCHECK_NOTREACHED();
39 return nullptr;
40 }
Karl Wiberg7275e182017-10-25 09:57:40 +020041 return AudioEncoderOpusImpl::MakeAudioEncoder(config, payload_type);
42}
43
44} // namespace webrtc