blob: 68b48847a21db304d572f5bf47fb734f6ef7c293 [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
philipelf8d81d32018-08-01 17:13:08 +020013#include "absl/container/inlined_vector.h"
philipel1a4746a2018-07-09 15:52:29 +020014#include "absl/types/variant.h"
15#include "api/video/video_content_type.h"
Johnny Leee0c8b232018-09-11 16:50:49 -040016#include "api/video/video_frame_marking.h"
philipel1a4746a2018-07-09 15:52:29 +020017#include "api/video/video_rotation.h"
18#include "api/video/video_timing.h"
19#include "common_types.h" // NOLINT(build/include)
20#include "modules/video_coding/codecs/h264/include/h264_globals.h"
21#include "modules/video_coding/codecs/vp8/include/vp8_globals.h"
22#include "modules/video_coding/codecs/vp9/include/vp9_globals.h"
23
24namespace webrtc {
Philip Eliassond52a1a62018-09-07 13:03:55 +000025using RTPVideoTypeHeader = absl::variant<absl::monostate,
26 RTPVideoHeaderVP8,
27 RTPVideoHeaderVP9,
28 RTPVideoHeaderH264>;
philipel1a4746a2018-07-09 15:52:29 +020029
30struct RTPVideoHeader {
philipelbf2b6202018-08-27 14:33:18 +020031 struct GenericDescriptorInfo {
32 GenericDescriptorInfo();
33 GenericDescriptorInfo(const GenericDescriptorInfo& other);
34 ~GenericDescriptorInfo();
35
36 int64_t frame_id = 0;
37 int spatial_index = 0;
38 int temporal_index = 0;
39 absl::InlinedVector<int64_t, 5> dependencies;
40 absl::InlinedVector<int, 5> higher_spatial_layers;
41 };
42
philipel1a4746a2018-07-09 15:52:29 +020043 RTPVideoHeader();
44 RTPVideoHeader(const RTPVideoHeader& other);
45
philipelf8d81d32018-08-01 17:13:08 +020046 ~RTPVideoHeader();
47
philipelbf2b6202018-08-27 14:33:18 +020048 absl::optional<GenericDescriptorInfo> generic;
philipelf8d81d32018-08-01 17:13:08 +020049
50 uint16_t width = 0;
51 uint16_t height = 0;
52 VideoRotation rotation = VideoRotation::kVideoRotation_0;
53 VideoContentType content_type = VideoContentType::UNSPECIFIED;
54 bool is_first_packet_in_frame = false;
55 uint8_t simulcastIdx = 0;
Kári Tristan Helgason55e77852018-08-27 15:04:07 +020056 VideoCodecType codec = VideoCodecType::kVideoCodecGeneric;
philipelf8d81d32018-08-01 17:13:08 +020057
philipel1a4746a2018-07-09 15:52:29 +020058 PlayoutDelay playout_delay;
philipel1a4746a2018-07-09 15:52:29 +020059 VideoSendTiming video_timing;
Johnny Leee0c8b232018-09-11 16:50:49 -040060 FrameMarking frame_marking;
Philip Eliassond52a1a62018-09-07 13:03:55 +000061 RTPVideoTypeHeader video_type_header;
philipel1a4746a2018-07-09 15:52:29 +020062};
63
64} // namespace webrtc
65
66#endif // MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_HEADER_H_