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

Unified Diff: webrtc/config.cc

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: Various changes based on feedback from Peter and Taylor. Created 3 years, 9 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
Index: webrtc/config.cc
diff --git a/webrtc/config.cc b/webrtc/config.cc
index e0c490d1ecd8038d546b7298fc9a885ab02718df..80f9f12fa2199223cb0221d753e00c0952a72fc2 100644
--- a/webrtc/config.cc
+++ b/webrtc/config.cc
@@ -41,6 +41,9 @@ std::string RtpExtension::ToString() const {
std::stringstream ss;
ss << "{uri: " << uri;
ss << ", id: " << id;
+ if (encrypt) {
+ ss << ", encrypt";
+ }
ss << '}';
return ss.str();
}
@@ -72,6 +75,9 @@ const char* RtpExtension::kPlayoutDelayUri =
"http://www.webrtc.org/experiments/rtp-hdrext/playout-delay";
const int RtpExtension::kPlayoutDelayDefaultId = 6;
+const char* RtpExtension::kEncryptHeaderExtensionsUri =
+ "urn:ietf:params:rtp-hdrext:encrypt";
+
const int RtpExtension::kMinId = 1;
const int RtpExtension::kMaxId = 14;
@@ -88,6 +94,26 @@ bool RtpExtension::IsSupportedForVideo(const std::string& uri) {
uri == webrtc::RtpExtension::kPlayoutDelayUri;
}
+bool RtpExtension::IsEncryptionSupported(const std::string& uri) {
+ // TODO(jbauch): Figure out a way to add "kTimestampOffsetUri" here
+ // and filter out later if external auth is used in srtpfilter.
+ return uri == webrtc::RtpExtension::kAudioLevelUri ||
+ uri == webrtc::RtpExtension::kTimestampOffsetUri ||
+ uri == webrtc::RtpExtension::kVideoRotationUri ||
+ uri == webrtc::RtpExtension::kTransportSequenceNumberUri ||
+ uri == webrtc::RtpExtension::kPlayoutDelayUri;
+}
+
+const RtpExtension* RtpExtension::FindHeaderExtensionByUri(
+ const std::vector<RtpExtension>& extensions,
+ const std::string& uri) {
+ for (const auto& extension : extensions) {
+ if (extension.uri == uri)
Taylor Brandstetter 2017/03/23 20:10:56 nit: Our style is to use {}s even for single-line
joachim 2017/03/30 22:43:49 Done (mine too, looks like I missed this after mov
+ return &extension;
+ }
+ return nullptr;
+}
+
VideoStream::VideoStream()
: width(0),
height(0),
« no previous file with comments | « webrtc/config.h ('k') | webrtc/media/base/fakertp.h » ('j') | webrtc/pc/channel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698