Use "UDP/TLS/RTP/SAVPF" profile in offer when DTLS-SRTP is used.
Tested that this doesn't break compatibility with Firefox or older versions of Chrome, no matter which side generates the initial offer. BUG=webrtc:2796 Review URL: https://codereview.webrtc.org/1219333002 Cr-Commit-Position: refs/heads/master@{#9589}
This commit is contained in:
@ -521,9 +521,9 @@ class WebRtcSessionTest : public testing::Test {
|
||||
ASSERT_EQ(0U, video_content->cryptos().size());
|
||||
|
||||
if (dtls) {
|
||||
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf),
|
||||
EXPECT_EQ(std::string(cricket::kMediaProtocolDtlsSavpf),
|
||||
audio_content->protocol());
|
||||
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf),
|
||||
EXPECT_EQ(std::string(cricket::kMediaProtocolDtlsSavpf),
|
||||
video_content->protocol());
|
||||
} else {
|
||||
EXPECT_EQ(std::string(cricket::kMediaProtocolAvpf),
|
||||
@ -1666,7 +1666,10 @@ TEST_F(WebRtcSessionTest, TestSetLocalNonDtlsAnswerWhenDtlsOn) {
|
||||
// a DTLS fingerprint when DTLS is required.
|
||||
TEST_F(WebRtcSessionTest, TestSetRemoteNonDtlsAnswerWhenDtlsOn) {
|
||||
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
|
||||
// Enable both SDES and DTLS, so that offer won't be outright rejected as a
|
||||
// result of using the "UDP/TLS/RTP/SAVPF" profile.
|
||||
InitWithDtls();
|
||||
session_->SetSdesPolicy(cricket::SEC_ENABLED);
|
||||
SessionDescriptionInterface* offer = CreateOffer();
|
||||
cricket::MediaSessionOptions options;
|
||||
options.recv_video = true;
|
||||
|
@ -63,8 +63,8 @@ const char kMediaProtocolAvpf[] = "RTP/AVPF";
|
||||
// RFC5124
|
||||
const char kMediaProtocolDtlsSavpf[] = "UDP/TLS/RTP/SAVPF";
|
||||
|
||||
// This should be replaced by "UDP/TLS/RTP/SAVPF", but we need to support it for
|
||||
// now to be compatible with previous Chrome versions.
|
||||
// We always generate offers with "UDP/TLS/RTP/SAVPF" when using DTLS-SRTP,
|
||||
// but we tolerate "RTP/SAVPF" in offers we receive, for compatibility.
|
||||
const char kMediaProtocolSavpf[] = "RTP/SAVPF";
|
||||
|
||||
const char kMediaProtocolRtpPrefix[] = "RTP/";
|
||||
@ -614,8 +614,8 @@ static bool IsRtpContent(SessionDescription* sdesc,
|
||||
return false;
|
||||
}
|
||||
is_rtp = media_desc->protocol().empty() ||
|
||||
rtc::starts_with(media_desc->protocol().data(),
|
||||
kMediaProtocolRtpPrefix);
|
||||
(media_desc->protocol().find(cricket::kMediaProtocolRtpPrefix) !=
|
||||
std::string::npos);
|
||||
}
|
||||
return is_rtp;
|
||||
}
|
||||
@ -1047,8 +1047,10 @@ static bool IsMediaProtocolSupported(MediaType type,
|
||||
|
||||
static void SetMediaProtocol(bool secure_transport,
|
||||
MediaContentDescription* desc) {
|
||||
if (!desc->cryptos().empty() || secure_transport)
|
||||
if (!desc->cryptos().empty())
|
||||
desc->set_protocol(kMediaProtocolSavpf);
|
||||
else if (secure_transport)
|
||||
desc->set_protocol(kMediaProtocolDtlsSavpf);
|
||||
else
|
||||
desc->set_protocol(kMediaProtocolAvpf);
|
||||
}
|
||||
|
Reference in New Issue
Block a user