OLD | NEW |
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 |
11 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
12 | 12 |
13 #include <string.h> | |
14 | |
15 #include "webrtc/base/logging.h" | 13 #include "webrtc/base/logging.h" |
16 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" | 14 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" |
17 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 15 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
18 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" | 16 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" |
19 | 17 |
20 namespace webrtc { | 18 namespace webrtc { |
21 | 19 |
22 RtpFeedback* NullObjectRtpFeedback() { | 20 RtpFeedback* NullObjectRtpFeedback() { |
23 static NullRtpFeedback null_rtp_feedback; | 21 static NullRtpFeedback null_rtp_feedback; |
24 return &null_rtp_feedback; | 22 return &null_rtp_feedback; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 header->extension.videoRotation = kVideoRotation_0; | 244 header->extension.videoRotation = kVideoRotation_0; |
247 | 245 |
248 // May not be present in packet. | 246 // May not be present in packet. |
249 header->extension.playout_delay.min_ms = -1; | 247 header->extension.playout_delay.min_ms = -1; |
250 header->extension.playout_delay.max_ms = -1; | 248 header->extension.playout_delay.max_ms = -1; |
251 | 249 |
252 // May not be present in packet. | 250 // May not be present in packet. |
253 header->extension.hasVideoContentType = false; | 251 header->extension.hasVideoContentType = false; |
254 header->extension.videoContentType = VideoContentType::UNSPECIFIED; | 252 header->extension.videoContentType = VideoContentType::UNSPECIFIED; |
255 | 253 |
| 254 header->extension.has_video_timing = false; |
| 255 header->extension.video_timing = {0u, 0u, 0u, 0u, 0u, 0u, false}; |
| 256 |
256 if (X) { | 257 if (X) { |
257 /* RTP header extension, RFC 3550. | 258 /* RTP header extension, RFC 3550. |
258 0 1 2 3 | 259 0 1 2 3 |
259 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 |
260 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
261 | defined by profile | length | | 262 | defined by profile | length | |
262 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
263 | header extension | | 264 | header extension | |
264 | .... | | 265 | .... | |
265 */ | 266 */ |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 458 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
458 | 459 |
459 if (ptr[0] < | 460 if (ptr[0] < |
460 static_cast<uint8_t>(VideoContentType::TOTAL_CONTENT_TYPES)) { | 461 static_cast<uint8_t>(VideoContentType::TOTAL_CONTENT_TYPES)) { |
461 header->extension.hasVideoContentType = true; | 462 header->extension.hasVideoContentType = true; |
462 header->extension.videoContentType = | 463 header->extension.videoContentType = |
463 static_cast<VideoContentType>(ptr[0]); | 464 static_cast<VideoContentType>(ptr[0]); |
464 } | 465 } |
465 break; | 466 break; |
466 } | 467 } |
| 468 case kRtpExtensionVideoTiming: { |
| 469 if (len != VideoTimingExtension::kValueSizeBytes - 1) { |
| 470 LOG(LS_WARNING) << "Incorrect video timing len: " << len; |
| 471 return; |
| 472 } |
| 473 header->extension.has_video_timing = true; |
| 474 VideoTimingExtension::Parse(rtc::MakeArrayView(ptr, len + 1), |
| 475 &header->extension.video_timing); |
| 476 break; |
| 477 } |
467 case kRtpExtensionRtpStreamId: { | 478 case kRtpExtensionRtpStreamId: { |
468 header->extension.stream_id.Set(rtc::MakeArrayView(ptr, len + 1)); | 479 header->extension.stream_id.Set(rtc::MakeArrayView(ptr, len + 1)); |
469 break; | 480 break; |
470 } | 481 } |
471 case kRtpExtensionRepairedRtpStreamId: { | 482 case kRtpExtensionRepairedRtpStreamId: { |
472 header->extension.repaired_stream_id.Set( | 483 header->extension.repaired_stream_id.Set( |
473 rtc::MakeArrayView(ptr, len + 1)); | 484 rtc::MakeArrayView(ptr, len + 1)); |
474 break; | 485 break; |
475 } | 486 } |
476 case kRtpExtensionNone: | 487 case kRtpExtensionNone: |
477 case kRtpExtensionNumberOfExtensions: { | 488 case kRtpExtensionNumberOfExtensions: { |
478 RTC_NOTREACHED() << "Invalid extension type: " << type; | 489 RTC_NOTREACHED() << "Invalid extension type: " << type; |
479 return; | 490 return; |
480 } | 491 } |
481 } | 492 } |
482 } | 493 } |
483 ptr += (len + 1); | 494 ptr += (len + 1); |
484 } | 495 } |
485 } | 496 } |
486 | 497 |
487 } // namespace RtpUtility | 498 } // namespace RtpUtility |
488 } // namespace webrtc | 499 } // namespace webrtc |
OLD | NEW |