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

Side by Side Diff: webrtc/config.cc

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 #include "webrtc/config.h" 10 #include "webrtc/config.h"
(...skipping 23 matching lines...) Expand all
34 bool UlpfecConfig::operator==(const UlpfecConfig& other) const { 34 bool UlpfecConfig::operator==(const UlpfecConfig& other) const {
35 return ulpfec_payload_type == other.ulpfec_payload_type && 35 return ulpfec_payload_type == other.ulpfec_payload_type &&
36 red_payload_type == other.red_payload_type && 36 red_payload_type == other.red_payload_type &&
37 red_rtx_payload_type == other.red_rtx_payload_type; 37 red_rtx_payload_type == other.red_rtx_payload_type;
38 } 38 }
39 39
40 std::string RtpExtension::ToString() const { 40 std::string RtpExtension::ToString() const {
41 std::stringstream ss; 41 std::stringstream ss;
42 ss << "{uri: " << uri; 42 ss << "{uri: " << uri;
43 ss << ", id: " << id; 43 ss << ", id: " << id;
44 if (encrypted) {
45 ss << ", encrypted";
46 }
44 ss << '}'; 47 ss << '}';
45 return ss.str(); 48 return ss.str();
46 } 49 }
47 50
48 const char* RtpExtension::kAudioLevelUri = 51 const char* RtpExtension::kAudioLevelUri =
49 "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; 52 "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
50 const int RtpExtension::kAudioLevelDefaultId = 1; 53 const int RtpExtension::kAudioLevelDefaultId = 1;
51 54
52 const char* RtpExtension::kTimestampOffsetUri = 55 const char* RtpExtension::kTimestampOffsetUri =
53 "urn:ietf:params:rtp-hdrext:toffset"; 56 "urn:ietf:params:rtp-hdrext:toffset";
(...skipping 11 matching lines...) Expand all
65 const int RtpExtension::kTransportSequenceNumberDefaultId = 5; 68 const int RtpExtension::kTransportSequenceNumberDefaultId = 5;
66 69
67 // This extension allows applications to adaptively limit the playout delay 70 // This extension allows applications to adaptively limit the playout delay
68 // on frames as per the current needs. For example, a gaming application 71 // on frames as per the current needs. For example, a gaming application
69 // has very different needs on end-to-end delay compared to a video-conference 72 // has very different needs on end-to-end delay compared to a video-conference
70 // application. 73 // application.
71 const char* RtpExtension::kPlayoutDelayUri = 74 const char* RtpExtension::kPlayoutDelayUri =
72 "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay"; 75 "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay";
73 const int RtpExtension::kPlayoutDelayDefaultId = 6; 76 const int RtpExtension::kPlayoutDelayDefaultId = 6;
74 77
78 const char* RtpExtension::kEncryptHeaderExtensionsUri =
79 "urn:ietf:params:rtp-hdrext:encrypt";
80
75 const int RtpExtension::kMinId = 1; 81 const int RtpExtension::kMinId = 1;
76 const int RtpExtension::kMaxId = 14; 82 const int RtpExtension::kMaxId = 14;
77 83
78 bool RtpExtension::IsSupportedForAudio(const std::string& uri) { 84 bool RtpExtension::IsSupportedForAudio(const std::string& uri) {
79 return uri == webrtc::RtpExtension::kAudioLevelUri || 85 return uri == webrtc::RtpExtension::kAudioLevelUri ||
80 uri == webrtc::RtpExtension::kTransportSequenceNumberUri; 86 uri == webrtc::RtpExtension::kTransportSequenceNumberUri;
81 } 87 }
82 88
83 bool RtpExtension::IsSupportedForVideo(const std::string& uri) { 89 bool RtpExtension::IsSupportedForVideo(const std::string& uri) {
84 return uri == webrtc::RtpExtension::kTimestampOffsetUri || 90 return uri == webrtc::RtpExtension::kTimestampOffsetUri ||
85 uri == webrtc::RtpExtension::kAbsSendTimeUri || 91 uri == webrtc::RtpExtension::kAbsSendTimeUri ||
86 uri == webrtc::RtpExtension::kVideoRotationUri || 92 uri == webrtc::RtpExtension::kVideoRotationUri ||
87 uri == webrtc::RtpExtension::kTransportSequenceNumberUri || 93 uri == webrtc::RtpExtension::kTransportSequenceNumberUri ||
88 uri == webrtc::RtpExtension::kPlayoutDelayUri; 94 uri == webrtc::RtpExtension::kPlayoutDelayUri;
89 } 95 }
90 96
97 bool RtpExtension::AllowEncrypt(const std::string& uri) {
pthatcher1 2017/03/21 07:07:06 A more consistent name would be "IsEncryptionSuppo
joachim 2017/03/23 00:04:32 Done.
98 // TODO(jbauch): Figure out a way to add "kTimestampOffsetUri" here
99 // and filter out later if external auth is used in srtpfilter.
100 return uri == webrtc::RtpExtension::kAudioLevelUri ||
101 uri == webrtc::RtpExtension::kTimestampOffsetUri ||
102 uri == webrtc::RtpExtension::kVideoRotationUri ||
103 uri == webrtc::RtpExtension::kTransportSequenceNumberUri ||
104 uri == webrtc::RtpExtension::kPlayoutDelayUri;
105 }
106
91 VideoStream::VideoStream() 107 VideoStream::VideoStream()
92 : width(0), 108 : width(0),
93 height(0), 109 height(0),
94 max_framerate(-1), 110 max_framerate(-1),
95 min_bitrate_bps(-1), 111 min_bitrate_bps(-1),
96 target_bitrate_bps(-1), 112 target_bitrate_bps(-1),
97 max_bitrate_bps(-1), 113 max_bitrate_bps(-1),
98 max_qp(-1) {} 114 max_qp(-1) {}
99 115
100 VideoStream::~VideoStream() = default; 116 VideoStream::~VideoStream() = default;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( 218 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings(
203 const VideoCodecVP9& specifics) 219 const VideoCodecVP9& specifics)
204 : specifics_(specifics) {} 220 : specifics_(specifics) {}
205 221
206 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( 222 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9(
207 VideoCodecVP9* vp9_settings) const { 223 VideoCodecVP9* vp9_settings) const {
208 *vp9_settings = specifics_; 224 *vp9_settings = specifics_;
209 } 225 }
210 226
211 } // namespace webrtc 227 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698