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

Side by Side Diff: webrtc/config.h

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: More updates + support for adding/changing encrypted extensions. Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 // Payload type used for RED packets. 52 // Payload type used for RED packets.
53 int red_payload_type; 53 int red_payload_type;
54 54
55 // RTX payload type for RED payload. 55 // RTX payload type for RED payload.
56 int red_rtx_payload_type; 56 int red_rtx_payload_type;
57 }; 57 };
58 58
59 // RTP header extension, see RFC 5285. 59 // RTP header extension, see RFC 5285.
60 struct RtpExtension { 60 struct RtpExtension {
61 RtpExtension() : id(0) {} 61 RtpExtension() {}
62 RtpExtension(const std::string& uri, int id) : uri(uri), id(id) {} 62 RtpExtension(const std::string& uri, int id) : uri(uri), id(id) {}
63 RtpExtension(const std::string& uri, int id, bool encrypt) : uri(uri),
64 id(id), encrypt(encrypt) {}
63 std::string ToString() const; 65 std::string ToString() const;
64 bool operator==(const RtpExtension& rhs) const { 66 bool operator==(const RtpExtension& rhs) const {
65 return uri == rhs.uri && id == rhs.id; 67 return uri == rhs.uri && id == rhs.id && encrypt == rhs.encrypt;
66 } 68 }
67 static bool IsSupportedForAudio(const std::string& uri); 69 static bool IsSupportedForAudio(const std::string& uri);
68 static bool IsSupportedForVideo(const std::string& uri); 70 static bool IsSupportedForVideo(const std::string& uri);
71 // Return "true" if the given RTP header extension URI may be encrypted.
72 static bool IsEncryptionSupported(const std::string& uri);
73
74 // Returns the named header extension if found among all extensions,
75 // nullptr otherwise.
76 static const RtpExtension* FindHeaderExtensionByUri(
77 const std::vector<RtpExtension>& extensions,
78 const std::string& uri);
79
80 // Return a list of RTP header extensions with the non-encrypted extensions
81 // removed if both the encrypted and non-encrypted extension is present for
82 // the same URI.
83 static std::vector<RtpExtension> FilterDuplicateNonEncrypted(
84 const std::vector<RtpExtension>& extensions);
69 85
70 // Header extension for audio levels, as defined in: 86 // Header extension for audio levels, as defined in:
71 // http://tools.ietf.org/html/draft-ietf-avtext-client-to-mixer-audio-level-03 87 // http://tools.ietf.org/html/draft-ietf-avtext-client-to-mixer-audio-level-03
72 static const char* kAudioLevelUri; 88 static const char* kAudioLevelUri;
73 static const int kAudioLevelDefaultId; 89 static const int kAudioLevelDefaultId;
74 90
75 // Header extension for RTP timestamp offset, see RFC 5450 for details: 91 // Header extension for RTP timestamp offset, see RFC 5450 for details:
76 // http://tools.ietf.org/html/rfc5450 92 // http://tools.ietf.org/html/rfc5450
77 static const char* kTimestampOffsetUri; 93 static const char* kTimestampOffsetUri;
78 static const int kTimestampOffsetDefaultId; 94 static const int kTimestampOffsetDefaultId;
(...skipping 10 matching lines...) Expand all
89 static const int kVideoRotationDefaultId; 105 static const int kVideoRotationDefaultId;
90 106
91 // Header extension for transport sequence number, see url for details: 107 // Header extension for transport sequence number, see url for details:
92 // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions 108 // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions
93 static const char* kTransportSequenceNumberUri; 109 static const char* kTransportSequenceNumberUri;
94 static const int kTransportSequenceNumberDefaultId; 110 static const int kTransportSequenceNumberDefaultId;
95 111
96 static const char* kPlayoutDelayUri; 112 static const char* kPlayoutDelayUri;
97 static const int kPlayoutDelayDefaultId; 113 static const int kPlayoutDelayDefaultId;
98 114
115 // Encryption of Header Extensions, see RFC 6904 for details:
116 // https://tools.ietf.org/html/rfc6904
117 static const char* kEncryptHeaderExtensionsUri;
118
99 // Inclusive min and max IDs for one-byte header extensions, per RFC5285. 119 // Inclusive min and max IDs for one-byte header extensions, per RFC5285.
100 static const int kMinId; 120 static const int kMinId;
101 static const int kMaxId; 121 static const int kMaxId;
102 122
103 std::string uri; 123 std::string uri;
104 int id; 124 int id = 0;
125 bool encrypt = false;
105 }; 126 };
106 127
107 struct VideoStream { 128 struct VideoStream {
108 VideoStream(); 129 VideoStream();
109 ~VideoStream(); 130 ~VideoStream();
110 std::string ToString() const; 131 std::string ToString() const;
111 132
112 size_t width; 133 size_t width;
113 size_t height; 134 size_t height;
114 int max_framerate; 135 int max_framerate;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 249
229 private: 250 private:
230 // Access to the copy constructor is private to force use of the Copy() 251 // Access to the copy constructor is private to force use of the Copy()
231 // method for those exceptional cases where we do use it. 252 // method for those exceptional cases where we do use it.
232 VideoEncoderConfig(const VideoEncoderConfig&); 253 VideoEncoderConfig(const VideoEncoderConfig&);
233 }; 254 };
234 255
235 } // namespace webrtc 256 } // namespace webrtc
236 257
237 #endif // WEBRTC_CONFIG_H_ 258 #endif // WEBRTC_CONFIG_H_
OLDNEW
« no previous file with comments | « webrtc/base/sslstreamadapter.h ('k') | webrtc/config.cc » ('j') | webrtc/config.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698