Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: talk/session/media/mediasession.cc

Issue 1219333002: Use "UDP/TLS/RTP/SAVPF" profile in offer when DTLS-SRTP is used. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing some unit tests to account for new behavior Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/session/media/mediasession.cc
diff --git a/talk/session/media/mediasession.cc b/talk/session/media/mediasession.cc
index b299944519376dcef804a1f206b3a09d2b4f15ce..dc4f4080afc4bbcec5d24e5a8ffae6d57730dcaa 100644
--- a/talk/session/media/mediasession.cc
+++ b/talk/session/media/mediasession.cc
@@ -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);
}
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698