philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | #ifndef MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_ |
| 11 | #define MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_ |
| 12 | |
Yves Gerey | 988cc08 | 2018-10-23 12:03:01 +0200 | [diff] [blame] | 13 | #include <cstdint> |
| 14 | |
philipel | f8d81d3 | 2018-08-01 17:13:08 +0200 | [diff] [blame] | 15 | #include "absl/container/inlined_vector.h" |
Yves Gerey | 988cc08 | 2018-10-23 12:03:01 +0200 | [diff] [blame] | 16 | #include "absl/types/optional.h" |
philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 17 | #include "absl/types/variant.h" |
Johannes Kron | d0b69a8 | 2018-12-03 14:18:53 +0100 | [diff] [blame] | 18 | #include "api/video/color_space.h" |
Niels Möller | 22b70ff | 2018-11-20 11:06:58 +0100 | [diff] [blame] | 19 | #include "api/video/video_codec_type.h" |
philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 20 | #include "api/video/video_content_type.h" |
Johnny Lee | e0c8b23 | 2018-09-11 16:50:49 -0400 | [diff] [blame] | 21 | #include "api/video/video_frame_marking.h" |
philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 22 | #include "api/video/video_rotation.h" |
| 23 | #include "api/video/video_timing.h" |
| 24 | #include "common_types.h" // NOLINT(build/include) |
| 25 | #include "modules/video_coding/codecs/h264/include/h264_globals.h" |
| 26 | #include "modules/video_coding/codecs/vp8/include/vp8_globals.h" |
| 27 | #include "modules/video_coding/codecs/vp9/include/vp9_globals.h" |
| 28 | |
| 29 | namespace webrtc { |
Philip Eliasson | d52a1a6 | 2018-09-07 13:03:55 +0000 | [diff] [blame] | 30 | using RTPVideoTypeHeader = absl::variant<absl::monostate, |
| 31 | RTPVideoHeaderVP8, |
| 32 | RTPVideoHeaderVP9, |
| 33 | RTPVideoHeaderH264>; |
philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 34 | |
| 35 | struct RTPVideoHeader { |
philipel | bf2b620 | 2018-08-27 14:33:18 +0200 | [diff] [blame] | 36 | struct GenericDescriptorInfo { |
| 37 | GenericDescriptorInfo(); |
| 38 | GenericDescriptorInfo(const GenericDescriptorInfo& other); |
| 39 | ~GenericDescriptorInfo(); |
| 40 | |
| 41 | int64_t frame_id = 0; |
| 42 | int spatial_index = 0; |
| 43 | int temporal_index = 0; |
| 44 | absl::InlinedVector<int64_t, 5> dependencies; |
| 45 | absl::InlinedVector<int, 5> higher_spatial_layers; |
| 46 | }; |
| 47 | |
philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 48 | RTPVideoHeader(); |
| 49 | RTPVideoHeader(const RTPVideoHeader& other); |
| 50 | |
philipel | f8d81d3 | 2018-08-01 17:13:08 +0200 | [diff] [blame] | 51 | ~RTPVideoHeader(); |
| 52 | |
philipel | bf2b620 | 2018-08-27 14:33:18 +0200 | [diff] [blame] | 53 | absl::optional<GenericDescriptorInfo> generic; |
philipel | f8d81d3 | 2018-08-01 17:13:08 +0200 | [diff] [blame] | 54 | |
| 55 | uint16_t width = 0; |
| 56 | uint16_t height = 0; |
| 57 | VideoRotation rotation = VideoRotation::kVideoRotation_0; |
| 58 | VideoContentType content_type = VideoContentType::UNSPECIFIED; |
| 59 | bool is_first_packet_in_frame = false; |
philipel | ef615ea | 2018-09-13 11:07:48 +0200 | [diff] [blame] | 60 | bool is_last_packet_in_frame = false; |
philipel | f8d81d3 | 2018-08-01 17:13:08 +0200 | [diff] [blame] | 61 | uint8_t simulcastIdx = 0; |
Kári Tristan Helgason | 55e7785 | 2018-08-27 15:04:07 +0200 | [diff] [blame] | 62 | VideoCodecType codec = VideoCodecType::kVideoCodecGeneric; |
philipel | f8d81d3 | 2018-08-01 17:13:08 +0200 | [diff] [blame] | 63 | |
Niels Möller | a32d7e2 | 2018-11-16 12:35:26 +0100 | [diff] [blame] | 64 | PlayoutDelay playout_delay = {-1, -1}; |
philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 65 | VideoSendTiming video_timing; |
Johnny Lee | 1a1c52b | 2019-02-08 14:25:40 -0500 | [diff] [blame^] | 66 | FrameMarking frame_marking = {false, false, false, false, false, 0xFF, 0, 0}; |
Johannes Kron | d0b69a8 | 2018-12-03 14:18:53 +0100 | [diff] [blame] | 67 | absl::optional<ColorSpace> color_space; |
Philip Eliasson | d52a1a6 | 2018-09-07 13:03:55 +0000 | [diff] [blame] | 68 | RTPVideoTypeHeader video_type_header; |
philipel | 1a4746a | 2018-07-09 15:52:29 +0200 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | } // namespace webrtc |
| 72 | |
| 73 | #endif // MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_ |