Add offer_extmap_allow_mixed to RTCConfiguration

Bug: webrtc:9986
Change-Id: I346e03a46f35c7d59d3ae769842e3aeec9d2d50d
Reviewed-on: https://webrtc-review.googlesource.com/c/110501
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25596}
This commit is contained in:
Johannes Kron
2018-11-12 10:25:48 +01:00
committed by Commit Bot
parent 5ae3a028c8
commit 89f874eb39
6 changed files with 36 additions and 5 deletions

View File

@ -597,6 +597,14 @@ class PeerConnectionInterface : public rtc::RefCountInterface {
// settings set in PeerConnectionFactory (which is deprecated). // settings set in PeerConnectionFactory (which is deprecated).
absl::optional<CryptoOptions> crypto_options; absl::optional<CryptoOptions> crypto_options;
// Configure if we should include the SDP attribute extmap-allow-mixed in
// our offer. Although we currently do support this, it's not included in
// our offer by default due to a previous bug that caused the SDP parser to
// abort parsing if this attribute was present. This is fixed in Chrome 71.
// TODO(webrtc:9985): Change default to true once sufficient time has
// passed.
bool offer_extmap_allow_mixed = false;
// //
// Don't forget to update operator== if adding something. // Don't forget to update operator== if adding something.
// //

View File

@ -1378,6 +1378,8 @@ SessionDescription* MediaSessionDescriptionFactory::CreateOffer(
offer->set_msid_signaling(cricket::kMsidSignalingSsrcAttribute); offer->set_msid_signaling(cricket::kMsidSignalingSsrcAttribute);
} }
offer->set_extmap_allow_mixed(session_options.offer_extmap_allow_mixed);
return offer.release(); return offer.release();
} }

View File

@ -94,6 +94,7 @@ struct MediaSessionOptions {
bool rtcp_mux_enabled = true; bool rtcp_mux_enabled = true;
bool bundle_enabled = false; bool bundle_enabled = false;
bool is_unified_plan = false; bool is_unified_plan = false;
bool offer_extmap_allow_mixed = false;
std::string rtcp_cname = kDefaultRtcpCname; std::string rtcp_cname = kDefaultRtcpCname;
webrtc::CryptoOptions crypto_options; webrtc::CryptoOptions crypto_options;
// List of media description options in the same order that the media // List of media description options in the same order that the media

View File

@ -737,6 +737,7 @@ bool PeerConnectionInterface::RTCConfiguration::operator==(
bool use_media_transport; bool use_media_transport;
bool use_media_transport_for_data_channels; bool use_media_transport_for_data_channels;
absl::optional<CryptoOptions> crypto_options; absl::optional<CryptoOptions> crypto_options;
bool offer_extmap_allow_mixed;
}; };
static_assert(sizeof(stuff_being_tested_for_equality) == sizeof(*this), static_assert(sizeof(stuff_being_tested_for_equality) == sizeof(*this),
"Did you add something to RTCConfiguration and forget to " "Did you add something to RTCConfiguration and forget to "
@ -788,7 +789,8 @@ bool PeerConnectionInterface::RTCConfiguration::operator==(
use_media_transport == o.use_media_transport && use_media_transport == o.use_media_transport &&
use_media_transport_for_data_channels == use_media_transport_for_data_channels ==
o.use_media_transport_for_data_channels && o.use_media_transport_for_data_channels &&
crypto_options == o.crypto_options; crypto_options == o.crypto_options &&
offer_extmap_allow_mixed == o.offer_extmap_allow_mixed;
} }
bool PeerConnectionInterface::RTCConfiguration::operator!=( bool PeerConnectionInterface::RTCConfiguration::operator!=(
@ -3808,6 +3810,8 @@ void PeerConnection::GetOptionsForOffer(
RTC_FROM_HERE, RTC_FROM_HERE,
rtc::Bind(&cricket::PortAllocator::GetPooledIceCredentials, rtc::Bind(&cricket::PortAllocator::GetPooledIceCredentials,
port_allocator_.get())); port_allocator_.get()));
session_options->offer_extmap_allow_mixed =
configuration_.offer_extmap_allow_mixed;
} }
void PeerConnection::GetOptionsForPlanBOffer( void PeerConnection::GetOptionsForPlanBOffer(

View File

@ -3944,6 +3944,21 @@ TEST_P(PeerConnectionInterfaceTest,
EXPECT_FALSE(DoSetLocalDescription(std::move(offer))); EXPECT_FALSE(DoSetLocalDescription(std::move(offer)));
} }
TEST_P(PeerConnectionInterfaceTest, ExtmapAllowMixedIsConfigurable) {
RTCConfiguration config;
// Default behavior is false.
CreatePeerConnection(config);
std::unique_ptr<SessionDescriptionInterface> offer;
ASSERT_TRUE(DoCreateOffer(&offer, nullptr));
EXPECT_FALSE(offer->description()->extmap_allow_mixed());
// Possible to set to true.
config.offer_extmap_allow_mixed = true;
CreatePeerConnection(config);
offer.release();
ASSERT_TRUE(DoCreateOffer(&offer, nullptr));
EXPECT_TRUE(offer->description()->extmap_allow_mixed());
}
INSTANTIATE_TEST_CASE_P(PeerConnectionInterfaceTest, INSTANTIATE_TEST_CASE_P(PeerConnectionInterfaceTest,
PeerConnectionInterfaceTest, PeerConnectionInterfaceTest,
Values(SdpSemantics::kPlanB, Values(SdpSemantics::kPlanB,

View File

@ -500,10 +500,11 @@ class SessionDescription {
// Default to what Plan B would do. // Default to what Plan B would do.
// TODO(bugs.webrtc.org/8530): Change default to kMsidSignalingMediaSection. // TODO(bugs.webrtc.org/8530): Change default to kMsidSignalingMediaSection.
int msid_signaling_ = kMsidSignalingSsrcAttribute; int msid_signaling_ = kMsidSignalingSsrcAttribute;
// TODO(kron): Activate mixed one- and two-byte header extension in offer at // TODO(webrtc:9985): Activate mixed one- and two-byte header extension in
// session level. It's currently not included in offer by default because // offer at session level. It's currently not included in offer by default
// clients prior to https://bugs.webrtc.org/9712 cannot parse this correctly. // because clients prior to https://bugs.webrtc.org/9712 cannot parse this
// If it's included in offer to us we will respond that we support it. // correctly. If it's included in offer to us we will respond that we support
// it.
bool extmap_allow_mixed_ = false; bool extmap_allow_mixed_ = false;
}; };