ifm3d
nal_unit.h
1 /*
2  * Copyright 2026-present ifm electronic, gmbh
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #ifndef IFM3D_RTSP_NAL_UNIT_H
7 #define IFM3D_RTSP_NAL_UNIT_H
8 
9 #include <cstdint>
10 #include <vector>
11 
12 #include <ifm3d/rtsp/module_rtsp.h>
13 
14 namespace ifm3d
15 {
30  struct IFM3D_EXPORT NalUnit
31  {
33  enum Type : std::uint8_t
34  {
35  NON_IDR_SLICE = 1,
36  IDR_SLICE = 5,
37  SEI = 6,
38  SPS = 7,
39  PPS = 8,
40  ACCESS_UNIT_DELIMITER = 9,
41  };
42 
47  std::vector<std::uint8_t> data;
48 
50  std::uint8_t nal_ref_idc = 0;
51 
53  std::uint8_t nal_unit_type = 0;
54 
57  std::uint64_t pts_us = 0;
58 
60  bool is_idr = false;
61 
63  std::uint16_t first_sequence_number = 0;
64 
66  std::uint16_t last_sequence_number = 0;
67 
69  [[nodiscard]] std::size_t
70  Size() const
71  {
72  return data.size();
73  }
74  };
75 
76 } // namespace ifm3d
77 
78 #endif // IFM3D_RTSP_NAL_UNIT_H
A single, fully reassembled H.264 NAL unit.
Definition: nal_unit.h:31
Type
H.264 NAL unit type values (ITU-T H.264 Table 7-1, RFC 6184 ยง1.3).
Definition: nal_unit.h:34
std::vector< std::uint8_t > data
Raw NAL payload, NAL-header byte first, without an Annex-B start code and with emulation-prevention b...
Definition: nal_unit.h:47
std::size_t Size() const
Definition: nal_unit.h:70