Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 (encrypt) { | |
| 45 ss << ", encrypt"; | |
| 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 Loading... | |
| 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::IsEncryptionSupported(const std::string& uri) { | |
| 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 | |
| 107 const RtpExtension* RtpExtension::FindHeaderExtensionByUri( | |
| 108 const std::vector<RtpExtension>& extensions, | |
| 109 const std::string& uri) { | |
| 110 for (const auto& extension : extensions) { | |
| 111 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
| |
| 112 return &extension; | |
| 113 } | |
| 114 return nullptr; | |
| 115 } | |
| 116 | |
| 91 VideoStream::VideoStream() | 117 VideoStream::VideoStream() |
| 92 : width(0), | 118 : width(0), |
| 93 height(0), | 119 height(0), |
| 94 max_framerate(-1), | 120 max_framerate(-1), |
| 95 min_bitrate_bps(-1), | 121 min_bitrate_bps(-1), |
| 96 target_bitrate_bps(-1), | 122 target_bitrate_bps(-1), |
| 97 max_bitrate_bps(-1), | 123 max_bitrate_bps(-1), |
| 98 max_qp(-1) {} | 124 max_qp(-1) {} |
| 99 | 125 |
| 100 VideoStream::~VideoStream() = default; | 126 VideoStream::~VideoStream() = default; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( | 228 VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( |
| 203 const VideoCodecVP9& specifics) | 229 const VideoCodecVP9& specifics) |
| 204 : specifics_(specifics) {} | 230 : specifics_(specifics) {} |
| 205 | 231 |
| 206 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( | 232 void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( |
| 207 VideoCodecVP9* vp9_settings) const { | 233 VideoCodecVP9* vp9_settings) const { |
| 208 *vp9_settings = specifics_; | 234 *vp9_settings = specifics_; |
| 209 } | 235 } |
| 210 | 236 |
| 211 } // namespace webrtc | 237 } // namespace webrtc |
| OLD | NEW |