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

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

Issue 2772033002: Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Fix usage of uninitialized data Created 3 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 RTC_DCHECK_LE(0, playout_delay.min_ms); 189 RTC_DCHECK_LE(0, playout_delay.min_ms);
190 RTC_DCHECK_LE(playout_delay.min_ms, playout_delay.max_ms); 190 RTC_DCHECK_LE(playout_delay.min_ms, playout_delay.max_ms);
191 RTC_DCHECK_LE(playout_delay.max_ms, kMaxMs); 191 RTC_DCHECK_LE(playout_delay.max_ms, kMaxMs);
192 // Convert MS to value to be sent on extension header. 192 // Convert MS to value to be sent on extension header.
193 uint32_t min_delay = playout_delay.min_ms / kGranularityMs; 193 uint32_t min_delay = playout_delay.min_ms / kGranularityMs;
194 uint32_t max_delay = playout_delay.max_ms / kGranularityMs; 194 uint32_t max_delay = playout_delay.max_ms / kGranularityMs;
195 ByteWriter<uint32_t, 3>::WriteBigEndian(data, (min_delay << 12) | max_delay); 195 ByteWriter<uint32_t, 3>::WriteBigEndian(data, (min_delay << 12) | max_delay);
196 return true; 196 return true;
197 } 197 }
198 198
199 // Video Content Type.
200 //
201 // E.g. default video or screenshare.
202 //
203 // 0 1
204 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
205 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
206 // | ID | len=0 | Content type |
207 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
208 constexpr RTPExtensionType VideoContentTypeExtension::kId;
209 constexpr uint8_t VideoContentTypeExtension::kValueSizeBytes;
210 constexpr const char* VideoContentTypeExtension::kUri;
211
212 bool VideoContentTypeExtension::Parse(const uint8_t* data,
213 VideoContentType* content_type) {
214 *content_type = static_cast<VideoContentType>(data[0]);
nisse-webrtc 2017/04/06 09:23:22 Maybe return false if the value on the wire is inv
ilnik 2017/04/06 10:04:49 Done.
215 return true;
216 }
217
218 bool VideoContentTypeExtension::Write(uint8_t* data,
219 VideoContentType content_type) {
220 data[0] = static_cast<uint8_t>(content_type);
221 return true;
222 }
223
199 } // namespace webrtc 224 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698