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

Side by Side Diff: webrtc/config.h

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 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);
69 79
70 // Header extension for audio levels, as defined in: 80 // Header extension for audio levels, as defined in:
71 // http://tools.ietf.org/html/draft-ietf-avtext-client-to-mixer-audio-level-03 81 // http://tools.ietf.org/html/draft-ietf-avtext-client-to-mixer-audio-level-03
72 static const char* kAudioLevelUri; 82 static const char* kAudioLevelUri;
73 static const int kAudioLevelDefaultId; 83 static const int kAudioLevelDefaultId;
74 84
75 // Header extension for RTP timestamp offset, see RFC 5450 for details: 85 // Header extension for RTP timestamp offset, see RFC 5450 for details:
76 // http://tools.ietf.org/html/rfc5450 86 // http://tools.ietf.org/html/rfc5450
77 static const char* kTimestampOffsetUri; 87 static const char* kTimestampOffsetUri;
78 static const int kTimestampOffsetDefaultId; 88 static const int kTimestampOffsetDefaultId;
(...skipping 10 matching lines...) Expand all
89 static const int kVideoRotationDefaultId; 99 static const int kVideoRotationDefaultId;
90 100
91 // Header extension for transport sequence number, see url for details: 101 // Header extension for transport sequence number, see url for details:
92 // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions 102 // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions
93 static const char* kTransportSequenceNumberUri; 103 static const char* kTransportSequenceNumberUri;
94 static const int kTransportSequenceNumberDefaultId; 104 static const int kTransportSequenceNumberDefaultId;
95 105
96 static const char* kPlayoutDelayUri; 106 static const char* kPlayoutDelayUri;
97 static const int kPlayoutDelayDefaultId; 107 static const int kPlayoutDelayDefaultId;
98 108
109 // Encryption of Header Extensions, see RFC 6904 for details:
110 // https://tools.ietf.org/html/rfc6904
111 static const char* kEncryptHeaderExtensionsUri;
112
99 // Inclusive min and max IDs for one-byte header extensions, per RFC5285. 113 // Inclusive min and max IDs for one-byte header extensions, per RFC5285.
100 static const int kMinId; 114 static const int kMinId;
101 static const int kMaxId; 115 static const int kMaxId;
102 116
103 std::string uri; 117 std::string uri;
104 int id; 118 int id = 0;
119 bool encrypt = false;
105 }; 120 };
106 121
107 struct VideoStream { 122 struct VideoStream {
108 VideoStream(); 123 VideoStream();
109 ~VideoStream(); 124 ~VideoStream();
110 std::string ToString() const; 125 std::string ToString() const;
111 126
112 size_t width; 127 size_t width;
113 size_t height; 128 size_t height;
114 int max_framerate; 129 int max_framerate;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 243
229 private: 244 private:
230 // Access to the copy constructor is private to force use of the Copy() 245 // Access to the copy constructor is private to force use of the Copy()
231 // method for those exceptional cases where we do use it. 246 // method for those exceptional cases where we do use it.
232 VideoEncoderConfig(const VideoEncoderConfig&); 247 VideoEncoderConfig(const VideoEncoderConfig&);
233 }; 248 };
234 249
235 } // namespace webrtc 250 } // namespace webrtc
236 251
237 #endif // WEBRTC_CONFIG_H_ 252 #endif // WEBRTC_CONFIG_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/config.cc » ('j') | webrtc/config.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698