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

Unified Diff: webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.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/red/audio_encoder_copy_red.h
diff --git a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.h b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.h
index 2aa8edcfcd1146fc5c300ed5f2addb2569cb9006..a67ae486bb2b8467d4cbc1d5e9990f82744274b8 100644
--- a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.h
+++ b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.h
@@ -11,6 +11,7 @@
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_RED_AUDIO_ENCODER_COPY_RED_H_
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_RED_AUDIO_ENCODER_COPY_RED_H_
+#include <memory>
#include <vector>
#include "webrtc/base/buffer.h"
@@ -25,13 +26,14 @@ namespace webrtc {
class AudioEncoderCopyRed final : public AudioEncoder {
public:
struct Config {
- public:
+ Config();
+ Config(Config&&);
+ ~Config();
int payload_type;
- AudioEncoder* speech_encoder;
+ std::unique_ptr<AudioEncoder> speech_encoder;
};
- // Caller keeps ownership of the AudioEncoder object.
- explicit AudioEncoderCopyRed(const Config& config);
+ explicit AudioEncoderCopyRed(Config&& config);
~AudioEncoderCopyRed() override;
@@ -56,7 +58,7 @@ protected:
rtc::Buffer* encoded) override;
private:
- AudioEncoder* speech_encoder_;
+ std::unique_ptr<AudioEncoder> speech_encoder_;
int red_payload_type_;
rtc::Buffer secondary_encoded_;
EncodedInfoLeaf secondary_info_;

Powered by Google App Engine
This is Rietveld 408576698