2017-08-21 06:11:18 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef API_AUDIO_CODECS_ISAC_AUDIO_DECODER_ISAC_FLOAT_H_
|
|
|
|
|
#define API_AUDIO_CODECS_ISAC_AUDIO_DECODER_ISAC_FLOAT_H_
|
2017-08-21 06:11:18 -07:00
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2018-06-21 13:32:56 +02:00
|
|
|
#include "absl/types/optional.h"
|
2018-03-01 15:13:27 +01:00
|
|
|
#include "api/audio_codecs/audio_codec_pair_id.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/audio_codecs/audio_decoder.h"
|
|
|
|
|
#include "api/audio_codecs/audio_format.h"
|
2018-10-08 11:10:10 +00:00
|
|
|
#include "rtc_base/system/rtc_export.h"
|
2017-08-21 06:11:18 -07:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// iSAC decoder API (floating-point implementation) for use as a template
|
|
|
|
|
// parameter to CreateAudioDecoderFactory<...>().
|
|
|
|
|
//
|
|
|
|
|
// NOTE: This struct is still under development and may change without notice.
|
2018-10-08 11:10:10 +00:00
|
|
|
struct RTC_EXPORT AudioDecoderIsacFloat {
|
2017-08-21 06:11:18 -07:00
|
|
|
struct Config {
|
|
|
|
|
bool IsOk() const {
|
|
|
|
|
return sample_rate_hz == 16000 || sample_rate_hz == 32000;
|
|
|
|
|
}
|
|
|
|
|
int sample_rate_hz = 16000;
|
|
|
|
|
};
|
2018-06-21 13:32:56 +02:00
|
|
|
static absl::optional<Config> SdpToConfig(const SdpAudioFormat& audio_format);
|
2017-08-21 06:11:18 -07:00
|
|
|
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);
|
2018-03-01 15:13:27 +01:00
|
|
|
static std::unique_ptr<AudioDecoder> MakeAudioDecoder(
|
|
|
|
|
Config config,
|
2018-06-21 13:32:56 +02:00
|
|
|
absl::optional<AudioCodecPairId> codec_pair_id = absl::nullopt);
|
2017-08-21 06:11:18 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // API_AUDIO_CODECS_ISAC_AUDIO_DECODER_ISAC_FLOAT_H_
|