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

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

Issue 2954503002: Implement FrameMarking header extension support
Patch Set: remove unneeded change in comment Created 3 years, 5 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 header->extension.videoRotation = kVideoRotation_0; 244 header->extension.videoRotation = kVideoRotation_0;
245 245
246 // May not be present in packet. 246 // May not be present in packet.
247 header->extension.playout_delay.min_ms = -1; 247 header->extension.playout_delay.min_ms = -1;
248 header->extension.playout_delay.max_ms = -1; 248 header->extension.playout_delay.max_ms = -1;
249 249
250 // May not be present in packet. 250 // May not be present in packet.
251 header->extension.hasVideoContentType = false; 251 header->extension.hasVideoContentType = false;
252 header->extension.videoContentType = VideoContentType::UNSPECIFIED; 252 header->extension.videoContentType = VideoContentType::UNSPECIFIED;
253 253
254 // May not be present in packet.
255 header->extension.hasFrameMarks = false;
254 header->extension.has_video_timing = false; 256 header->extension.has_video_timing = false;
255 header->extension.video_timing = {0u, 0u, 0u, 0u, 0u, 0u, false}; 257 header->extension.video_timing = {0u, 0u, 0u, 0u, 0u, 0u, false};
256 258
257 if (X) { 259 if (X) {
258 /* RTP header extension, RFC 3550. 260 /* RTP header extension, RFC 3550.
259 0 1 2 3 261 0 1 2 3
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 262 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
261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
262 | defined by profile | length | 264 | defined by profile | length |
263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 } 479 }
478 case kRtpExtensionRtpStreamId: { 480 case kRtpExtensionRtpStreamId: {
479 header->extension.stream_id.Set(rtc::MakeArrayView(ptr, len + 1)); 481 header->extension.stream_id.Set(rtc::MakeArrayView(ptr, len + 1));
480 break; 482 break;
481 } 483 }
482 case kRtpExtensionRepairedRtpStreamId: { 484 case kRtpExtensionRepairedRtpStreamId: {
483 header->extension.repaired_stream_id.Set( 485 header->extension.repaired_stream_id.Set(
484 rtc::MakeArrayView(ptr, len + 1)); 486 rtc::MakeArrayView(ptr, len + 1));
485 break; 487 break;
486 } 488 }
489 case kRtpExtensionFrameMarking: {
490 if (!FrameMarking::Parse(rtc::MakeArrayView(ptr, len + 1),
491 &header->extension.frame_marks)) {
492 LOG(LS_WARNING) << "Incorrect frame marking extension";
493 return;
494 }
495 header->extension.hasFrameMarks = true;
496 break;
497 }
487 case kRtpExtensionNone: 498 case kRtpExtensionNone:
488 case kRtpExtensionNumberOfExtensions: { 499 case kRtpExtensionNumberOfExtensions: {
489 RTC_NOTREACHED() << "Invalid extension type: " << type; 500 RTC_NOTREACHED() << "Invalid extension type: " << type;
490 return; 501 return;
491 } 502 }
492 } 503 }
493 } 504 }
494 ptr += (len + 1); 505 ptr += (len + 1);
495 } 506 }
496 } 507 }
497 508
498 } // namespace RtpUtility 509 } // namespace RtpUtility
499 } // namespace webrtc 510 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698