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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Fix CE Created 3 years, 6 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) 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
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(VideoTiming) { return kValueSizeBytes; }
åsapersson 2017/06/12 14:33:41 const VideoTiming&
ilnik 2017/06/13 08:43:13 Done.
139 static size_t ValueSize(uint16_t delta_ms, uint8_t idx) {
åsapersson 2017/06/12 14:33:41 maybe move to line 143 above Write
åsapersson 2017/06/12 14:33:41 time_delta_ms
ilnik 2017/06/13 08:43:13 Done.
140 return kValueSizeBytes;
141 }
142 static bool Write(uint8_t* data, const VideoTiming& timing);
143 // Writes only single time delta to position idx.
144 static bool Write(uint8_t* data, uint16_t time_delta_ms, uint8_t idx);
145 };
146
129 class RtpStreamId { 147 class RtpStreamId {
130 public: 148 public:
131 static constexpr RTPExtensionType kId = kRtpExtensionRtpStreamId; 149 static constexpr RTPExtensionType kId = kRtpExtensionRtpStreamId;
132 static constexpr const char* kUri = 150 static constexpr const char* kUri =
133 "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"; 151 "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id";
134 152
135 static bool Parse(rtc::ArrayView<const uint8_t> data, StreamId* rsid); 153 static bool Parse(rtc::ArrayView<const uint8_t> data, StreamId* rsid);
136 static size_t ValueSize(const StreamId& rsid) { return rsid.size(); } 154 static size_t ValueSize(const StreamId& rsid) { return rsid.size(); }
137 static bool Write(uint8_t* data, const StreamId& rsid); 155 static bool Write(uint8_t* data, const StreamId& rsid);
138 156
(...skipping 12 matching lines...) Expand all
151 static size_t ValueSize(const StreamId& rsid); 169 static size_t ValueSize(const StreamId& rsid);
152 static bool Write(uint8_t* data, const StreamId& rsid); 170 static bool Write(uint8_t* data, const StreamId& rsid);
153 171
154 static bool Parse(rtc::ArrayView<const uint8_t> data, std::string* rsid); 172 static bool Parse(rtc::ArrayView<const uint8_t> data, std::string* rsid);
155 static size_t ValueSize(const std::string& rsid); 173 static size_t ValueSize(const std::string& rsid);
156 static bool Write(uint8_t* data, const std::string& rsid); 174 static bool Write(uint8_t* data, const std::string& rsid);
157 }; 175 };
158 176
159 } // namespace webrtc 177 } // namespace webrtc
160 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ 178 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698