Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h

Issue 2024633002: AudioDecoder: New method SampleRateHz, + implementations for our codecs (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698