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

Unified Diff: webrtc/modules/audio_coding/acm2/rent_a_codec.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/acm2/rent_a_codec.h
diff --git a/webrtc/modules/audio_coding/acm2/rent_a_codec.h b/webrtc/modules/audio_coding/acm2/rent_a_codec.h
index dd2deceb8d326983b39a60777b31bd7993b1e6ce..d6f159a5b05398d8eb69c17ed94a60847f50cc77 100644
--- a/webrtc/modules/audio_coding/acm2/rent_a_codec.h
+++ b/webrtc/modules/audio_coding/acm2/rent_a_codec.h
@@ -197,15 +197,15 @@ class RentACodec {
~RentACodec();
// Creates and returns an audio encoder built to the given specification.
- // Returns null in case of error. The returned encoder is live until the next
- // successful call to this function, or until the Rent-A-Codec is destroyed.
- AudioEncoder* RentEncoder(const CodecInst& codec_inst);
+ // Returns null in case of error.
+ std::unique_ptr<AudioEncoder> RentEncoder(const CodecInst& codec_inst);
hlundin-webrtc 2016/03/08 13:29:24 The name RentEncoder is no longer adequate, but I'
kwiberg-webrtc 2016/03/08 13:59:12 Yeah, the class name isn't a good fit anymore eith
struct StackParameters {
StackParameters();
~StackParameters();
- AudioEncoder* speech_encoder = nullptr;
+ std::unique_ptr<AudioEncoder> speech_encoder;
+
bool use_codec_fec = false;
bool use_red = false;
bool use_cng = false;
@@ -218,10 +218,9 @@ class RentACodec {
// Creates and returns an audio encoder stack constructed to the given
// specification. If the specification isn't compatible with the encoder, it
- // will be changed to match (things will be switched off). The returned
- // encoder is live until the next successful call to this function, or until
- // the Rent-A-Codec is destroyed.
- AudioEncoder* RentEncoderStack(StackParameters* param);
+ // will be changed to match (things will be switched off). The speech encoder
+ // will be stolen.
+ std::unique_ptr<AudioEncoder> RentEncoderStack(StackParameters* param);
// Creates and returns an iSAC decoder, which will remain live until the
// Rent-A-Codec is destroyed. Subsequent calls will simply return the same
« no previous file with comments | « webrtc/modules/audio_coding/acm2/codec_manager_unittest.cc ('k') | webrtc/modules/audio_coding/acm2/rent_a_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698