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

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

Issue 1739273002: [Draft] RtpPacket sketched. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase to use landed version of rtp::Packet Created 4 years, 8 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 10
(...skipping 13 matching lines...) Expand all
24 // containing the sender's current time in seconds as a fixed point number 24 // containing the sender's current time in seconds as a fixed point number
25 // with 18 bits fractional part. 25 // with 18 bits fractional part.
26 // 26 //
27 // The form of the absolute send time extension block: 27 // The form of the absolute send time extension block:
28 // 28 //
29 // 0 1 2 3 29 // 0 1 2 3
30 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 30 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
31 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 31 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
32 // | ID | len=2 | absolute send time | 32 // | ID | len=2 | absolute send time |
33 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 33 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 const char* AbsoluteSendTime::kName = 34 const char* AbsoluteSendTime::kId =
35 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"; 35 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
36 bool AbsoluteSendTime::IsSupportedFor(MediaType type) { 36 bool AbsoluteSendTime::IsSupportedFor(MediaType type) {
37 return true; 37 return true;
38 } 38 }
39 39
40 bool AbsoluteSendTime::Parse(const uint8_t* data, uint32_t* value) { 40 bool AbsoluteSendTime::Parse(const uint8_t* data, uint32_t* value) {
41 *value = ByteReader<uint32_t, 3>::ReadBigEndian(data); 41 *value = ByteReader<uint32_t, 3>::ReadBigEndian(data);
42 return true; 42 return true;
43 } 43 }
44 44
(...skipping 12 matching lines...) Expand all
57 // https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/ 57 // https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/
58 // 58 //
59 // The form of the audio level extension block: 59 // The form of the audio level extension block:
60 // 60 //
61 // 0 1 61 // 0 1
62 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 62 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
63 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 63 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
64 // | ID | len=0 |V| level | 64 // | ID | len=0 |V| level |
65 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 65 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
66 // 66 //
67 const char* AudioLevel::kName = "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; 67 const char* AudioLevel::kId = "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
68 bool AudioLevel::IsSupportedFor(MediaType type) { 68 bool AudioLevel::IsSupportedFor(MediaType type) {
69 switch (type) { 69 switch (type) {
70 case MediaType::ANY: 70 case MediaType::ANY:
71 case MediaType::AUDIO: 71 case MediaType::AUDIO:
72 return true; 72 return true;
73 case MediaType::VIDEO: 73 case MediaType::VIDEO:
74 case MediaType::DATA: 74 case MediaType::DATA:
75 return false; 75 return false;
76 } 76 }
77 RTC_NOTREACHED(); 77 RTC_NOTREACHED();
(...skipping 25 matching lines...) Expand all
103 // "effective" RTP transmission time of the packet, on the RTP 103 // "effective" RTP transmission time of the packet, on the RTP
104 // timescale. 104 // timescale.
105 // 105 //
106 // The form of the transmission offset extension block: 106 // The form of the transmission offset extension block:
107 // 107 //
108 // 0 1 2 3 108 // 0 1 2 3
109 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 109 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
110 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 110 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
111 // | ID | len=2 | transmission offset | 111 // | ID | len=2 | transmission offset |
112 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 112 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
113 const char* TransmissionOffset::kName = "urn:ietf:params:rtp-hdrext:toffset"; 113 const char* TransmissionOffset::kId = "urn:ietf:params:rtp-hdrext:toffset";
114 bool TransmissionOffset::IsSupportedFor(MediaType type) { 114 bool TransmissionOffset::IsSupportedFor(MediaType type) {
115 switch (type) { 115 switch (type) {
116 case MediaType::ANY: 116 case MediaType::ANY:
117 case MediaType::VIDEO: 117 case MediaType::VIDEO:
118 return true; 118 return true;
119 case MediaType::AUDIO: 119 case MediaType::AUDIO:
120 case MediaType::DATA: 120 case MediaType::DATA:
121 return false; 121 return false;
122 } 122 }
123 RTC_NOTREACHED(); 123 RTC_NOTREACHED();
124 return false; 124 return false;
125 } 125 }
126 126
127 bool TransmissionOffset::Parse(const uint8_t* data, int32_t* value) { 127 bool TransmissionOffset::Parse(const uint8_t* data, int32_t* value) {
128 *value = ByteReader<int32_t, 3>::ReadBigEndian(data); 128 *value = ByteReader<int32_t, 3>::ReadBigEndian(data);
129 return true; 129 return true;
130 } 130 }
131 131
132 bool TransmissionOffset::Write(uint8_t* data, int64_t value) { 132 bool TransmissionOffset::Write(uint8_t* data, int64_t value) {
133 RTC_CHECK_LE(value, 0x00ffffff); 133 RTC_CHECK_LE(value, 0x00ffffff);
134 ByteWriter<int32_t, 3>::WriteBigEndian(data, value); 134 ByteWriter<int32_t, 3>::WriteBigEndian(data, value);
135 return true; 135 return true;
136 } 136 }
137 137
138 // 0 1 2 138 // 0 1 2
139 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 139 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
140 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 140 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
141 // | ID | L=1 |transport wide sequence number | 141 // | ID | L=1 |transport wide sequence number |
142 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 142 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
143 const char* TransportSequenceNumber::kName = 143 const char* TransportSequenceNumber::kId =
144 "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions"; 144 "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions";
145 bool TransportSequenceNumber::IsSupportedFor(MediaType type) { 145 bool TransportSequenceNumber::IsSupportedFor(MediaType type) {
146 return true; 146 return true;
147 } 147 }
148 148
149 bool TransportSequenceNumber::Parse(const uint8_t* data, uint16_t* value) { 149 bool TransportSequenceNumber::Parse(const uint8_t* data, uint16_t* value) {
150 *value = ByteReader<uint16_t>::ReadBigEndian(data); 150 *value = ByteReader<uint16_t>::ReadBigEndian(data);
151 return true; 151 return true;
152 } 152 }
153 153
154 bool TransportSequenceNumber::Write(uint8_t* data, uint16_t value) { 154 bool TransportSequenceNumber::Write(uint8_t* data, uint16_t value) {
155 ByteWriter<uint16_t>::WriteBigEndian(data, value); 155 ByteWriter<uint16_t>::WriteBigEndian(data, value);
156 return true; 156 return true;
157 } 157 }
158 158
159 // Coordination of Video Orientation in RTP streams. 159 // Coordination of Video Orientation in RTP streams.
160 // 160 //
161 // Coordination of Video Orientation consists in signaling of the current 161 // Coordination of Video Orientation consists in signaling of the current
162 // orientation of the image captured on the sender side to the receiver for 162 // orientation of the image captured on the sender side to the receiver for
163 // appropriate rendering and displaying. 163 // appropriate rendering and displaying.
164 // 164 //
165 // 0 1 165 // 0 1
166 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 166 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
167 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 167 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
168 // | ID | len=0 |0 0 0 0 C F R R| 168 // | ID | len=0 |0 0 0 0 C F R R|
169 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 169 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
170 const char* VideoOrientation::kName = "urn:3gpp:video-orientation"; 170 const char* VideoOrientation::kId = "urn:3gpp:video-orientation";
171 bool VideoOrientation::IsSupportedFor(MediaType type) { 171 bool VideoOrientation::IsSupportedFor(MediaType type) {
172 switch (type) { 172 switch (type) {
173 case MediaType::ANY: 173 case MediaType::ANY:
174 case MediaType::VIDEO: 174 case MediaType::VIDEO:
175 return true; 175 return true;
176 case MediaType::AUDIO: 176 case MediaType::AUDIO:
177 case MediaType::DATA: 177 case MediaType::DATA:
178 return false; 178 return false;
179 } 179 }
180 RTC_NOTREACHED(); 180 RTC_NOTREACHED();
(...skipping 13 matching lines...) Expand all
194 bool VideoOrientation::Parse(const uint8_t* data, uint8_t* value) { 194 bool VideoOrientation::Parse(const uint8_t* data, uint8_t* value) {
195 *value = data[0]; 195 *value = data[0];
196 return true; 196 return true;
197 } 197 }
198 198
199 bool VideoOrientation::Write(uint8_t* data, uint8_t value) { 199 bool VideoOrientation::Write(uint8_t* data, uint8_t value) {
200 data[0] = value; 200 data[0] = value;
201 return true; 201 return true;
202 } 202 }
203 } // namespace webrtc 203 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_header_extensions_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698