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

Unified Diff: webrtc/modules/audio_coding/main/acm2/rent_a_codec.h

Issue 1459193002: Extract the parameters for the encoder stack from the CodecManager (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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/main/acm2/rent_a_codec.h
diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
index db728ae2942cbb78e9ce938af322760f6a62da03..45d46bb0575b73be7152c9ff03d129e31039b94c 100644
--- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
+++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
@@ -200,18 +200,27 @@ class RentACodec {
// successful call to this function, or until the Rent-A-Codec is destroyed.
AudioEncoder* RentEncoder(const CodecInst& codec_inst);
- // Creates and returns an audio encoder stack where the given speech encoder
- // is augmented with the specified CNG/VAD and RED encoders. Leave either
- // optional field blank if you don't want the corresponding gizmo in the
- // stack. The returned encoder is live until the next successful call to this
- // function, or until the Rent-A-Codec is destroyed.
- struct CngConfig {
- int cng_payload_type;
- ACMVADMode vad_mode;
+ struct StackParameters {
+ StackParameters();
+ ~StackParameters();
+
+ bool use_codec_fec = false;
+ bool use_red = false;
+ bool use_cng = false;
+ ACMVADMode vad_mode = VADNormal;
+
+ // Maps from RTP timestamp rate (in Hz) to payload type.
+ std::map<int, int> cng_payload_types;
+ std::map<int, int> red_payload_types;
};
+
+ // 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(AudioEncoder* speech_encoder,
- rtc::Optional<CngConfig> cng_config,
- rtc::Optional<int> red_payload_type);
+ StackParameters* param);
// Get the last return values of RentEncoder and RentEncoderStack, or null if
// they haven't been called.
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/codec_manager.cc ('k') | webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698