| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ | 10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ |
| 11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ | 11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ |
| 12 | 12 |
| 13 #include <stdint.h> | 13 #include <stdint.h> |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "webrtc/api/video/video_content_type.h" | 16 #include "webrtc/api/video/video_content_type.h" |
| 17 #include "webrtc/api/video/video_rotation.h" | 17 #include "webrtc/api/video/video_rotation.h" |
| 18 #include "webrtc/api/video/video_timing.h" |
| 18 #include "webrtc/base/array_view.h" | 19 #include "webrtc/base/array_view.h" |
| 19 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 20 | 21 |
| 21 namespace webrtc { | 22 namespace webrtc { |
| 22 | 23 |
| 23 class AbsoluteSendTime { | 24 class AbsoluteSendTime { |
| 24 public: | 25 public: |
| 25 static constexpr RTPExtensionType kId = kRtpExtensionAbsoluteSendTime; | 26 static constexpr RTPExtensionType kId = kRtpExtensionAbsoluteSendTime; |
| 26 static constexpr uint8_t kValueSizeBytes = 3; | 27 static constexpr uint8_t kValueSizeBytes = 3; |
| 27 static constexpr const char* kUri = | 28 static constexpr const char* kUri = |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type"; | 120 "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type"; |
| 120 | 121 |
| 121 static bool Parse(rtc::ArrayView<const uint8_t> data, | 122 static bool Parse(rtc::ArrayView<const uint8_t> data, |
| 122 VideoContentType* content_type); | 123 VideoContentType* content_type); |
| 123 static size_t ValueSize(VideoContentType) { | 124 static size_t ValueSize(VideoContentType) { |
| 124 return kValueSizeBytes; | 125 return kValueSizeBytes; |
| 125 } | 126 } |
| 126 static bool Write(uint8_t* data, VideoContentType content_type); | 127 static bool Write(uint8_t* data, VideoContentType content_type); |
| 127 }; | 128 }; |
| 128 | 129 |
| 130 class VideoTimingExtension { |
| 131 public: |
| 132 static constexpr RTPExtensionType kId = kRtpExtensionVideoTiming; |
| 133 static constexpr uint8_t kValueSizeBytes = 12; |
| 134 static constexpr const char* kUri = |
| 135 "http://www.webrtc.org/experiments/rtp-hdrext/video-timing"; |
| 136 |
| 137 static bool Parse(rtc::ArrayView<const uint8_t> data, VideoTiming* timing); |
| 138 static size_t ValueSize(const VideoTiming&) { return kValueSizeBytes; } |
| 139 static bool Write(uint8_t* data, const VideoTiming& timing); |
| 140 |
| 141 static size_t ValueSize(uint16_t time_delta_ms, uint8_t idx) { |
| 142 return kValueSizeBytes; |
| 143 } |
| 144 // Writes only single time delta to position idx. |
| 145 static bool Write(uint8_t* data, uint16_t time_delta_ms, uint8_t idx); |
| 146 }; |
| 147 |
| 129 class RtpStreamId { | 148 class RtpStreamId { |
| 130 public: | 149 public: |
| 131 static constexpr RTPExtensionType kId = kRtpExtensionRtpStreamId; | 150 static constexpr RTPExtensionType kId = kRtpExtensionRtpStreamId; |
| 132 static constexpr const char* kUri = | 151 static constexpr const char* kUri = |
| 133 "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"; | 152 "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"; |
| 134 | 153 |
| 135 static bool Parse(rtc::ArrayView<const uint8_t> data, StreamId* rsid); | 154 static bool Parse(rtc::ArrayView<const uint8_t> data, StreamId* rsid); |
| 136 static size_t ValueSize(const StreamId& rsid) { return rsid.size(); } | 155 static size_t ValueSize(const StreamId& rsid) { return rsid.size(); } |
| 137 static bool Write(uint8_t* data, const StreamId& rsid); | 156 static bool Write(uint8_t* data, const StreamId& rsid); |
| 138 | 157 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 151 static size_t ValueSize(const StreamId& rsid); | 170 static size_t ValueSize(const StreamId& rsid); |
| 152 static bool Write(uint8_t* data, const StreamId& rsid); | 171 static bool Write(uint8_t* data, const StreamId& rsid); |
| 153 | 172 |
| 154 static bool Parse(rtc::ArrayView<const uint8_t> data, std::string* rsid); | 173 static bool Parse(rtc::ArrayView<const uint8_t> data, std::string* rsid); |
| 155 static size_t ValueSize(const std::string& rsid); | 174 static size_t ValueSize(const std::string& rsid); |
| 156 static bool Write(uint8_t* data, const std::string& rsid); | 175 static bool Write(uint8_t* data, const std::string& rsid); |
| 157 }; | 176 }; |
| 158 | 177 |
| 159 } // namespace webrtc | 178 } // namespace webrtc |
| 160 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ | 179 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ |
| OLD | NEW |