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

Side by Side Diff: webrtc/pc/webrtcsdp_unittest.cc

Issue 2642923003: Removed double-special-casing of ISAC in libjingle and WebRtcVoE. (Closed)
Patch Set: Rebase Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « webrtc/pc/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 AudioContentDescription* CreateAudioContentDescription() { 1121 AudioContentDescription* CreateAudioContentDescription() {
1122 AudioContentDescription* audio = new AudioContentDescription(); 1122 AudioContentDescription* audio = new AudioContentDescription();
1123 audio->set_rtcp_mux(true); 1123 audio->set_rtcp_mux(true);
1124 audio->set_rtcp_reduced_size(true); 1124 audio->set_rtcp_reduced_size(true);
1125 audio->AddCrypto(CryptoParams(1, "AES_CM_128_HMAC_SHA1_32", 1125 audio->AddCrypto(CryptoParams(1, "AES_CM_128_HMAC_SHA1_32",
1126 "inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32", 1126 "inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32",
1127 "dummy_session_params")); 1127 "dummy_session_params"));
1128 audio->set_protocol(cricket::kMediaProtocolSavpf); 1128 audio->set_protocol(cricket::kMediaProtocolSavpf);
1129 AudioCodec opus(111, "opus", 48000, 0, 2); 1129 AudioCodec opus(111, "opus", 48000, 0, 2);
1130 audio->AddCodec(opus); 1130 audio->AddCodec(opus);
1131 audio->AddCodec(AudioCodec(103, "ISAC", 16000, 32000, 1)); 1131 audio->AddCodec(AudioCodec(103, "ISAC", 16000, 0, 1));
1132 audio->AddCodec(AudioCodec(104, "ISAC", 32000, 56000, 1)); 1132 audio->AddCodec(AudioCodec(104, "ISAC", 32000, 0, 1));
1133 return audio; 1133 return audio;
1134 } 1134 }
1135 1135
1136 // Creates a video content description with no streams, and some default 1136 // Creates a video content description with no streams, and some default
1137 // configuration. 1137 // configuration.
1138 VideoContentDescription* CreateVideoContentDescription() { 1138 VideoContentDescription* CreateVideoContentDescription() {
1139 VideoContentDescription* video = new VideoContentDescription(); 1139 VideoContentDescription* video = new VideoContentDescription();
1140 video->AddCrypto(CryptoParams( 1140 video->AddCrypto(CryptoParams(
1141 1, "AES_CM_128_HMAC_SHA1_80", 1141 1, "AES_CM_128_HMAC_SHA1_80",
1142 "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj|2^20|1:32", "")); 1142 "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj|2^20|1:32", ""));
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 VerifyCodecParameter(opus.params, "minptime", params.min_ptime); 1657 VerifyCodecParameter(opus.params, "minptime", params.min_ptime);
1658 VerifyCodecParameter(opus.params, "stereo", params.stereo); 1658 VerifyCodecParameter(opus.params, "stereo", params.stereo);
1659 VerifyCodecParameter(opus.params, "sprop-stereo", params.sprop_stereo); 1659 VerifyCodecParameter(opus.params, "sprop-stereo", params.sprop_stereo);
1660 VerifyCodecParameter(opus.params, "useinbandfec", params.useinband); 1660 VerifyCodecParameter(opus.params, "useinbandfec", params.useinband);
1661 VerifyCodecParameter(opus.params, "maxaveragebitrate", 1661 VerifyCodecParameter(opus.params, "maxaveragebitrate",
1662 params.maxaveragebitrate); 1662 params.maxaveragebitrate);
1663 for (size_t i = 0; i < acd->codecs().size(); ++i) { 1663 for (size_t i = 0; i < acd->codecs().size(); ++i) {
1664 cricket::AudioCodec codec = acd->codecs()[i]; 1664 cricket::AudioCodec codec = acd->codecs()[i];
1665 VerifyCodecParameter(codec.params, "ptime", params.ptime); 1665 VerifyCodecParameter(codec.params, "ptime", params.ptime);
1666 VerifyCodecParameter(codec.params, "maxptime", params.max_ptime); 1666 VerifyCodecParameter(codec.params, "maxptime", params.max_ptime);
1667 if (codec.name == "ISAC") {
1668 if (codec.clockrate == 16000) {
1669 EXPECT_EQ(32000, codec.bitrate);
1670 } else {
1671 EXPECT_EQ(56000, codec.bitrate);
1672 }
1673 }
1674 } 1667 }
1675 1668
1676 const ContentInfo* vc = GetFirstVideoContent(jdesc_output->description()); 1669 const ContentInfo* vc = GetFirstVideoContent(jdesc_output->description());
1677 ASSERT_TRUE(vc != NULL); 1670 ASSERT_TRUE(vc != NULL);
1678 const VideoContentDescription* vcd = 1671 const VideoContentDescription* vcd =
1679 static_cast<const VideoContentDescription*>(vc->description); 1672 static_cast<const VideoContentDescription*>(vc->description);
1680 ASSERT_FALSE(vcd->codecs().empty()); 1673 ASSERT_FALSE(vcd->codecs().empty());
1681 cricket::VideoCodec vp8 = vcd->codecs()[0]; 1674 cricket::VideoCodec vp8 = vcd->codecs()[0];
1682 EXPECT_EQ("VP8", vp8.name); 1675 EXPECT_EQ("VP8", vp8.name);
1683 EXPECT_EQ(99, vp8.id); 1676 EXPECT_EQ(99, vp8.id);
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 JsepSessionDescription jdesc(kDummyString); 2261 JsepSessionDescription jdesc(kDummyString);
2269 EXPECT_TRUE(SdpDeserialize(kSdpNoRtpmapString, &jdesc)); 2262 EXPECT_TRUE(SdpDeserialize(kSdpNoRtpmapString, &jdesc));
2270 cricket::AudioContentDescription* audio = 2263 cricket::AudioContentDescription* audio =
2271 static_cast<AudioContentDescription*>( 2264 static_cast<AudioContentDescription*>(
2272 jdesc.description()->GetContentDescriptionByName(cricket::CN_AUDIO)); 2265 jdesc.description()->GetContentDescriptionByName(cricket::CN_AUDIO));
2273 AudioCodecs ref_codecs; 2266 AudioCodecs ref_codecs;
2274 // The codecs in the AudioContentDescription should be in the same order as 2267 // The codecs in the AudioContentDescription should be in the same order as
2275 // the payload types (<fmt>s) on the m= line. 2268 // the payload types (<fmt>s) on the m= line.
2276 ref_codecs.push_back(AudioCodec(0, "PCMU", 8000, 0, 1)); 2269 ref_codecs.push_back(AudioCodec(0, "PCMU", 8000, 0, 1));
2277 ref_codecs.push_back(AudioCodec(18, "G729", 16000, 0, 1)); 2270 ref_codecs.push_back(AudioCodec(18, "G729", 16000, 0, 1));
2278 ref_codecs.push_back(AudioCodec(103, "ISAC", 16000, 32000, 1)); 2271 ref_codecs.push_back(AudioCodec(103, "ISAC", 16000, 0, 1));
2279 EXPECT_EQ(ref_codecs, audio->codecs()); 2272 EXPECT_EQ(ref_codecs, audio->codecs());
2280 } 2273 }
2281 2274
2282 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutRtpmapButWithFmtp) { 2275 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutRtpmapButWithFmtp) {
2283 static const char kSdpNoRtpmapString[] = 2276 static const char kSdpNoRtpmapString[] =
2284 "v=0\r\n" 2277 "v=0\r\n"
2285 "o=- 11 22 IN IP4 127.0.0.1\r\n" 2278 "o=- 11 22 IN IP4 127.0.0.1\r\n"
2286 "s=-\r\n" 2279 "s=-\r\n"
2287 "t=0 0\r\n" 2280 "t=0 0\r\n"
2288 "m=audio 49232 RTP/AVP 18 103\r\n" 2281 "m=audio 49232 RTP/AVP 18 103\r\n"
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
3365 JsepSessionDescription jdesc_output(kDummyString); 3358 JsepSessionDescription jdesc_output(kDummyString);
3366 EXPECT_TRUE( 3359 EXPECT_TRUE(
3367 SdpDeserialize(kSdpWithIceCredentialsInCandidateString, &jdesc_output)); 3360 SdpDeserialize(kSdpWithIceCredentialsInCandidateString, &jdesc_output));
3368 const IceCandidateCollection* candidates = jdesc_output.candidates(0); 3361 const IceCandidateCollection* candidates = jdesc_output.candidates(0);
3369 ASSERT_NE(nullptr, candidates); 3362 ASSERT_NE(nullptr, candidates);
3370 ASSERT_EQ(1, candidates->count()); 3363 ASSERT_EQ(1, candidates->count());
3371 cricket::Candidate c = candidates->at(0)->candidate(); 3364 cricket::Candidate c = candidates->at(0)->candidate();
3372 EXPECT_EQ("ufrag_voice", c.username()); 3365 EXPECT_EQ("ufrag_voice", c.username());
3373 EXPECT_EQ("pwd_voice", c.password()); 3366 EXPECT_EQ("pwd_voice", c.password());
3374 } 3367 }
OLDNEW
« no previous file with comments | « webrtc/pc/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698