Add AudioDecoderIsacT::Config to include sampling rate and BWInfo object
This CL will make AudioDecoderIsacT symmetrical to AudioEncoderIsacT. Bug: webrtc:10826 Change-Id: I78d1cf7bc2245bf4a282aabd81c8ece6ca23f285 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146683 Commit-Queue: Jiawei Ou <ouj@fb.com> Reviewed-by: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28847}
This commit is contained in:
@ -24,10 +24,13 @@ namespace webrtc {
|
||||
template <typename T>
|
||||
class AudioDecoderIsacT final : public AudioDecoder {
|
||||
public:
|
||||
explicit AudioDecoderIsacT(int sample_rate_hz);
|
||||
AudioDecoderIsacT(int sample_rate_hz,
|
||||
const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo);
|
||||
~AudioDecoderIsacT() override;
|
||||
struct Config {
|
||||
bool IsOk() const;
|
||||
rtc::scoped_refptr<LockedIsacBandwidthInfo> bwinfo;
|
||||
int sample_rate_hz = 16000;
|
||||
};
|
||||
explicit AudioDecoderIsacT(const Config& config);
|
||||
virtual ~AudioDecoderIsacT() override;
|
||||
|
||||
bool HasDecodePlc() const override;
|
||||
size_t DecodePlc(size_t num_frames, int16_t* decoded) override;
|
||||
|
||||
@ -16,16 +16,15 @@
|
||||
namespace webrtc {
|
||||
|
||||
template <typename T>
|
||||
AudioDecoderIsacT<T>::AudioDecoderIsacT(int sample_rate_hz)
|
||||
: AudioDecoderIsacT(sample_rate_hz, nullptr) {}
|
||||
bool AudioDecoderIsacT<T>::Config::IsOk() const {
|
||||
return (sample_rate_hz == 16000 || sample_rate_hz == 32000);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
AudioDecoderIsacT<T>::AudioDecoderIsacT(
|
||||
int sample_rate_hz,
|
||||
const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo)
|
||||
: sample_rate_hz_(sample_rate_hz), bwinfo_(bwinfo) {
|
||||
RTC_CHECK(sample_rate_hz == 16000 || sample_rate_hz == 32000)
|
||||
<< "Unsupported sample rate " << sample_rate_hz;
|
||||
AudioDecoderIsacT<T>::AudioDecoderIsacT(const Config& config)
|
||||
: sample_rate_hz_(config.sample_rate_hz), bwinfo_(config.bwinfo) {
|
||||
RTC_CHECK(config.IsOk()) << "Unsupported sample rate "
|
||||
<< config.sample_rate_hz;
|
||||
RTC_CHECK_EQ(0, T::Create(&isac_state_));
|
||||
T::DecoderInit(isac_state_);
|
||||
if (bwinfo_) {
|
||||
|
||||
Reference in New Issue
Block a user