Debian Codegraph @

src/demuxer/tsPacket.h

raw
1 /*
2 * Copyright (C) 2013-2021 Jean-Luc Barrière
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 * See LICENSE.md for more information.
6 */
7
8 #ifndef TSPACKET_H
9 #define TSPACKET_H
10
11 #include "tsTable.h"
12 #include "elementaryStream.h"
13
14 namespace TSDemux
15 {
16 enum PACKET_TYPE
17 {
18 PACKET_TYPE_UNKNOWN = 0,
19 PACKET_TYPE_PSI,
20 PACKET_TYPE_PES
21 };
22
23 class Packet
24 {
25 public:
26 Packet(void)
27 : pid(0xffff)
28 , continuity(0xff)
29 , packet_type(PACKET_TYPE_UNKNOWN)
30 , channel(0)
31 , wait_unit_start(true)
32 , has_stream_data(false)
33 , streaming(false)
34 , stream(NULL)
35 , packet_table()
36 {
37 }
38
39 ~Packet(void)
40 {
41 if (stream)
42 delete stream;
43 }
44
45 void Reset(void)
46 {
47 continuity = 0xff;
48 wait_unit_start = true;
49 packet_table.Reset();
50 if (stream)
51 stream->Reset();
52 }
53
54 uint16_t pid;
55 uint8_t continuity;
56 PACKET_TYPE packet_type;
57 uint16_t channel;
58 bool wait_unit_start;
59 bool has_stream_data;
60 bool streaming;
61 ElementaryStream* stream;
62 TSTable packet_table;
63 };
64 }
65
66 #endif /* TSPACKET_H */