Index: webrtc/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h |
diff --git a/webrtc/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h b/webrtc/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h |
index b1907bbb394e214aa27620c093f54886f51a6a44..264cca2bf3885c67e7842ae966325c0b886ae1b5 100644 |
--- a/webrtc/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h |
+++ b/webrtc/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h |
@@ -14,18 +14,24 @@ |
#include <vector> |
#include "webrtc/base/constructormagic.h" |
+#include "webrtc/base/optional.h" |
#include "webrtc/base/scoped_ref_ptr.h" |
#include "webrtc/modules/audio_coding/codecs/audio_decoder.h" |
#include "webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h" |
namespace webrtc { |
+// TODO(kwiberg): Remove the possibility of not specifying the sample rate at |
+// object creation time. |
template <typename T> |
class AudioDecoderIsacT final : public AudioDecoder { |
public: |
AudioDecoderIsacT(); |
explicit AudioDecoderIsacT( |
const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo); |
+ explicit AudioDecoderIsacT(int sample_rate_hz); |
+ AudioDecoderIsacT(int sample_rate_hz, |
+ const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo); |
~AudioDecoderIsacT() override; |
bool HasDecodePlc() const override; |
@@ -37,6 +43,7 @@ class AudioDecoderIsacT final : public AudioDecoder { |
uint32_t rtp_timestamp, |
uint32_t arrival_timestamp) override; |
int ErrorCode() override; |
+ int SampleRateHz() const override; |
size_t Channels() const override; |
int DecodeInternal(const uint8_t* encoded, |
size_t encoded_len, |
@@ -45,9 +52,12 @@ class AudioDecoderIsacT final : public AudioDecoder { |
SpeechType* speech_type) override; |
private: |
+ AudioDecoderIsacT(rtc::Optional<int> sample_rate_hz, |
+ const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo); |
+ |
typename T::instance_type* isac_state_; |
+ rtc::Optional<int> sample_rate_hz_; |
rtc::scoped_refptr<LockedIsacBandwidthInfo> bwinfo_; |
- int decoder_sample_rate_hz_; |
RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderIsacT); |
}; |