From c2d0473320456cd783a1e7612ea7008723593257 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Wed, 11 Feb 2015 08:25:12 +0000 Subject: [PATCH] Switch to using AudioEncoderPcm16B instead of ACMPCM16B This change switches from the old codec wrapper ACMPCM16B to the new AudioEncoderPcm16B wrapped in an ACMGenericCodecWrapper. BUG=4228 COAUTHOR=kwiberg@webrtc.org R=tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/33249004 Cr-Commit-Position: refs/heads/master@{#8324} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8324 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/acm2/acm_codec_database.cc | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc index 98440b0c9c..3cc124fdcb 100644 --- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc +++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc @@ -746,46 +746,9 @@ ACMGenericCodec* ACMCodecDB::CreateCodecInstance(const CodecInst& codec_inst, return new ACMCNG(codec_id, enable_red); } else if (!STR_CASE_CMP(codec_inst.plname, "L16")) { #ifdef WEBRTC_CODEC_PCM16 - // For L16 we need to check sampling frequency to know what codec to create. - int codec_id; - if (codec_inst.channels == 1) { - switch (codec_inst.plfreq) { - case 8000: { - codec_id = kPCM16B; - break; - } - case 16000: { - codec_id = kPCM16Bwb; - break; - } - case 32000: { - codec_id = kPCM16Bswb32kHz; - break; - } - default: { - return NULL; - } - } - } else { - switch (codec_inst.plfreq) { - case 8000: { - codec_id = kPCM16B_2ch; - break; - } - case 16000: { - codec_id = kPCM16Bwb_2ch; - break; - } - case 32000: { - codec_id = kPCM16Bswb32kHz_2ch; - break; - } - default: { - return NULL; - } - } - } - return new ACMPCM16B(codec_id, enable_red); + return new ACMGenericCodecWrapper(codec_inst, cng_pt_nb, cng_pt_wb, + cng_pt_swb, cng_pt_fb, enable_red, + red_payload_type); #endif } else if (!STR_CASE_CMP(codec_inst.plname, "telephone-event")) { #ifdef WEBRTC_CODEC_AVT