| Index: webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc
|
| diff --git a/webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc b/webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc
|
| index b6d8a3a1db914eeacb08f8229f3e52d53bf8bab9..28a7b1090af9c1a1ed4c90e0732f3361e11be26b 100644
|
| --- a/webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc
|
| +++ b/webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc
|
| @@ -19,7 +19,7 @@ namespace webrtc {
|
| namespace {
|
| class OpusFrame : public AudioDecoder::EncodedAudioFrame {
|
| public:
|
| - OpusFrame(AudioDecoderOpus* decoder,
|
| + OpusFrame(AudioDecoderOpusImpl* decoder,
|
| rtc::Buffer&& payload,
|
| bool is_primary_payload)
|
| : decoder_(decoder),
|
| @@ -57,25 +57,25 @@ class OpusFrame : public AudioDecoder::EncodedAudioFrame {
|
| }
|
|
|
| private:
|
| - AudioDecoderOpus* const decoder_;
|
| + AudioDecoderOpusImpl* const decoder_;
|
| const rtc::Buffer payload_;
|
| const bool is_primary_payload_;
|
| };
|
|
|
| } // namespace
|
|
|
| -AudioDecoderOpus::AudioDecoderOpus(size_t num_channels)
|
| +AudioDecoderOpusImpl::AudioDecoderOpusImpl(size_t num_channels)
|
| : channels_(num_channels) {
|
| RTC_DCHECK(num_channels == 1 || num_channels == 2);
|
| WebRtcOpus_DecoderCreate(&dec_state_, channels_);
|
| WebRtcOpus_DecoderInit(dec_state_);
|
| }
|
|
|
| -AudioDecoderOpus::~AudioDecoderOpus() {
|
| +AudioDecoderOpusImpl::~AudioDecoderOpusImpl() {
|
| WebRtcOpus_DecoderFree(dec_state_);
|
| }
|
|
|
| -std::vector<AudioDecoder::ParseResult> AudioDecoderOpus::ParsePayload(
|
| +std::vector<AudioDecoder::ParseResult> AudioDecoderOpusImpl::ParsePayload(
|
| rtc::Buffer&& payload,
|
| uint32_t timestamp) {
|
| std::vector<ParseResult> results;
|
| @@ -95,11 +95,11 @@ std::vector<AudioDecoder::ParseResult> AudioDecoderOpus::ParsePayload(
|
| return results;
|
| }
|
|
|
| -int AudioDecoderOpus::DecodeInternal(const uint8_t* encoded,
|
| - size_t encoded_len,
|
| - int sample_rate_hz,
|
| - int16_t* decoded,
|
| - SpeechType* speech_type) {
|
| +int AudioDecoderOpusImpl::DecodeInternal(const uint8_t* encoded,
|
| + size_t encoded_len,
|
| + int sample_rate_hz,
|
| + int16_t* decoded,
|
| + SpeechType* speech_type) {
|
| RTC_DCHECK_EQ(sample_rate_hz, 48000);
|
| int16_t temp_type = 1; // Default is speech.
|
| int ret =
|
| @@ -110,11 +110,11 @@ int AudioDecoderOpus::DecodeInternal(const uint8_t* encoded,
|
| return ret;
|
| }
|
|
|
| -int AudioDecoderOpus::DecodeRedundantInternal(const uint8_t* encoded,
|
| - size_t encoded_len,
|
| - int sample_rate_hz,
|
| - int16_t* decoded,
|
| - SpeechType* speech_type) {
|
| +int AudioDecoderOpusImpl::DecodeRedundantInternal(const uint8_t* encoded,
|
| + size_t encoded_len,
|
| + int sample_rate_hz,
|
| + int16_t* decoded,
|
| + SpeechType* speech_type) {
|
| if (!PacketHasFec(encoded, encoded_len)) {
|
| // This packet is a RED packet.
|
| return DecodeInternal(encoded, encoded_len, sample_rate_hz, decoded,
|
| @@ -131,17 +131,17 @@ int AudioDecoderOpus::DecodeRedundantInternal(const uint8_t* encoded,
|
| return ret;
|
| }
|
|
|
| -void AudioDecoderOpus::Reset() {
|
| +void AudioDecoderOpusImpl::Reset() {
|
| WebRtcOpus_DecoderInit(dec_state_);
|
| }
|
|
|
| -int AudioDecoderOpus::PacketDuration(const uint8_t* encoded,
|
| - size_t encoded_len) const {
|
| +int AudioDecoderOpusImpl::PacketDuration(const uint8_t* encoded,
|
| + size_t encoded_len) const {
|
| return WebRtcOpus_DurationEst(dec_state_, encoded, encoded_len);
|
| }
|
|
|
| -int AudioDecoderOpus::PacketDurationRedundant(const uint8_t* encoded,
|
| - size_t encoded_len) const {
|
| +int AudioDecoderOpusImpl::PacketDurationRedundant(const uint8_t* encoded,
|
| + size_t encoded_len) const {
|
| if (!PacketHasFec(encoded, encoded_len)) {
|
| // This packet is a RED packet.
|
| return PacketDuration(encoded, encoded_len);
|
| @@ -150,18 +150,18 @@ int AudioDecoderOpus::PacketDurationRedundant(const uint8_t* encoded,
|
| return WebRtcOpus_FecDurationEst(encoded, encoded_len);
|
| }
|
|
|
| -bool AudioDecoderOpus::PacketHasFec(const uint8_t* encoded,
|
| - size_t encoded_len) const {
|
| +bool AudioDecoderOpusImpl::PacketHasFec(const uint8_t* encoded,
|
| + size_t encoded_len) const {
|
| int fec;
|
| fec = WebRtcOpus_PacketHasFec(encoded, encoded_len);
|
| return (fec == 1);
|
| }
|
|
|
| -int AudioDecoderOpus::SampleRateHz() const {
|
| +int AudioDecoderOpusImpl::SampleRateHz() const {
|
| return 48000;
|
| }
|
|
|
| -size_t AudioDecoderOpus::Channels() const {
|
| +size_t AudioDecoderOpusImpl::Channels() const {
|
| return channels_;
|
| }
|
|
|
|
|