Bug 1094447 - Use UDP/TLS/RTP/SAVPF for audio/video m-lines. r=drno

This commit is contained in:
Byron Campen [:bwc] 2015-09-01 17:15:30 -05:00
parent a561827d18
commit e9a3cdecd0
5 changed files with 111 additions and 51 deletions

View File

@ -490,7 +490,10 @@ JsepSessionImpl::AddRecvonlyMsections(SdpMediaSection::MediaType mediatype,
{
while (count--) {
nsresult rv = CreateOfferMSection(
mediatype, SdpDirectionAttribute::kRecvonly, sdp);
mediatype,
mSdpHelper.GetProtocolForMediaType(mediatype),
SdpDirectionAttribute::kRecvonly,
sdp);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -510,6 +513,7 @@ JsepSessionImpl::AddReofferMsections(const Sdp& oldLocalSdp,
// We do not set the direction in this function (or disable when previously
// disabled), that happens in |SetupOfferMSectionsByType|
rv = CreateOfferMSection(oldLocalSdp.GetMediaSection(i).GetMediaType(),
oldLocalSdp.GetMediaSection(i).GetProtocol(),
SdpDirectionAttribute::kInactive,
newSdp);
NS_ENSURE_SUCCESS(rv, rv);
@ -975,12 +979,10 @@ JsepSessionImpl::CreateAnswer(const JsepAnswerOptions& options,
nsresult
JsepSessionImpl::CreateOfferMSection(SdpMediaSection::MediaType mediatype,
SdpMediaSection::Protocol proto,
SdpDirectionAttribute::Direction dir,
Sdp* sdp)
{
SdpMediaSection::Protocol proto =
mSdpHelper.GetProtocolForMediaType(mediatype);
SdpMediaSection* msection =
&sdp->AddMediaSection(mediatype, dir, 0, proto, sdp::kIPv4, "0.0.0.0");
@ -1019,6 +1021,7 @@ JsepSessionImpl::GetFreeMsectionForSend(
// Ok, no pre-existing m-section. Make a new one.
nsresult rv = CreateOfferMSection(type,
mSdpHelper.GetProtocolForMediaType(type),
SdpDirectionAttribute::kInactive,
sdp);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -256,6 +256,7 @@ private:
std::string* streamId,
std::string* trackId);
nsresult CreateOfferMSection(SdpMediaSection::MediaType type,
SdpMediaSection::Protocol proto,
SdpDirectionAttribute::Direction direction,
Sdp* sdp);
nsresult GetFreeMsectionForSend(SdpMediaSection::MediaType type,

View File

@ -634,8 +634,7 @@ SdpHelper::GetProtocolForMediaType(SdpMediaSection::MediaType type)
return SdpMediaSection::kDtlsSctp;
}
// TODO(bug 1094447): Use kUdpTlsRtpSavpf once it interops well
return SdpMediaSection::kRtpSavpf;
return SdpMediaSection::kUdpTlsRtpSavpf;
}
void

View File

@ -917,7 +917,7 @@ private:
if (msection.GetMediaType() == SdpMediaSection::kApplication) {
ASSERT_EQ(SdpMediaSection::kDtlsSctp, msection.GetProtocol());
} else {
ASSERT_EQ(SdpMediaSection::kRtpSavpf, msection.GetProtocol());
ASSERT_EQ(SdpMediaSection::kUdpTlsRtpSavpf, msection.GetProtocol());
}
if (msection.GetPort() == 0) {
@ -3759,6 +3759,53 @@ TEST_P(JsepSessionTest, TestMaxBundle)
EXPECT_EQ(1U, GetActiveTransportCount(mSessionAns));
}
TEST_F(JsepSessionTest, TestNonDefaultProtocol)
{
AddTracks(mSessionOff, "audio,video,datachannel");
AddTracks(mSessionAns, "audio,video,datachannel");
std::string offer;
ASSERT_EQ(NS_OK, mSessionOff.CreateOffer(JsepOfferOptions(), &offer));
offer.replace(offer.find("UDP/TLS/RTP/SAVPF"),
strlen("UDP/TLS/RTP/SAVPF"),
"RTP/SAVPF");
offer.replace(offer.find("UDP/TLS/RTP/SAVPF"),
strlen("UDP/TLS/RTP/SAVPF"),
"RTP/SAVPF");
mSessionOff.SetLocalDescription(kJsepSdpOffer, offer);
mSessionAns.SetRemoteDescription(kJsepSdpOffer, offer);
std::string answer;
mSessionAns.CreateAnswer(JsepAnswerOptions(), &answer);
UniquePtr<Sdp> parsedAnswer = Parse(answer);
ASSERT_EQ(3U, parsedAnswer->GetMediaSectionCount());
ASSERT_EQ(SdpMediaSection::kRtpSavpf,
parsedAnswer->GetMediaSection(0).GetProtocol());
ASSERT_EQ(SdpMediaSection::kRtpSavpf,
parsedAnswer->GetMediaSection(1).GetProtocol());
mSessionAns.SetLocalDescription(kJsepSdpAnswer, answer);
mSessionOff.SetRemoteDescription(kJsepSdpAnswer, answer);
// Make sure reoffer uses the same protocol as before
mSessionOff.CreateOffer(JsepOfferOptions(), &offer);
UniquePtr<Sdp> parsedOffer = Parse(offer);
ASSERT_EQ(3U, parsedOffer->GetMediaSectionCount());
ASSERT_EQ(SdpMediaSection::kRtpSavpf,
parsedOffer->GetMediaSection(0).GetProtocol());
ASSERT_EQ(SdpMediaSection::kRtpSavpf,
parsedOffer->GetMediaSection(1).GetProtocol());
// Make sure reoffer from other side uses the same protocol as before
mSessionAns.CreateOffer(JsepOfferOptions(), &offer);
parsedOffer = Parse(offer);
ASSERT_EQ(3U, parsedOffer->GetMediaSectionCount());
ASSERT_EQ(SdpMediaSection::kRtpSavpf,
parsedOffer->GetMediaSection(0).GetProtocol());
ASSERT_EQ(SdpMediaSection::kRtpSavpf,
parsedOffer->GetMediaSection(1).GetProtocol());
}
} // namespace mozilla
int

View File

@ -2315,8 +2315,10 @@ TEST_P(SignalingTest, OfferAnswerNothingDisabledFullCycle)
OfferOptions options;
OfferAnswer(options, OFFER_AV | ANSWER_AV);
// verify the default codec priorities
ASSERT_NE(a1_->getLocalDescription().find("RTP/SAVPF 109 9 0 8\r"), std::string::npos);
ASSERT_NE(a2_->getLocalDescription().find("RTP/SAVPF 109\r"), std::string::npos);
ASSERT_NE(a1_->getLocalDescription().find("UDP/TLS/RTP/SAVPF 109 9 0 8\r"),
std::string::npos);
ASSERT_NE(a2_->getLocalDescription().find("UDP/TLS/RTP/SAVPF 109\r"),
std::string::npos);
}
TEST_P(SignalingTest, OfferAnswerAudioInactive)
@ -2535,7 +2537,8 @@ TEST_P(SignalingTest, OfferAndAnswerWithExtraCodec)
a2_->CreateAnswer(OFFER_AUDIO | ANSWER_AUDIO);
a2_->SetLocal(TestObserver::ANSWER, a2_->answer());
ParsedSDP sdpWrapper(a2_->answer());
sdpWrapper.ReplaceLine("m=audio", "m=audio 65375 RTP/SAVPF 109 8\r\n");
sdpWrapper.ReplaceLine("m=audio",
"m=audio 65375 UDP/TLS/RTP/SAVPF 109 8\r\n");
sdpWrapper.AddLine("a=rtpmap:8 PCMA/8000\r\n");
std::cout << "Modified SDP " << std::endl
<< indent(sdpWrapper.getSdp()) << std::endl;
@ -2638,7 +2641,7 @@ TEST_P(SignalingTest, IncomingOfferIceLite)
"a=ice-lite\r\n"
"a=fingerprint:sha-1 "
"E7:FA:17:DA:3F:3C:1E:D8:E4:9C:8C:4C:13:B9:2E:D5:C6:78:AB:B3\r\n"
"m=audio 40014 RTP/SAVPF 8 0 101\r\n"
"m=audio 40014 UDP/TLS/RTP/SAVPF 8 0 101\r\n"
"a=rtpmap:8 PCMA/8000\r\n"
"a=rtpmap:0 PCMU/8000\r\n"
"a=rtpmap:101 telephone-event/8000\r\n"
@ -2675,7 +2678,7 @@ TEST_P(SignalingTest, ChromeOfferAnswer)
"t=0 0\r\n"
"a=group:BUNDLE audio video\r\n"
"m=audio 1 RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\n"
"m=audio 1 UDP/TLS/RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\n"
"a=fingerprint:sha-1 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:"
"5D:49:6B:19:E5:7C:AB\r\n"
"a=setup:active\r\n"
@ -2709,7 +2712,7 @@ TEST_P(SignalingTest, ChromeOfferAnswer)
"a=ssrc:661333377 mslabel:A5UL339RyGxT7zwgyF12BFqesxkmbUsaycp5\r\n"
"a=ssrc:661333377 label:A5UL339RyGxT7zwgyF12BFqesxkmbUsaycp5a0\r\n"
"m=video 1 RTP/SAVPF 100 101 102\r\n"
"m=video 1 UDP/TLS/RTP/SAVPF 100 101 102\r\n"
"a=fingerprint:sha-1 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:"
"6B:19:E5:7C:AB\r\n"
"a=setup:active\r\n"
@ -2754,7 +2757,7 @@ TEST_P(SignalingTest, FullChromeHandshake)
"t=0 0\r\n"
"a=group:BUNDLE audio video\r\n"
"a=msid-semantic: WMS ahheYQXHFU52slYMrWNtKUyHCtWZsOJgjlOH\r\n"
"m=audio 1 RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\n"
"m=audio 1 UDP/TLS/RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\n"
"c=IN IP4 1.1.1.1\r\n"
"a=rtcp:1 IN IP4 1.1.1.1\r\n"
"a=ice-ufrag:jz9UBk9RT8eCQXiL\r\n"
@ -2782,7 +2785,7 @@ TEST_P(SignalingTest, FullChromeHandshake)
"a=ssrc:3389377748 msid:ahheYQXHFU52slYMrWNtKUyHCtWZsOJgjlOH a0\r\n"
"a=ssrc:3389377748 mslabel:ahheYQXHFU52slYMrWNtKUyHCtWZsOJgjlOH\r\n"
"a=ssrc:3389377748 label:ahheYQXHFU52slYMrWNtKUyHCtWZsOJgjlOHa0\r\n"
"m=video 1 RTP/SAVPF 100 116 117\r\n"
"m=video 1 UDP/TLS/RTP/SAVPF 100 116 117\r\n"
"c=IN IP4 1.1.1.1\r\n"
"a=rtcp:1 IN IP4 1.1.1.1\r\n"
"a=ice-ufrag:jz9UBk9RT8eCQXiL\r\n"
@ -3234,7 +3237,7 @@ TEST_P(SignalingTest, missingUfrag)
"a=ice-pwd:4450d5a4a5f097855c16fa079893be18\r\n"
"a=fingerprint:sha-256 23:9A:2E:43:94:42:CF:46:68:FC:62:F9:F4:48:61:DB:"
"2F:8C:C9:FF:6B:25:54:9D:41:09:EF:83:A8:19:FC:B6\r\n"
"m=audio 56187 RTP/SAVPF 109 0 8 101\r\n"
"m=audio 56187 UDP/TLS/RTP/SAVPF 109 0 8 101\r\n"
"c=IN IP4 77.9.79.167\r\n"
"a=rtpmap:109 opus/48000/2\r\n"
"a=ptime:20\r\n"
@ -3249,7 +3252,7 @@ TEST_P(SignalingTest, missingUfrag)
"a=candidate:0 2 UDP 2113601790 192.168.178.20 52955 typ host\r\n"
"a=candidate:1 2 UDP 1694236670 77.9.79.167 52955 typ srflx raddr "
"192.168.178.20 rport 52955\r\n"
"m=video 49929 RTP/SAVPF 120\r\n"
"m=video 49929 UDP/TLS/RTP/SAVPF 120\r\n"
"c=IN IP4 77.9.79.167\r\n"
"a=rtpmap:120 VP8/90000\r\n"
"a=recvonly\r\n"
@ -3319,14 +3322,15 @@ TEST_P(SignalingTest, AudioOnlyG722Only)
a1_->SetLocal(TestObserver::OFFER, a1_->offer(), false);
ParsedSDP sdpWrapper(a1_->offer());
sdpWrapper.ReplaceLine("m=audio",
"m=audio 65375 RTP/SAVPF 9\r\n");
"m=audio 65375 UDP/TLS/RTP/SAVPF 9\r\n");
std::cout << "Modified SDP " << std::endl
<< indent(sdpWrapper.getSdp()) << std::endl;
a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp(), false);
a2_->CreateAnswer(OFFER_AUDIO | ANSWER_AUDIO);
a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
ASSERT_NE(a2_->getLocalDescription().find("RTP/SAVPF 9\r"), std::string::npos);
ASSERT_NE(a2_->getLocalDescription().find("UDP/TLS/RTP/SAVPF 9\r"),
std::string::npos);
ASSERT_NE(a2_->getLocalDescription().find("a=rtpmap:9 G722/8000"), std::string::npos);
WaitForCompleted();
@ -3347,14 +3351,15 @@ TEST_P(SignalingTest, AudioOnlyG722MostPreferred)
a1_->SetLocal(TestObserver::OFFER, a1_->offer(), false);
ParsedSDP sdpWrapper(a1_->offer());
sdpWrapper.ReplaceLine("m=audio",
"m=audio 65375 RTP/SAVPF 9 0 8 109\r\n");
"m=audio 65375 UDP/TLS/RTP/SAVPF 9 0 8 109\r\n");
std::cout << "Modified SDP " << std::endl
<< indent(sdpWrapper.getSdp()) << std::endl;
a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp(), false);
a2_->CreateAnswer(OFFER_AUDIO | ANSWER_AUDIO);
a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
ASSERT_NE(a2_->getLocalDescription().find("RTP/SAVPF 9"), std::string::npos);
ASSERT_NE(a2_->getLocalDescription().find("UDP/TLS/RTP/SAVPF 9"),
std::string::npos);
ASSERT_NE(a2_->getLocalDescription().find("a=rtpmap:9 G722/8000"), std::string::npos);
CheckPipelines();
@ -3375,16 +3380,17 @@ TEST_P(SignalingTest, AudioOnlyG722Rejected)
a1_->SetLocal(TestObserver::OFFER, a1_->offer(), false);
ParsedSDP sdpWrapper(a1_->offer());
sdpWrapper.ReplaceLine("m=audio",
"m=audio 65375 RTP/SAVPF 0 8\r\n");
"m=audio 65375 UDP/TLS/RTP/SAVPF 0 8\r\n");
std::cout << "Modified SDP offer " << std::endl
<< indent(sdpWrapper.getSdp()) << std::endl;
a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp(), false);
a2_->CreateAnswer(OFFER_AUDIO | ANSWER_AUDIO);
a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
// TODO(bug 1099351): Use commented out code instead.
ASSERT_NE(a2_->getLocalDescription().find("RTP/SAVPF 0\r"), std::string::npos);
// ASSERT_NE(a2_->getLocalDescription().find("RTP/SAVPF 0 8\r"), std::string::npos);
// TODO(bug 814227): Use commented out code instead.
ASSERT_NE(a2_->getLocalDescription().find("UDP/TLS/RTP/SAVPF 0\r"),
std::string::npos);
// ASSERT_NE(a2_->getLocalDescription().find("UDP/TLS/RTP/SAVPF 0 8\r"), std::string::npos);
ASSERT_NE(a2_->getLocalDescription().find("a=rtpmap:0 PCMU/8000"), std::string::npos);
ASSERT_EQ(a2_->getLocalDescription().find("a=rtpmap:109 opus/48000/2"), std::string::npos);
ASSERT_EQ(a2_->getLocalDescription().find("a=rtpmap:9 G722/8000"), std::string::npos);
@ -3869,7 +3875,7 @@ TEST_P(SignalingTest, hugeSdp)
"t=0 0\r\n"
"a=group:BUNDLE audio video\r\n"
"a=msid-semantic: WMS 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP\r\n"
"m=audio 32952 RTP/SAVPF 111 103 104 0 8 107 106 105 13 126\r\n"
"m=audio 32952 UDP/TLS/RTP/SAVPF 111 103 104 0 8 107 106 105 13 126\r\n"
"c=IN IP4 128.64.32.16\r\n"
"a=rtcp:32952 IN IP4 128.64.32.16\r\n"
"a=candidate:77142221 1 udp 2113937151 192.168.137.1 54081 typ host generation 0\r\n"
@ -3914,7 +3920,7 @@ TEST_P(SignalingTest, hugeSdp)
"a=ssrc:2271517329 msid:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPa0\r\n"
"a=ssrc:2271517329 mslabel:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP\r\n"
"a=ssrc:2271517329 label:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPa0\r\n"
"m=video 32952 RTP/SAVPF 100 116 117\r\n"
"m=video 32952 UDP/TLS/RTP/SAVPF 100 116 117\r\n"
"c=IN IP4 128.64.32.16\r\n"
"a=rtcp:32952 IN IP4 128.64.32.16\r\n"
"a=candidate:77142221 1 udp 2113937151 192.168.137.1 54081 typ host generation 0\r\n"
@ -4113,9 +4119,9 @@ TEST_P(SignalingTest, ValidateMultipleVideoCodecsInOffer)
std::string offer = a1_->offer();
#ifdef H264_P0_SUPPORTED
ASSERT_NE(offer.find("RTP/SAVPF 120 126 97"), std::string::npos);
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 120 126 97"), std::string::npos);
#else
ASSERT_NE(offer.find("RTP/SAVPF 120 126"), std::string::npos);
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 120 126"), std::string::npos);
#endif
ASSERT_NE(offer.find("a=rtpmap:120 VP8/90000"), std::string::npos);
ASSERT_NE(offer.find("a=rtpmap:126 H264/90000"), std::string::npos);
@ -4147,9 +4153,9 @@ TEST_P(SignalingTest, RemoveVP8FromOfferWithP1First)
// Remove VP8 from offer
std::string offer = a1_->offer();
match = offer.find("RTP/SAVPF 120");
match = offer.find("UDP/TLS/RTP/SAVPF 120");
ASSERT_NE(std::string::npos, match);
offer.replace(match, strlen("RTP/SAVPF 120"), "RTP/SAVPF");
offer.replace(match, strlen("UDP/TLS/RTP/SAVPF 120"), "UDP/TLS/RTP/SAVPF");
match = offer.find("profile-level-id");
ASSERT_NE(std::string::npos, match);
@ -4165,7 +4171,7 @@ TEST_P(SignalingTest, RemoveVP8FromOfferWithP1First)
<< indent(sdpWrapper.getSdp()) << std::endl;
// P1 should be offered first
ASSERT_NE(offer.find("RTP/SAVPF 126"), std::string::npos);
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 126"), std::string::npos);
a1_->SetLocal(TestObserver::OFFER, sdpWrapper.getSdp());
a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp(), false);
@ -4174,7 +4180,7 @@ TEST_P(SignalingTest, RemoveVP8FromOfferWithP1First)
std::string answer(a2_->answer());
// Validate answer SDP
ASSERT_NE(answer.find("RTP/SAVPF 126"), std::string::npos);
ASSERT_NE(answer.find("UDP/TLS/RTP/SAVPF 126"), std::string::npos);
ASSERT_NE(answer.find("a=rtpmap:126 H264/90000"), std::string::npos);
ASSERT_NE(answer.find("a=rtcp-fb:126 nack"), std::string::npos);
ASSERT_NE(answer.find("a=rtcp-fb:126 nack pli"), std::string::npos);
@ -4197,17 +4203,17 @@ TEST_P(SignalingTest, OfferWithH264BeforeVP8)
// Swap VP8 and P1 in offer
std::string offer = a1_->offer();
#ifdef H264_P0_SUPPORTED
match = offer.find("RTP/SAVPF 120 126 97");
match = offer.find("UDP/TLS/RTP/SAVPF 120 126 97");
ASSERT_NE(std::string::npos, match);
offer.replace(match,
strlen("RTP/SAVPF 126 120 97"),
"RTP/SAVPF 126 120 97");
strlen("UDP/TLS/RTP/SAVPF 126 120 97"),
"UDP/TLS/RTP/SAVPF 126 120 97");
#else
match = offer.find("RTP/SAVPF 120 126");
match = offer.find("UDP/TLS/RTP/SAVPF 120 126");
ASSERT_NE(std::string::npos, match);
offer.replace(match,
strlen("RTP/SAVPF 126 120"),
"RTP/SAVPF 126 120");
strlen("UDP/TLS/RTP/SAVPF 126 120"),
"UDP/TLS/RTP/SAVPF 126 120");
#endif
match = offer.find("a=rtpmap:126 H264/90000");
@ -4227,9 +4233,9 @@ TEST_P(SignalingTest, OfferWithH264BeforeVP8)
// P1 should be offered first
#ifdef H264_P0_SUPPORTED
ASSERT_NE(offer.find("RTP/SAVPF 126 120 97"), std::string::npos);
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 126 120 97"), std::string::npos);
#else
ASSERT_NE(offer.find("RTP/SAVPF 126 120"), std::string::npos);
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 126 120"), std::string::npos);
#endif
a1_->SetLocal(TestObserver::OFFER, offer);
@ -4239,7 +4245,7 @@ TEST_P(SignalingTest, OfferWithH264BeforeVP8)
std::string answer(a2_->answer());
// Validate answer SDP
ASSERT_NE(answer.find("RTP/SAVPF 126"), std::string::npos);
ASSERT_NE(answer.find("UDP/TLS/RTP/SAVPF 126"), std::string::npos);
ASSERT_NE(answer.find("a=rtpmap:126 H264/90000"), std::string::npos);
ASSERT_NE(answer.find("a=rtcp-fb:126 nack"), std::string::npos);
ASSERT_NE(answer.find("a=rtcp-fb:126 nack pli"), std::string::npos);
@ -4259,11 +4265,11 @@ TEST_P(SignalingTest, OfferWithOnlyH264P0)
// Remove VP8 from offer
std::string offer = a1_->offer();
match = offer.find("RTP/SAVPF 120 126");
match = offer.find("UDP/TLS/RTP/SAVPF 120 126");
ASSERT_NE(std::string::npos, match);
offer.replace(match,
strlen("RTP/SAVPF 120 126"),
"RTP/SAVPF");
strlen("UDP/TLS/RTP/SAVPF 120 126"),
"UDP/TLS/RTP/SAVPF");
ParsedSDP sdpWrapper(offer);
sdpWrapper.DeleteLines("a=rtcp-fb:120");
@ -4281,7 +4287,7 @@ TEST_P(SignalingTest, OfferWithOnlyH264P0)
ASSERT_EQ(offer.find("a=rtpmap:120 VP8/90000"), std::string::npos);
// P0 should be offered first
ASSERT_NE(offer.find("RTP/SAVPF 97"), std::string::npos);
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 97"), std::string::npos);
a1_->SetLocal(TestObserver::OFFER, offer);
a2_->SetRemote(TestObserver::OFFER, offer, false);
@ -4290,7 +4296,7 @@ TEST_P(SignalingTest, OfferWithOnlyH264P0)
std::string answer(a2_->answer());
// validate answer SDP
ASSERT_NE(answer.find("RTP/SAVPF 97"), std::string::npos);
ASSERT_NE(answer.find("UDP/TLS/RTP/SAVPF 97"), std::string::npos);
ASSERT_NE(answer.find("a=rtpmap:97 H264/90000"), std::string::npos);
ASSERT_NE(answer.find("a=rtcp-fb:97 nack"), std::string::npos);
ASSERT_NE(answer.find("a=rtcp-fb:97 nack pli"), std::string::npos);
@ -4327,9 +4333,11 @@ TEST_P(SignalingTest, AnswerWithoutVP8)
size_t match;
answer = sdpWrapper.getSdp();
match = answer.find("RTP/SAVPF 120");
match = answer.find("UDP/TLS/RTP/SAVPF 120");
ASSERT_NE(std::string::npos, match);
answer.replace(match, strlen("RTP/SAVPF 120"), "RTP/SAVPF 126");
answer.replace(match,
strlen("UDP/TLS/RTP/SAVPF 120"),
"UDP/TLS/RTP/SAVPF 126");
match = answer.find("\r\na=rtpmap:120 VP8/90000");
ASSERT_NE(std::string::npos, match);
@ -4392,9 +4400,11 @@ TEST_P(SignalingTest, UseNonPrefferedPayloadTypeOnAnswer)
// Replace VP8 Payload Type with a non preferred value
size_t match;
match = answer.find("RTP/SAVPF 120");
match = answer.find("UDP/TLS/RTP/SAVPF 120");
ASSERT_NE(std::string::npos, match);
answer.replace(match, strlen("RTP/SAVPF 121"), "RTP/SAVPF 121");
answer.replace(match,
strlen("UDP/TLS/RTP/SAVPF 121"),
"UDP/TLS/RTP/SAVPF 121");
match = answer.find("\r\na=rtpmap:120 VP8/90000");
ASSERT_NE(std::string::npos, match);