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

Unified Diff: webrtc/media/engine/webrtcmediaengine.cc

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: Fix compile error on win_x64 bots. Created 3 years, 6 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 | « webrtc/media/base/fakertp.cc ('k') | webrtc/media/engine/webrtcmediaengine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcmediaengine.cc
diff --git a/webrtc/media/engine/webrtcmediaengine.cc b/webrtc/media/engine/webrtcmediaengine.cc
index 9e02f58b841ce393dc939e541c6082f5647ca6fd..e4c4c0dc33a2e55257d6a388f5d1e6f46a441348 100644
--- a/webrtc/media/engine/webrtcmediaengine.cc
+++ b/webrtc/media/engine/webrtcmediaengine.cc
@@ -208,18 +208,22 @@ std::vector<webrtc::RtpExtension> FilterRtpExtensions(
}
}
- // Sort by name, ascending, so that we don't reset extensions if they were
- // specified in a different order (also allows us to use std::unique below).
+ // Sort by name, ascending (prioritise encryption), so that we don't reset
+ // extensions if they were specified in a different order (also allows us
+ // to use std::unique below).
std::sort(result.begin(), result.end(),
[](const webrtc::RtpExtension& rhs,
- const webrtc::RtpExtension& lhs) { return rhs.uri < lhs.uri; });
+ const webrtc::RtpExtension& lhs) {
+ return rhs.encrypt == lhs.encrypt ? rhs.uri < lhs.uri
+ : rhs.encrypt > lhs.encrypt;
+ });
// Remove unnecessary extensions (used on send side).
if (filter_redundant_extensions) {
auto it = std::unique(
result.begin(), result.end(),
[](const webrtc::RtpExtension& rhs, const webrtc::RtpExtension& lhs) {
- return rhs.uri == lhs.uri;
+ return rhs.uri == lhs.uri && rhs.encrypt == lhs.encrypt;
});
result.erase(it, result.end());
« no previous file with comments | « webrtc/media/base/fakertp.cc ('k') | webrtc/media/engine/webrtcmediaengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698