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

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

Issue 1702943002: Pass ownership of external encoders to the ACM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/audio_encoder_cng.h
diff --git a/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.h b/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.h
index b581e320822d1f2e54f2286fa22b50306d6e9f0a..1384cd511ee3b7f85306bc08dbdc79bb88fdc9a3 100644
--- a/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.h
+++ b/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.h
@@ -31,12 +31,14 @@ class Vad;
class AudioEncoderCng final : public AudioEncoder {
public:
struct Config {
+ Config();
+ Config(Config&&);
+ ~Config();
bool IsOk() const;
size_t num_channels = 1;
int payload_type = 13;
- // Caller keeps ownership of the AudioEncoder object.
- AudioEncoder* speech_encoder = nullptr;
+ std::unique_ptr<AudioEncoder> speech_encoder;
Vad::Aggressiveness vad_mode = Vad::kVadNormal;
int sid_frame_interval_ms = 100;
int num_cng_coefficients = 8;
@@ -47,7 +49,7 @@ class AudioEncoderCng final : public AudioEncoder {
Vad* vad = nullptr;
};
- explicit AudioEncoderCng(const Config& config);
+ explicit AudioEncoderCng(Config&& config);
~AudioEncoderCng() override;
size_t MaxEncodedBytes() const override;
@@ -75,7 +77,7 @@ class AudioEncoderCng final : public AudioEncoder {
rtc::Buffer* encoded);
size_t SamplesPer10msFrame() const;
- AudioEncoder* speech_encoder_;
+ std::unique_ptr<AudioEncoder> speech_encoder_;
const int cng_payload_type_;
const int num_cng_coefficients_;
const int sid_frame_interval_ms_;

Powered by Google App Engine
This is Rietveld 408576698