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

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_impl.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/neteq/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index e21294aa384c6815b83eeff796959a81b0bfc9b1..b60f1b86e58a1cf05dd97eb3511edb607a8867fa 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -279,6 +279,35 @@ int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder,
return kOK;
}
+bool NetEqImpl::RegisterPayloadType(int rtp_payload_type,
+ const SdpAudioFormat& audio_format) {
+ LOG(LS_VERBOSE) << "NetEqImpl::RegisterPayloadType: payload type "
+ << rtp_payload_type << ", codec " << audio_format;
+ rtc::CritScope lock(&crit_sect_);
+ switch (decoder_database_->RegisterPayload(rtp_payload_type, audio_format)) {
+ case DecoderDatabase::kOK:
+ return true;
+ case DecoderDatabase::kInvalidRtpPayloadType:
+ error_code_ = kInvalidRtpPayloadType;
+ return false;
+ case DecoderDatabase::kCodecNotSupported:
+ error_code_ = kCodecNotSupported;
+ return false;
+ case DecoderDatabase::kDecoderExists:
+ error_code_ = kDecoderExists;
+ return false;
+ case DecoderDatabase::kInvalidSampleRate:
+ error_code_ = kInvalidSampleRate;
+ return false;
+ case DecoderDatabase::kInvalidPointer:
+ error_code_ = kInvalidPointer;
+ return false;
+ default:
+ error_code_ = kOtherError;
+ return false;
+ }
+}
+
int NetEqImpl::RemovePayloadType(uint8_t rtp_payload_type) {
rtc::CritScope lock(&crit_sect_);
int ret = decoder_database_->Remove(rtp_payload_type);

Powered by Google App Engine
This is Rietveld 408576698