Chromium Code Reviews| Index: webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h |
| diff --git a/webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h b/webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h |
| index 7a627e757c972f4a1454d32a27969b538cbb8a84..cc5776868aba26b5c8819c27feed5e87d0aae33a 100644 |
| --- a/webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h |
| +++ b/webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h |
| @@ -19,11 +19,13 @@ namespace webrtc { |
| class AudioDecoderPcmU final : public AudioDecoder { |
| public: |
| - explicit AudioDecoderPcmU(size_t num_channels) : num_channels_(num_channels) { |
| + explicit AudioDecoderPcmU(int sample_rate_hz, size_t num_channels) |
|
hlundin-webrtc
2016/05/30 14:10:17
Even though not a technical necessity, I think PCM
kwiberg-webrtc
2016/05/31 08:26:05
Done.
|
| + : sample_rate_hz_(sample_rate_hz), num_channels_(num_channels) { |
| RTC_DCHECK_GE(num_channels, 1u); |
| } |
| void Reset() override; |
| int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; |
| + int SampleRateHz() const override; |
| size_t Channels() const override; |
| protected: |
| @@ -34,17 +36,20 @@ class AudioDecoderPcmU final : public AudioDecoder { |
| SpeechType* speech_type) override; |
| private: |
| + const int sample_rate_hz_; |
| const size_t num_channels_; |
| RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcmU); |
| }; |
| class AudioDecoderPcmA final : public AudioDecoder { |
| public: |
| - explicit AudioDecoderPcmA(size_t num_channels) : num_channels_(num_channels) { |
| + explicit AudioDecoderPcmA(int sample_rate_hz, size_t num_channels) |
| + : sample_rate_hz_(sample_rate_hz), num_channels_(num_channels) { |
| RTC_DCHECK_GE(num_channels, 1u); |
| } |
| void Reset() override; |
| int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; |
| + int SampleRateHz() const override; |
| size_t Channels() const override; |
| protected: |
| @@ -55,6 +60,7 @@ class AudioDecoderPcmA final : public AudioDecoder { |
| SpeechType* speech_type) override; |
| private: |
| + const int sample_rate_hz_; |
| const size_t num_channels_; |
| RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcmA); |
| }; |