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

Unified Diff: webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h

Issue 1184313002: Add AudioEncoder::GetTargetBitrate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing GN compile Created 5 years, 6 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/include/audio_encoder_pcm.h
diff --git a/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h b/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h
index 870b4ddfb6f16c7e70db8d479194dcdecb088f1b..c8690379c6b79bcad676a73fb8fa4b57f013d9b3 100644
--- a/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h
+++ b/webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h
@@ -41,6 +41,7 @@ class AudioEncoderPcm : public AudioEncoder {
size_t MaxEncodedBytes() const override;
int Num10MsFramesInNextPacket() const override;
int Max10MsFramesInAPacket() const override;
+ int GetTargetBitrate() const override;
EncodedInfo EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
@@ -53,6 +54,8 @@ class AudioEncoderPcm : public AudioEncoder {
size_t input_len,
uint8_t* encoded) = 0;
+ virtual int BytesPerSample() const = 0;
+
private:
const int sample_rate_hz_;
const int num_channels_;
@@ -63,7 +66,7 @@ class AudioEncoderPcm : public AudioEncoder {
uint32_t first_timestamp_in_buffer_;
};
-class AudioEncoderPcmA : public AudioEncoderPcm {
+class AudioEncoderPcmA final : public AudioEncoderPcm {
public:
struct Config : public AudioEncoderPcm::Config {
Config() : AudioEncoderPcm::Config(8) {}
@@ -77,11 +80,13 @@ class AudioEncoderPcmA : public AudioEncoderPcm {
size_t input_len,
uint8_t* encoded) override;
+ int BytesPerSample() const override;
+
private:
static const int kSampleRateHz = 8000;
};
-class AudioEncoderPcmU : public AudioEncoderPcm {
+class AudioEncoderPcmU final : public AudioEncoderPcm {
public:
struct Config : public AudioEncoderPcm::Config {
Config() : AudioEncoderPcm::Config(0) {}
@@ -95,6 +100,8 @@ class AudioEncoderPcmU : public AudioEncoderPcm {
size_t input_len,
uint8_t* encoded) override;
+ int BytesPerSample() const override;
+
private:
static const int kSampleRateHz = 8000;
};

Powered by Google App Engine
This is Rietveld 408576698