libclosedcaption 1.0.3
ISDB-Tb/SBTVD (Brazilian DTV) closed caption extraction from MPEG-TS
Loading...
Searching...
No Matches
packet-pes.h
Go to the documentation of this file.
1
18#ifndef PACKET_PES_H_
19#define PACKET_PES_H_
20
21#include "caption-common.h"
22
23#define PACKET_PES_PREFIX 0x000001
24#define PACKET_PES_PRIVATE_STREAM 0xbd
30#define PTS_is_NONE 0x00
31#define PTS_is_FORBIDEN 0x01
32#define PTS_is_ONLY_PTS 0x02
33#define PTS_is_BOTH 0x03
39typedef struct {
40 uint8_t h;
41 uint8_t m;
42 uint8_t s;
43 uint16_t u;
44 uint32_t ts;
45} PES_pts_t;
46
48typedef struct PacketPES_s PacketPES_t;
49
54 uint8_t stream_id;
55 uint16_t pack_len;
58 struct header {
59 uint8_t len;
62 union flags {
63 uint16_t raw;
71 struct {
72 // byte[7]
73 uint8_t PES_extension_flag : 1;
74 uint8_t PES_CRC_flag : 1;
75 uint8_t copy_info_flag : 1;
76 uint8_t DSM_trick_mode_flag : 1;
77 uint8_t ES_rate_flag : 1;
78 uint8_t ESCR_flag : 1;
79 uint8_t PTS_DTS_flag : 2;
81 // byte [6]
82 uint8_t rights : 1;
83 uint8_t copyright : 1;
84 uint8_t alignment : 1;
85 uint8_t priority : 1;
86 uint8_t scrambling : 2;
87 uint8_t emulation : 2;
88 } bit;
89 } flags;
91 } header;
96 struct payload {
97 uint32_t header;
98 const uint8_t *data;
99 uint16_t len;
100 } payload;
103};
104
114bool
115packet_pes_load (const uint8_t *pack_raw,
116 const size_t raw_len,
117 PacketPES_t *out);
118
125void
126packet_pes_set_pts (uint32_t *ts,
127 PES_pts_t *pts);
128
129#endif /* PACKET_PES_H_ */
Standard headers and helper macros used all over the library.
bool packet_pes_load(const uint8_t *pack_raw, const size_t raw_len, PacketPES_t *out)
void packet_pes_set_pts(uint32_t *ts, PES_pts_t *pts)
uint32_t ts
Definition packet-pes.h:44
uint8_t s
Definition packet-pes.h:42
uint8_t h
Definition packet-pes.h:40
uint8_t m
Definition packet-pes.h:41
uint16_t u
Definition packet-pes.h:43
const uint8_t * data
Definition packet-pes.h:98
PES_pts_t pts
Definition packet-pes.h:93
uint8_t stream_id
Definition packet-pes.h:54
PacketPES_t * next
Definition packet-pes.h:102
uint16_t pack_len
Definition packet-pes.h:55
struct PacketPES_s::header::flags::@0 bit