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

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

Issue 2816463002: Revert of Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 header->extension.audioLevel = 0; 247 header->extension.audioLevel = 0;
248 248
249 // May not be present in packet. 249 // May not be present in packet.
250 header->extension.hasVideoRotation = false; 250 header->extension.hasVideoRotation = false;
251 header->extension.videoRotation = kVideoRotation_0; 251 header->extension.videoRotation = kVideoRotation_0;
252 252
253 // May not be present in packet. 253 // May not be present in packet.
254 header->extension.playout_delay.min_ms = -1; 254 header->extension.playout_delay.min_ms = -1;
255 header->extension.playout_delay.max_ms = -1; 255 header->extension.playout_delay.max_ms = -1;
256 256
257 // May not be present in packet.
258 header->extension.hasVideoContentType = false;
259 header->extension.videoContentType = VideoContentType::UNSPECIFIED;
260
261 if (X) { 257 if (X) {
262 /* RTP header extension, RFC 3550. 258 /* RTP header extension, RFC 3550.
263 0 1 2 3 259 0 1 2 3
264 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 260 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
265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
266 | defined by profile | length | 262 | defined by profile | length |
267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
268 | header extension | 264 | header extension |
269 | .... | 265 | .... |
270 */ 266 */
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 439 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
444 440
445 int min_playout_delay = (ptr[0] << 4) | ((ptr[1] >> 4) & 0xf); 441 int min_playout_delay = (ptr[0] << 4) | ((ptr[1] >> 4) & 0xf);
446 int max_playout_delay = ((ptr[1] & 0xf) << 8) | ptr[2]; 442 int max_playout_delay = ((ptr[1] & 0xf) << 8) | ptr[2];
447 header->extension.playout_delay.min_ms = 443 header->extension.playout_delay.min_ms =
448 min_playout_delay * PlayoutDelayLimits::kGranularityMs; 444 min_playout_delay * PlayoutDelayLimits::kGranularityMs;
449 header->extension.playout_delay.max_ms = 445 header->extension.playout_delay.max_ms =
450 max_playout_delay * PlayoutDelayLimits::kGranularityMs; 446 max_playout_delay * PlayoutDelayLimits::kGranularityMs;
451 break; 447 break;
452 } 448 }
453 case kRtpExtensionVideoContentType: {
454 if (len != 0) {
455 LOG(LS_WARNING) << "Incorrect video content type len: " << len;
456 return;
457 }
458 // 0 1
459 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
460 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
461 // | ID | len=0 | Content type |
462 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
463
464 if (ptr[0] <
465 static_cast<uint8_t>(VideoContentType::TOTAL_CONTENT_TYPES)) {
466 header->extension.hasVideoContentType = true;
467 header->extension.videoContentType =
468 static_cast<VideoContentType>(ptr[0]);
469 }
470 break;
471 }
472 case kRtpExtensionNone: 449 case kRtpExtensionNone:
473 case kRtpExtensionNumberOfExtensions: { 450 case kRtpExtensionNumberOfExtensions: {
474 RTC_NOTREACHED() << "Invalid extension type: " << type; 451 RTC_NOTREACHED() << "Invalid extension type: " << type;
475 return; 452 return;
476 } 453 }
477 } 454 }
478 } 455 }
479 ptr += (len + 1); 456 ptr += (len + 1);
480 } 457 }
481 } 458 }
482 459
483 } // namespace RtpUtility 460 } // namespace RtpUtility
484 } // namespace webrtc 461 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc ('k') | webrtc/modules/video_capture/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698