blob: d0aae9044e203ebd194b6cc6303f36ee76f2e461 [file] [log] [blame]
solenbergdb3c9b02017-06-28 02:05:04 -07001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "api/audio_codecs/ilbc/audio_decoder_ilbc.h"
solenbergdb3c9b02017-06-28 02:05:04 -070012
13#include <memory>
14#include <vector>
15
Niels Möller2edab4c2018-10-22 09:48:08 +020016#include "absl/strings/match.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.h"
solenbergdb3c9b02017-06-28 02:05:04 -070018
19namespace webrtc {
20
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020021absl::optional<AudioDecoderIlbc::Config> AudioDecoderIlbc::SdpToConfig(
solenbergdb3c9b02017-06-28 02:05:04 -070022 const SdpAudioFormat& format) {
Niels Möller2edab4c2018-10-22 09:48:08 +020023 return absl::EqualsIgnoreCase(format.name, "ILBC") &&
solenbergdb3c9b02017-06-28 02:05:04 -070024 format.clockrate_hz == 8000 && format.num_channels == 1
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020025 ? absl::optional<Config>(Config())
26 : absl::nullopt;
solenbergdb3c9b02017-06-28 02:05:04 -070027}
28
29void AudioDecoderIlbc::AppendSupportedDecoders(
30 std::vector<AudioCodecSpec>* specs) {
31 specs->push_back({{"ILBC", 8000, 1}, {8000, 1, 13300}});
32}
33
34std::unique_ptr<AudioDecoder> AudioDecoderIlbc::MakeAudioDecoder(
Karl Wiberg17668ec2018-03-01 15:13:27 +010035 Config config,
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020036 absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
Mirko Bonadei317a1f02019-09-17 17:06:18 +020037 return std::make_unique<AudioDecoderIlbcImpl>();
solenbergdb3c9b02017-06-28 02:05:04 -070038}
39
40} // namespace webrtc