blob: 78f8c4b2d19872a55ece0d46f56826d25e78eac5 [file] [log] [blame]
philipel1a4746a2018-07-09 15:52:29 +02001/*
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 Gerey988cc082018-10-23 12:03:01 +020013#include <cstdint>
14
philipelf8d81d32018-08-01 17:13:08 +020015#include "absl/container/inlined_vector.h"
Yves Gerey988cc082018-10-23 12:03:01 +020016#include "absl/types/optional.h"
philipel1a4746a2018-07-09 15:52:29 +020017#include "absl/types/variant.h"
Johannes Krond0b69a82018-12-03 14:18:53 +010018#include "api/video/color_space.h"
Niels Möller22b70ff2018-11-20 11:06:58 +010019#include "api/video/video_codec_type.h"
philipel1a4746a2018-07-09 15:52:29 +020020#include "api/video/video_content_type.h"
Johnny Leee0c8b232018-09-11 16:50:49 -040021#include "api/video/video_frame_marking.h"
Niels Möllerabbc50e2019-04-24 09:41:16 +020022#include "api/video/video_frame_type.h"
philipel1a4746a2018-07-09 15:52:29 +020023#include "api/video/video_rotation.h"
24#include "api/video/video_timing.h"
25#include "common_types.h" // NOLINT(build/include)
26#include "modules/video_coding/codecs/h264/include/h264_globals.h"
27#include "modules/video_coding/codecs/vp8/include/vp8_globals.h"
28#include "modules/video_coding/codecs/vp9/include/vp9_globals.h"
29
30namespace webrtc {
Philip Eliassond52a1a62018-09-07 13:03:55 +000031using RTPVideoTypeHeader = absl::variant<absl::monostate,
32 RTPVideoHeaderVP8,
33 RTPVideoHeaderVP9,
34 RTPVideoHeaderH264>;
philipel1a4746a2018-07-09 15:52:29 +020035
36struct RTPVideoHeader {
philipelbf2b6202018-08-27 14:33:18 +020037 struct GenericDescriptorInfo {
38 GenericDescriptorInfo();
39 GenericDescriptorInfo(const GenericDescriptorInfo& other);
40 ~GenericDescriptorInfo();
41
42 int64_t frame_id = 0;
43 int spatial_index = 0;
44 int temporal_index = 0;
45 absl::InlinedVector<int64_t, 5> dependencies;
46 absl::InlinedVector<int, 5> higher_spatial_layers;
Elad Alonccb9b752019-02-19 13:01:31 +010047 bool discardable = false;
philipelbf2b6202018-08-27 14:33:18 +020048 };
49
philipel1a4746a2018-07-09 15:52:29 +020050 RTPVideoHeader();
51 RTPVideoHeader(const RTPVideoHeader& other);
52
philipelf8d81d32018-08-01 17:13:08 +020053 ~RTPVideoHeader();
54
philipelbf2b6202018-08-27 14:33:18 +020055 absl::optional<GenericDescriptorInfo> generic;
philipelf8d81d32018-08-01 17:13:08 +020056
Niels Möllerabbc50e2019-04-24 09:41:16 +020057 VideoFrameType frame_type = VideoFrameType::kEmptyFrame;
philipelf8d81d32018-08-01 17:13:08 +020058 uint16_t width = 0;
59 uint16_t height = 0;
60 VideoRotation rotation = VideoRotation::kVideoRotation_0;
61 VideoContentType content_type = VideoContentType::UNSPECIFIED;
62 bool is_first_packet_in_frame = false;
philipelef615ea2018-09-13 11:07:48 +020063 bool is_last_packet_in_frame = false;
philipelf8d81d32018-08-01 17:13:08 +020064 uint8_t simulcastIdx = 0;
Kári Tristan Helgason55e77852018-08-27 15:04:07 +020065 VideoCodecType codec = VideoCodecType::kVideoCodecGeneric;
philipelf8d81d32018-08-01 17:13:08 +020066
Niels Möllera32d7e22018-11-16 12:35:26 +010067 PlayoutDelay playout_delay = {-1, -1};
philipel1a4746a2018-07-09 15:52:29 +020068 VideoSendTiming video_timing;
Johnny Lee1a1c52b2019-02-08 14:25:40 -050069 FrameMarking frame_marking = {false, false, false, false, false, 0xFF, 0, 0};
Johannes Krond0b69a82018-12-03 14:18:53 +010070 absl::optional<ColorSpace> color_space;
Philip Eliassond52a1a62018-09-07 13:03:55 +000071 RTPVideoTypeHeader video_type_header;
philipel1a4746a2018-07-09 15:52:29 +020072};
73
74} // namespace webrtc
75
76#endif // MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_