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

Unified Diff: webrtc/modules/audio_coding/codecs/cng/include/audio_encoder_cng.h

Issue 1322973004: Fold AudioEncoderMutable into AudioEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: review fixes & stuff Created 5 years, 3 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/cng/include/audio_encoder_cng.h
diff --git a/webrtc/modules/audio_coding/codecs/cng/include/audio_encoder_cng.h b/webrtc/modules/audio_coding/codecs/cng/include/audio_encoder_cng.h
index 6a1136602e0b25929666febe78fbd30ed12d6db5..4927ef74724dce68162723d132927b7e052facfb 100644
--- a/webrtc/modules/audio_coding/codecs/cng/include/audio_encoder_cng.h
+++ b/webrtc/modules/audio_coding/codecs/cng/include/audio_encoder_cng.h
@@ -25,40 +25,45 @@ class Vad;
class AudioEncoderCng final : public AudioEncoder {
public:
struct Config {
- Config();
bool IsOk() const;
- int num_channels;
- int payload_type;
+ int num_channels = 1;
+ int payload_type = 13;
// Caller keeps ownership of the AudioEncoder object.
- AudioEncoder* speech_encoder;
- Vad::Aggressiveness vad_mode;
- int sid_frame_interval_ms;
- int num_cng_coefficients;
+ AudioEncoder* speech_encoder = nullptr;
+ Vad::Aggressiveness vad_mode = Vad::kVadNormal;
+ int sid_frame_interval_ms = 100;
+ int num_cng_coefficients = 8;
// The Vad pointer is mainly for testing. If a NULL pointer is passed, the
// AudioEncoderCng creates (and destroys) a Vad object internally. If an
// object is passed, the AudioEncoderCng assumes ownership of the Vad
// object.
- Vad* vad;
+ Vad* vad = nullptr;
};
explicit AudioEncoderCng(const Config& config);
-
~AudioEncoderCng() override;
+ size_t MaxEncodedBytes() const override;
int SampleRateHz() const override;
int NumChannels() const override;
- size_t MaxEncodedBytes() const override;
int RtpTimestampRateHz() const override;
size_t Num10MsFramesInNextPacket() const override;
size_t Max10MsFramesInAPacket() const override;
int GetTargetBitrate() const override;
- void SetTargetBitrate(int bits_per_second) override;
- void SetProjectedPacketLossRate(double fraction) override;
EncodedInfo EncodeInternal(uint32_t rtp_timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded) override;
+ void Reset() override;
+ bool SetFec(bool enable) override;
+ bool SetDtx(bool enable) override;
+ bool SetApplication(Application application) override;
+ bool SetMaxPlaybackRate(int frequency_hz) override;
+ void SetProjectedPacketLossRate(double fraction) override;
+ void SetTargetBitrate(int target_bps) override;
+ void SetMaxBitrate(int max_bps) override;
+ void SetMaxPayloadSize(int max_payload_size_bytes) override;
private:
// Deleter for use with scoped_ptr. E.g., use as

Powered by Google App Engine
This is Rietveld 408576698