Add a test to show that H264FmtpSpsPpsIdrInKeyframe parameter is not present in generated SDP
Bug: webrtc:11769
Change-Id: I0e69d18101678a0de12af060396735d3dc0a08e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185964
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32300}
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc
index fde1792..0a298b1 100644
--- a/pc/peer_connection_integrationtest.cc
+++ b/pc/peer_connection_integrationtest.cc
@@ -5386,6 +5386,49 @@
PeerConnectionInterface::kHaveRemoteOffer));
}
+TEST_F(PeerConnectionIntegrationTestUnifiedPlan,
+ H264FmtpSpsPpsIdrInKeyframeParameterUsage) {
+ ASSERT_TRUE(CreatePeerConnectionWrappers());
+ ConnectFakeSignaling();
+ caller()->AddVideoTrack();
+ callee()->AddVideoTrack();
+ auto munger = [](cricket::SessionDescription* desc) {
+ cricket::VideoContentDescription* video =
+ GetFirstVideoContentDescription(desc);
+ auto codecs = video->codecs();
+ for (auto&& codec : codecs) {
+ if (codec.name == "H264") {
+ std::string value;
+ // The parameter is not supposed to be present in SDP by default.
+ EXPECT_FALSE(
+ codec.GetParam(cricket::kH264FmtpSpsPpsIdrInKeyframe, &value));
+ codec.SetParam(std::string(cricket::kH264FmtpSpsPpsIdrInKeyframe),
+ std::string(""));
+ }
+ }
+ video->set_codecs(codecs);
+ };
+ // Munge local offer for SLD.
+ caller()->SetGeneratedSdpMunger(munger);
+ // Munge remote answer for SRD.
+ caller()->SetReceivedSdpMunger(munger);
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ // Observe that after munging the parameter is present in generated SDP.
+ caller()->SetGeneratedSdpMunger([](cricket::SessionDescription* desc) {
+ cricket::VideoContentDescription* video =
+ GetFirstVideoContentDescription(desc);
+ for (auto&& codec : video->codecs()) {
+ if (codec.name == "H264") {
+ std::string value;
+ EXPECT_TRUE(
+ codec.GetParam(cricket::kH264FmtpSpsPpsIdrInKeyframe, &value));
+ }
+ }
+ });
+ caller()->CreateOfferAndWait();
+}
+
INSTANTIATE_TEST_SUITE_P(PeerConnectionIntegrationTest,
PeerConnectionIntegrationTest,
Values(SdpSemantics::kPlanB,