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

Unified Diff: webrtc/modules/audio_coding/acm2/audio_coding_module.cc

Issue 2365653004: AudioCodingModule: Specify decoders using SdpAudioFormat (Closed)
Patch Set: Created 4 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/acm2/audio_coding_module.cc
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
index 99b539ab6440745769efcd58606f9fc6823cf4ca..847df108d5b5f084149e7d624671656a2854e090 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
@@ -132,6 +132,9 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
int num_channels,
const std::string& name) override;
+ bool RegisterReceiveCodec(int rtp_payload_type,
+ const SdpAudioFormat& audio_format) override;
+
// Get current received codec.
int ReceiveCodec(CodecInst* current_codec) const override;
@@ -1063,6 +1066,21 @@ int AudioCodingModuleImpl::RegisterExternalReceiveCodec(
sample_rate_hz, external_decoder, name);
}
+bool AudioCodingModuleImpl::RegisterReceiveCodec(
+ int rtp_payload_type,
+ const SdpAudioFormat& audio_format) {
+ rtc::CritScope lock(&acm_crit_sect_);
+ RTC_DCHECK(receiver_initialized_);
+
+ if (!acm2::RentACodec::IsPayloadTypeValid(rtp_payload_type)) {
+ LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type
+ << " for external decoder.";
ossu 2016/09/28 14:12:28 Why distinguish "external decoder" here?
kwiberg-webrtc 2016/09/29 12:38:34 Because I cribbed this code from RegisterExternalR
+ return false;
+ }
+
+ return receiver_.AddCodec(rtp_payload_type, audio_format);
+}
+
// Get current received codec.
int AudioCodingModuleImpl::ReceiveCodec(CodecInst* current_codec) const {
rtc::CritScope lock(&acm_crit_sect_);

Powered by Google App Engine
This is Rietveld 408576698