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

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

Issue 2365653004: AudioCodingModule: Specify decoders using SdpAudioFormat (Closed)
Patch Set: rebase Created 4 years, 2 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..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();

Powered by Google App Engine
This is Rietveld 408576698