Allow to negotiate dependency descriptor rtp header extension
Without exposing it in capabilities: this extension is not stable enough to expose it by default, but already in working state so with munge sdp can be experimented with. Bug: webrtc:10342 Change-Id: I6bac123325a90431e4769e86da79638869e36cfc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168961 Reviewed-by: Magnus Flodman <mflodman@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30645}
This commit is contained in:

committed by
Commit Bot

parent
ff61f3a555
commit
5f999a777d
@ -1074,9 +1074,12 @@ static void NegotiateRtpHeaderExtensions(
|
|||||||
webrtc::RtpExtension::kTransportSequenceNumberV2Uri);
|
webrtc::RtpExtension::kTransportSequenceNumberV2Uri);
|
||||||
|
|
||||||
bool frame_descriptor_in_local = false;
|
bool frame_descriptor_in_local = false;
|
||||||
|
bool dependency_descriptor_in_local = false;
|
||||||
for (const webrtc::RtpExtension& ours : local_extensions) {
|
for (const webrtc::RtpExtension& ours : local_extensions) {
|
||||||
if (ours.uri == webrtc::RtpExtension::kGenericFrameDescriptorUri00)
|
if (ours.uri == webrtc::RtpExtension::kGenericFrameDescriptorUri00)
|
||||||
frame_descriptor_in_local = true;
|
frame_descriptor_in_local = true;
|
||||||
|
else if (ours.uri == webrtc::RtpExtension::kDependencyDescriptorUri)
|
||||||
|
dependency_descriptor_in_local = true;
|
||||||
webrtc::RtpExtension theirs;
|
webrtc::RtpExtension theirs;
|
||||||
if (FindByUriWithEncryptionPreference(
|
if (FindByUriWithEncryptionPreference(
|
||||||
offered_extensions, ours.uri,
|
offered_extensions, ours.uri,
|
||||||
@ -1100,14 +1103,20 @@ static void NegotiateRtpHeaderExtensions(
|
|||||||
negotiated_extensions->push_back(*transport_sequence_number_v2_offer);
|
negotiated_extensions->push_back(*transport_sequence_number_v2_offer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Frame descriptor support. If the extension is not present locally, but is
|
// Frame descriptors support. If the extension is not present locally, but is
|
||||||
// in the offer, we add it to the list.
|
// in the offer, we add it to the list.
|
||||||
if (!frame_descriptor_in_local) {
|
|
||||||
webrtc::RtpExtension theirs;
|
webrtc::RtpExtension theirs;
|
||||||
if (FindByUriWithEncryptionPreference(
|
if (!dependency_descriptor_in_local &&
|
||||||
|
FindByUriWithEncryptionPreference(
|
||||||
|
offered_extensions, webrtc::RtpExtension::kDependencyDescriptorUri,
|
||||||
|
enable_encrypted_rtp_header_extensions, &theirs)) {
|
||||||
|
negotiated_extensions->push_back(theirs);
|
||||||
|
}
|
||||||
|
if (!frame_descriptor_in_local &&
|
||||||
|
FindByUriWithEncryptionPreference(
|
||||||
offered_extensions,
|
offered_extensions,
|
||||||
webrtc::RtpExtension::kGenericFrameDescriptorUri00,
|
webrtc::RtpExtension::kGenericFrameDescriptorUri00,
|
||||||
enable_encrypted_rtp_header_extensions, &theirs))
|
enable_encrypted_rtp_header_extensions, &theirs)) {
|
||||||
negotiated_extensions->push_back(theirs);
|
negotiated_extensions->push_back(theirs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,7 @@ using rtc::CS_AES_CM_128_HMAC_SHA1_80;
|
|||||||
using rtc::UniqueRandomIdGenerator;
|
using rtc::UniqueRandomIdGenerator;
|
||||||
using ::testing::Contains;
|
using ::testing::Contains;
|
||||||
using ::testing::Each;
|
using ::testing::Each;
|
||||||
|
using ::testing::ElementsAre;
|
||||||
using ::testing::ElementsAreArray;
|
using ::testing::ElementsAreArray;
|
||||||
using ::testing::Eq;
|
using ::testing::Eq;
|
||||||
using ::testing::Field;
|
using ::testing::Field;
|
||||||
@ -1721,6 +1722,40 @@ TEST_F(MediaSessionDescriptionFactoryTest,
|
|||||||
ElementsAreArray(offered));
|
ElementsAreArray(offered));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(MediaSessionDescriptionFactoryTest,
|
||||||
|
NegotiateDependencyDescriptorWhenUnexposedLocally) {
|
||||||
|
MediaSessionOptions opts;
|
||||||
|
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
|
||||||
|
|
||||||
|
RtpExtension offer_dd(RtpExtension::kDependencyDescriptorUri, 7);
|
||||||
|
RtpExtension local_tsn(RtpExtension::kTransportSequenceNumberUri, 5);
|
||||||
|
f1_.set_video_rtp_header_extensions({offer_dd});
|
||||||
|
f2_.set_video_rtp_header_extensions({local_tsn});
|
||||||
|
std::unique_ptr<SessionDescription> offer = f1_.CreateOffer(opts, nullptr);
|
||||||
|
std::unique_ptr<SessionDescription> answer =
|
||||||
|
f2_.CreateAnswer(offer.get(), opts, nullptr);
|
||||||
|
EXPECT_THAT(
|
||||||
|
GetFirstVideoContentDescription(answer.get())->rtp_header_extensions(),
|
||||||
|
ElementsAre(offer_dd));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(MediaSessionDescriptionFactoryTest,
|
||||||
|
NegotiateDependencyDescriptorWhenExposedLocally) {
|
||||||
|
MediaSessionOptions opts;
|
||||||
|
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
|
||||||
|
|
||||||
|
RtpExtension offer_dd(RtpExtension::kDependencyDescriptorUri, 7);
|
||||||
|
RtpExtension local_dd(RtpExtension::kDependencyDescriptorUri, 5);
|
||||||
|
f1_.set_video_rtp_header_extensions({offer_dd});
|
||||||
|
f2_.set_video_rtp_header_extensions({local_dd});
|
||||||
|
std::unique_ptr<SessionDescription> offer = f1_.CreateOffer(opts, nullptr);
|
||||||
|
std::unique_ptr<SessionDescription> answer =
|
||||||
|
f2_.CreateAnswer(offer.get(), opts, nullptr);
|
||||||
|
EXPECT_THAT(
|
||||||
|
GetFirstVideoContentDescription(answer.get())->rtp_header_extensions(),
|
||||||
|
ElementsAre(offer_dd));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(MediaSessionDescriptionFactoryTest,
|
TEST_F(MediaSessionDescriptionFactoryTest,
|
||||||
TestOfferAnswerWithEncryptedRtpExtensionsBoth) {
|
TestOfferAnswerWithEncryptedRtpExtensionsBoth) {
|
||||||
MediaSessionOptions opts;
|
MediaSessionOptions opts;
|
||||||
|
Reference in New Issue
Block a user