diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc index e62294416a..0778491ad7 100644 --- a/talk/app/webrtc/webrtcsdp_unittest.cc +++ b/talk/app/webrtc/webrtcsdp_unittest.cc @@ -157,7 +157,7 @@ static const char kSdpFullString[] = "dummy_session_params\r\n" "a=rtpmap:111 opus/48000/2\r\n" "a=rtpmap:103 ISAC/16000\r\n" - "a=rtpmap:104 CELT/32000/2\r\n" + "a=rtpmap:104 ISAC/32000\r\n" "a=ssrc:1 cname:stream_1_cname\r\n" "a=ssrc:1 msid:local_stream_1 audio_track_id_1\r\n" "a=ssrc:1 mslabel:local_stream_1\r\n" @@ -224,7 +224,7 @@ static const char kSdpString[] = "dummy_session_params\r\n" "a=rtpmap:111 opus/48000/2\r\n" "a=rtpmap:103 ISAC/16000\r\n" - "a=rtpmap:104 CELT/32000/2\r\n" + "a=rtpmap:104 ISAC/32000\r\n" "a=ssrc:1 cname:stream_1_cname\r\n" "a=ssrc:1 msid:local_stream_1 audio_track_id_1\r\n" "a=ssrc:1 mslabel:local_stream_1\r\n" @@ -531,7 +531,7 @@ class WebRtcSdpTest : public testing::Test { AudioCodec opus(111, "opus", 48000, 0, 2, 3); audio_desc_->AddCodec(opus); audio_desc_->AddCodec(AudioCodec(103, "ISAC", 16000, 32000, 1, 2)); - audio_desc_->AddCodec(AudioCodec(104, "CELT", 32000, 0, 2, 1)); + audio_desc_->AddCodec(AudioCodec(104, "ISAC", 32000, 56000, 1, 1)); desc_.AddContent(kAudioContentName, NS_JINGLE_RTP, audio_desc_); // VideoContentDescription @@ -1181,13 +1181,12 @@ class WebRtcSdpTest : public testing::Test { // description. "a=msid-semantic: WMS\r\n" // Pl type 111 preferred. - "m=audio 9 RTP/SAVPF 111 104 103 102\r\n" + "m=audio 9 RTP/SAVPF 111 104 103\r\n" // Pltype 111 listed before 103 and 104 in the map. "a=rtpmap:111 opus/48000/2\r\n" // Pltype 103 listed before 104. "a=rtpmap:103 ISAC/16000\r\n" - "a=rtpmap:104 CELT/32000/2\r\n" - "a=rtpmap:102 ISAC/32000/1\r\n" + "a=rtpmap:104 ISAC/32000\r\n" "a=fmtp:111 0-15,66,70\r\n" "a=fmtp:111 "; std::ostringstream os; @@ -1794,7 +1793,7 @@ TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutRtpmap) { "t=0 0\r\n" "m=audio 49232 RTP/AVP 0 18 103\r\n" // Codec that doesn't appear in the m= line will be ignored. - "a=rtpmap:104 CELT/32000/2\r\n" + "a=rtpmap:104 ISAC/32000\r\n" // The rtpmap line for static payload codec is optional. "a=rtpmap:18 G729/16000\r\n" "a=rtpmap:103 ISAC/16000\r\n"; @@ -2407,7 +2406,7 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithReorderedPltypes) { "a=rtpmap:111 opus/48000/2\r\n" // Pltype 111 listed before 103 and 104 // in the map. "a=rtpmap:103 ISAC/16000\r\n" // Pltype 103 listed before 104 in the map. - "a=rtpmap:104 CELT/32000/2\r\n"; + "a=rtpmap:104 ISAC/32000\r\n"; // Deserialize EXPECT_TRUE(SdpDeserialize(kSdpWithReorderedPlTypesString, &jdesc_output)); @@ -2417,7 +2416,8 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithReorderedPltypes) { const AudioContentDescription* acd = static_cast(ac->description); ASSERT_FALSE(acd->codecs().empty()); - EXPECT_EQ("CELT", acd->codecs()[0].name); + EXPECT_EQ("ISAC", acd->codecs()[0].name); + EXPECT_EQ(32000, acd->codecs()[0].clockrate); EXPECT_EQ(104, acd->codecs()[0].id); } diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc index f7183ef15d..dab2b511f1 100644 --- a/talk/media/webrtc/webrtcvoiceengine.cc +++ b/talk/media/webrtc/webrtcvoiceengine.cc @@ -72,8 +72,6 @@ static const CodecPref kCodecPrefs[] = { { "OPUS", 48000, 2, 111, true }, { "ISAC", 16000, 1, 103, true }, { "ISAC", 32000, 1, 104, true }, - { "CELT", 32000, 1, 109, true }, - { "CELT", 32000, 2, 110, true }, // G722 should be advertised as 8000 Hz because of the RFC "bug". { "G722", 8000, 1, 9, false }, { "ILBC", 8000, 1, 102, false }, diff --git a/talk/media/webrtc/webrtcvoiceengine_unittest.cc b/talk/media/webrtc/webrtcvoiceengine_unittest.cc index b013e023d5..5faec6c06a 100644 --- a/talk/media/webrtc/webrtcvoiceengine_unittest.cc +++ b/talk/media/webrtc/webrtcvoiceengine_unittest.cc @@ -50,7 +50,6 @@ using cricket::kRtpAbsoluteSenderTimeHeaderExtension; static const cricket::AudioCodec kPcmuCodec(0, "PCMU", 8000, 64000, 1, 0); static const cricket::AudioCodec kIsacCodec(103, "ISAC", 16000, 32000, 1, 0); -static const cricket::AudioCodec kCeltCodec(110, "CELT", 32000, 64000, 2, 0); static const cricket::AudioCodec kOpusCodec(111, "opus", 48000, 64000, 2, 0); static const cricket::AudioCodec kG722CodecVoE(9, "G722", 16000, 64000, 1, 0); static const cricket::AudioCodec kG722CodecSdp(9, "G722", 8000, 64000, 1, 0); @@ -60,8 +59,8 @@ static const cricket::AudioCodec kCn16000Codec(105, "CN", 16000, 0, 1, 0); static const cricket::AudioCodec kTelephoneEventCodec(106, "telephone-event", 8000, 0, 1, 0); static const cricket::AudioCodec* const kAudioCodecs[] = { - &kPcmuCodec, &kIsacCodec, &kCeltCodec, &kOpusCodec, &kG722CodecVoE, - &kRedCodec, &kCn8000Codec, &kCn16000Codec, &kTelephoneEventCodec, + &kPcmuCodec, &kIsacCodec, &kOpusCodec, &kG722CodecVoE, &kRedCodec, + &kCn8000Codec, &kCn16000Codec, &kTelephoneEventCodec, }; const char kRingbackTone[] = "RIFF____WAVE____ABCD1234"; static uint32 kSsrc1 = 0x99; @@ -645,9 +644,6 @@ TEST_F(WebRtcVoiceEngineTestFake, SetSendBandwidthAuto) { // PCMU, default bitrate == 64000. TestSendBandwidth(kPcmuCodec, -1, true, 64000); - // CELT, default bitrate == 64000. - TestSendBandwidth(kCeltCodec, 0, true, 64000); - // opus, default bitrate == 64000. TestSendBandwidth(kOpusCodec, -1, true, 64000); } @@ -662,10 +658,6 @@ TEST_F(WebRtcVoiceEngineTestFake, SetMaxSendBandwidthMultiRateAsCaller) { TestSendBandwidth(kIsacCodec, 128000, true, 128000); TestSendBandwidth(kIsacCodec, 16000, true, 16000); - // CELT, default bitrate == 64000. - TestSendBandwidth(kCeltCodec, 96000, true, 96000); - TestSendBandwidth(kCeltCodec, 32000, true, 32000); - // opus, default bitrate == 64000. TestSendBandwidth(kOpusCodec, 96000, true, 96000); TestSendBandwidth(kOpusCodec, 48000, true, 48000); @@ -1410,59 +1402,31 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOpusMaxPlaybackRateOnTwoStreams) { voe_.GetMaxEncodingBandwidth(channel_num)); } -// Test that we can apply CELT with stereo mode but fail with mono mode. -TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCelt) { +// Test that we can switch back and forth between Opus and ISAC with CN. +TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsIsacOpusSwitching) { EXPECT_TRUE(SetupEngine()); int channel_num = voe_.GetLastChannel(); - std::vector codecs; - codecs.push_back(kCeltCodec); - codecs.push_back(kIsacCodec); - codecs[0].id = 96; - codecs[0].channels = 2; - codecs[0].bitrate = 96000; - codecs[1].bitrate = 64000; - EXPECT_TRUE(channel_->SetSendCodecs(codecs)); + std::vector opus_codecs; + opus_codecs.push_back(kOpusCodec); + EXPECT_TRUE(channel_->SetSendCodecs(opus_codecs)); webrtc::CodecInst gcodec; EXPECT_EQ(0, voe_.GetSendCodec(channel_num, gcodec)); - EXPECT_EQ(96, gcodec.pltype); - EXPECT_EQ(96000, gcodec.rate); - EXPECT_EQ(2, gcodec.channels); - EXPECT_STREQ("CELT", gcodec.plname); - // Doesn't support mono, expect it to fall back to the next codec in the list. - codecs[0].channels = 1; - EXPECT_TRUE(channel_->SetSendCodecs(codecs)); - EXPECT_EQ(0, voe_.GetSendCodec(channel_num, gcodec)); - EXPECT_EQ(103, gcodec.pltype); - EXPECT_EQ(1, gcodec.channels); - EXPECT_EQ(64000, gcodec.rate); - EXPECT_STREQ("ISAC", gcodec.plname); -} - -// Test that we can switch back and forth between CELT and ISAC with CN. -TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsIsacCeltSwitching) { - EXPECT_TRUE(SetupEngine()); - int channel_num = voe_.GetLastChannel(); - std::vector celt_codecs; - celt_codecs.push_back(kCeltCodec); - EXPECT_TRUE(channel_->SetSendCodecs(celt_codecs)); - webrtc::CodecInst gcodec; - EXPECT_EQ(0, voe_.GetSendCodec(channel_num, gcodec)); - EXPECT_EQ(110, gcodec.pltype); - EXPECT_STREQ("CELT", gcodec.plname); + EXPECT_EQ(111, gcodec.pltype); + EXPECT_STREQ("opus", gcodec.plname); std::vector isac_codecs; isac_codecs.push_back(kIsacCodec); isac_codecs.push_back(kCn16000Codec); - isac_codecs.push_back(kCeltCodec); + isac_codecs.push_back(kOpusCodec); EXPECT_TRUE(channel_->SetSendCodecs(isac_codecs)); EXPECT_EQ(0, voe_.GetSendCodec(channel_num, gcodec)); EXPECT_EQ(103, gcodec.pltype); EXPECT_STREQ("ISAC", gcodec.plname); - EXPECT_TRUE(channel_->SetSendCodecs(celt_codecs)); + EXPECT_TRUE(channel_->SetSendCodecs(opus_codecs)); EXPECT_EQ(0, voe_.GetSendCodec(channel_num, gcodec)); - EXPECT_EQ(110, gcodec.pltype); - EXPECT_STREQ("CELT", gcodec.plname); + EXPECT_EQ(111, gcodec.pltype); + EXPECT_STREQ("opus", gcodec.plname); } // Test that we handle various ways of specifying bitrate. @@ -2482,8 +2446,8 @@ TEST_F(WebRtcVoiceEngineTestFake, AddRecvStreamUnsupportedCodec) { cricket::StreamParams::CreateLegacy(kSsrc1))); int channel_num2 = voe_.GetLastChannel(); webrtc::CodecInst gcodec; - rtc::strcpyn(gcodec.plname, ARRAY_SIZE(gcodec.plname), "CELT"); - gcodec.plfreq = 32000; + rtc::strcpyn(gcodec.plname, ARRAY_SIZE(gcodec.plname), "opus"); + gcodec.plfreq = 48000; gcodec.channels = 2; EXPECT_EQ(-1, voe_.GetRecPayloadType(channel_num2, gcodec)); } diff --git a/talk/session/media/channelmanager_unittest.cc b/talk/session/media/channelmanager_unittest.cc index f496ee9310..8b5b326686 100644 --- a/talk/session/media/channelmanager_unittest.cc +++ b/talk/session/media/channelmanager_unittest.cc @@ -41,7 +41,6 @@ namespace cricket { static const AudioCodec kAudioCodecs[] = { AudioCodec(97, "voice", 1, 2, 3, 0), - AudioCodec(110, "CELT", 32000, 48000, 2, 0), AudioCodec(111, "OPUS", 48000, 32000, 2, 0), }; 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 17d49a9b4d..5f6bcb5e81 100644 --- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc +++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc @@ -466,9 +466,6 @@ int ACMCodecDB::CodecNumber(const CodecInst& codec_inst, int* mirror_id) { } else if (STR_CASE_CMP("speex", codec_inst.plname) == 0) { return IsSpeexRateValid(codec_inst.rate) ? codec_id : kInvalidRate; - } else if (STR_CASE_CMP("celt", codec_inst.plname) == 0) { - return IsCeltRateValid(codec_inst.rate) - ? codec_id : kInvalidRate; } return IsRateValid(codec_id, codec_inst.rate) ? @@ -874,15 +871,6 @@ bool ACMCodecDB::IsOpusRateValid(int rate) { return true; } -// Checks if the bitrate is valid for Celt. -bool ACMCodecDB::IsCeltRateValid(int rate) { - if ((rate >= 48000) && (rate <= 128000)) { - return true; - } else { - return false; - } -} - // Checks if the payload type is in the valid range. bool ACMCodecDB::ValidPayloadType(int payload_type) { if ((payload_type < 0) || (payload_type > 127)) { diff --git a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h index 608eb6b64f..94cad5c11e 100644 --- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h +++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h @@ -329,7 +329,6 @@ class ACMCodecDB { static bool IsG7291RateValid(int rate); static bool IsSpeexRateValid(int rate); static bool IsOpusRateValid(int rate); - static bool IsCeltRateValid(int rate); // Check if the payload type is valid, meaning that it is in the valid range // of 0 to 127.