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

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

Issue 1928293002: NetEq: Use a BuiltinAudioDecoderFactory to create decoders (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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/rent_a_codec.cc
diff --git a/webrtc/modules/audio_coding/acm2/rent_a_codec.cc b/webrtc/modules/audio_coding/acm2/rent_a_codec.cc
index 7f1e52030dc944f9efe244d8fd7f96eec432ebc8..13079ad0493825a5e72ac71ce5384602305b5864 100644
--- a/webrtc/modules/audio_coding/acm2/rent_a_codec.cc
+++ b/webrtc/modules/audio_coding/acm2/rent_a_codec.cc
@@ -47,6 +47,55 @@
namespace webrtc {
namespace acm2 {
+rtc::Optional<SdpAudioFormat> RentACodec::NetEqDecoderToSdpAudioFormat(
+ NetEqDecoder nd) {
+ switch (nd) {
+ case NetEqDecoder::kDecoderPCMu:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("pcmu", 8000, 1));
+ case NetEqDecoder::kDecoderPCMa:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("pcma", 8000, 1));
+ case NetEqDecoder::kDecoderPCMu_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("pcmu", 8000, 2));
+ case NetEqDecoder::kDecoderPCMa_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("pcma", 8000, 2));
+ case NetEqDecoder::kDecoderILBC:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("ilbc", 8000, 1));
+ case NetEqDecoder::kDecoderISAC:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("isac", 16000, 1));
+ case NetEqDecoder::kDecoderISACswb:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("isac", 32000, 1));
+ case NetEqDecoder::kDecoderPCM16B:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 8000, 1));
+ case NetEqDecoder::kDecoderPCM16Bwb:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 16000, 1));
+ case NetEqDecoder::kDecoderPCM16Bswb32kHz:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 32000, 1));
+ case NetEqDecoder::kDecoderPCM16Bswb48kHz:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 48000, 1));
+ case NetEqDecoder::kDecoderPCM16B_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 8000, 2));
+ case NetEqDecoder::kDecoderPCM16Bwb_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 16000, 2));
+ case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 32000, 2));
+ case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 48000, 2));
+ case NetEqDecoder::kDecoderPCM16B_5ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("l16", 8000, 5));
+ case NetEqDecoder::kDecoderG722:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("g722", 8000, 1));
+ case NetEqDecoder::kDecoderG722_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("g722", 8000, 2));
+ case NetEqDecoder::kDecoderOpus:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("opus", 48000, 1));
+ case NetEqDecoder::kDecoderOpus_2ch:
+ return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("opus", 48000, 2));
ossu 2016/04/29 12:21:33 Opus is weird and always wants to have a channel c
kwiberg-webrtc 2016/04/29 23:10:13 I was hoping to be able to postpone the introducti
ossu 2016/05/02 10:59:40 Might as well do it "the right (wrong) way" from t
kwiberg-webrtc 2016/05/02 20:20:00 Done.
+
+ default:
+ return rtc::Optional<SdpAudioFormat>();
+ }
+}
+
rtc::Optional<RentACodec::CodecId> RentACodec::CodecIdByParams(
const char* payload_name,
int sampling_freq_hz,

Powered by Google App Engine
This is Rietveld 408576698