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

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

Issue 2954503002: Implement FrameMarking header extension support
Patch Set: fix fuzzer Created 3 years, 3 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 header->extension.playout_delay.min_ms = -1; 242 header->extension.playout_delay.min_ms = -1;
243 header->extension.playout_delay.max_ms = -1; 243 header->extension.playout_delay.max_ms = -1;
244 244
245 // May not be present in packet. 245 // May not be present in packet.
246 header->extension.hasVideoContentType = false; 246 header->extension.hasVideoContentType = false;
247 header->extension.videoContentType = VideoContentType::UNSPECIFIED; 247 header->extension.videoContentType = VideoContentType::UNSPECIFIED;
248 248
249 header->extension.has_video_timing = false; 249 header->extension.has_video_timing = false;
250 header->extension.video_timing = {0u, 0u, 0u, 0u, 0u, 0u, false}; 250 header->extension.video_timing = {0u, 0u, 0u, 0u, 0u, 0u, false};
251 251
252 // May not be present in packet.
253 header->extension.has_frame_marks = false;
254
252 if (X) { 255 if (X) {
253 /* RTP header extension, RFC 3550. 256 /* RTP header extension, RFC 3550.
254 0 1 2 3 257 0 1 2 3
255 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 258 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
256 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
257 | defined by profile | length | 260 | defined by profile | length |
258 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
259 | header extension | 262 | header extension |
260 | .... | 263 | .... |
261 */ 264 */
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 479 }
477 case kRtpExtensionRepairedRtpStreamId: { 480 case kRtpExtensionRepairedRtpStreamId: {
478 header->extension.repaired_stream_id.Set( 481 header->extension.repaired_stream_id.Set(
479 rtc::MakeArrayView(ptr, len + 1)); 482 rtc::MakeArrayView(ptr, len + 1));
480 break; 483 break;
481 } 484 }
482 case kRtpExtensionMid: { 485 case kRtpExtensionMid: {
483 header->extension.mid.Set(rtc::MakeArrayView(ptr, len + 1)); 486 header->extension.mid.Set(rtc::MakeArrayView(ptr, len + 1));
484 break; 487 break;
485 } 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.has_frame_marks = true;
496 break;
497 }
486 case kRtpExtensionNone: 498 case kRtpExtensionNone:
487 case kRtpExtensionNumberOfExtensions: { 499 case kRtpExtensionNumberOfExtensions: {
488 RTC_NOTREACHED() << "Invalid extension type: " << type; 500 RTC_NOTREACHED() << "Invalid extension type: " << type;
489 return; 501 return;
490 } 502 }
491 } 503 }
492 } 504 }
493 ptr += (len + 1); 505 ptr += (len + 1);
494 } 506 }
495 } 507 }
496 508
497 } // namespace RtpUtility 509 } // namespace RtpUtility
498 } // namespace webrtc 510 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc ('k') | webrtc/test/fuzzers/rtp_packet_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698