flexfec: add signaling unit tests

Adds a signaling unit tests which asserts that a flexfec
offer negotiates flexfec in the answer

BUG=webrtc:8151

Change-Id: Ica6bfe2bdde1a035cdd429d636fefb7f751062d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204680
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33816}
This commit is contained in:
Philipp Hancke 2021-03-11 15:28:00 +01:00 committed by Commit Bot
parent d7842008ef
commit b7bc2436bc
2 changed files with 62 additions and 1 deletions

View File

@ -901,6 +901,62 @@ TEST_P(PeerConnectionSignalingTest, UnsupportedContentType) {
EXPECT_TRUE(caller->SetLocalDescription(std::move(offer)));
}
TEST_P(PeerConnectionSignalingTest, ReceiveFlexFec) {
auto caller = CreatePeerConnection();
std::string sdp =
"v=0\r\n"
"o=- 8403615332048243445 2 IN IP4 127.0.0.1\r\n"
"s=-\r\n"
"t=0 0\r\n"
"a=group:BUNDLE 0\r\n"
"m=video 9 UDP/TLS/RTP/SAVPF 102 122\r\n"
"c=IN IP4 0.0.0.0\r\n"
"a=rtcp:9 IN IP4 0.0.0.0\r\n"
"a=ice-ufrag:IZeV\r\n"
"a=ice-pwd:uaZhQD4rYM/Tta2qWBT1Bbt4\r\n"
"a=ice-options:trickle\r\n"
"a=fingerprint:sha-256 "
"D8:6C:3D:FA:23:E2:2C:63:11:2D:D0:86:BE:C4:D0:65:F9:42:F7:1C:06:04:27:E6:"
"1C:2C:74:01:8D:50:67:23\r\n"
"a=setup:actpass\r\n"
"a=mid:0\r\n"
"a=sendrecv\r\n"
"a=msid:stream track\r\n"
"a=rtcp-mux\r\n"
"a=rtcp-rsize\r\n"
"a=rtpmap:102 VP8/90000\r\n"
"a=rtcp-fb:102 goog-remb\r\n"
"a=rtcp-fb:102 transport-cc\r\n"
"a=rtcp-fb:102 ccm fir\r\n"
"a=rtcp-fb:102 nack\r\n"
"a=rtcp-fb:102 nack pli\r\n"
"a=rtpmap:122 flexfec-03/90000\r\n"
"a=fmtp:122 repair-window=10000000\r\n"
"a=ssrc-group:FEC-FR 1224551896 1953032773\r\n"
"a=ssrc:1224551896 cname:/exJcmhSLpyu9FgV\r\n"
"a=ssrc:1953032773 cname:/exJcmhSLpyu9FgV\r\n";
std::unique_ptr<webrtc::SessionDescriptionInterface> remote_description =
webrtc::CreateSessionDescription(SdpType::kOffer, sdp, nullptr);
EXPECT_TRUE(caller->SetRemoteDescription(std::move(remote_description)));
auto answer = caller->CreateAnswer();
ASSERT_EQ(answer->description()->contents().size(), 1u);
ASSERT_NE(
answer->description()->contents()[0].media_description()->as_video(),
nullptr);
auto codecs = answer->description()
->contents()[0]
.media_description()
->as_video()
->codecs();
ASSERT_EQ(codecs.size(), 2u);
EXPECT_EQ(codecs[1].name, "flexfec-03");
EXPECT_TRUE(caller->SetLocalDescription(std::move(answer)));
}
INSTANTIATE_TEST_SUITE_P(PeerConnectionSignalingTest,
PeerConnectionSignalingTest,
Values(SdpSemantics::kPlanB,

View File

@ -1906,7 +1906,8 @@ class WebRtcSdpTest : public ::testing::Test {
os.clear();
os.str("");
// Pl type 100 preferred.
os << "m=video 9 RTP/SAVPF 99 95\r\n"
os << "m=video 9 RTP/SAVPF 99 95 96\r\n"
"a=rtpmap:96 VP9/90000\r\n" // out-of-order wrt the m= line.
"a=rtpmap:99 VP8/90000\r\n"
"a=rtpmap:95 RTX/90000\r\n"
"a=fmtp:95 apt=99;\r\n";
@ -1954,6 +1955,10 @@ class WebRtcSdpTest : public ::testing::Test {
EXPECT_EQ("RTX", rtx.name);
EXPECT_EQ(95, rtx.id);
VerifyCodecParameter(rtx.params, "apt", vp8.id);
// VP9 is listed last in the m= line so should come after VP8 and RTX.
cricket::VideoCodec vp9 = vcd->codecs()[2];
EXPECT_EQ("VP9", vp9.name);
EXPECT_EQ(96, vp9.id);
}
void TestDeserializeRtcpFb(JsepSessionDescription* jdesc_output,