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..a845c017d1bd4efce439a5b23fbf3d3bc2475114 100644 |
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc |
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc |
@@ -121,6 +121,9 @@ class AudioCodingModuleImpl final : public AudioCodingModule { |
// Get current playout frequency. |
int PlayoutFrequency() const override; |
+ bool RegisterReceiveCodec(int rtp_payload_type, |
+ const SdpAudioFormat& audio_format) override; |
+ |
int RegisterReceiveCodec(const CodecInst& receive_codec) override; |
int RegisterReceiveCodec( |
const CodecInst& receive_codec, |
@@ -987,6 +990,21 @@ int AudioCodingModuleImpl::PlayoutFrequency() const { |
return receiver_.last_output_sample_rate_hz(); |
} |
+bool AudioCodingModuleImpl::RegisterReceiveCodec( |
hlundin-webrtc
2016/10/05 13:39:14
Why do you not have to handle the "iSAC case" like
kwiberg-webrtc
2016/10/06 09:20:46
In principle: Because the user has previously inje
|
+ 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 decoder."; |
+ return false; |
+ } |
+ |
+ return receiver_.AddCodec(rtp_payload_type, audio_format); |
+} |
+ |
int AudioCodingModuleImpl::RegisterReceiveCodec(const CodecInst& codec) { |
rtc::CritScope lock(&acm_crit_sect_); |
auto* ef = encoder_factory_.get(); |