libdvbv5  1.10.0
Library to work with Digital TV devices on Linux
header.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2012 - Mauro Carvalho Chehab
3  * Copyright (c) 2012 - Andre Roth <neolynx@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation version 2
8  * of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  *
20  * Described at ISO/IEC 13818-1
21  */
22 
23 #ifndef _HEADER_H
24 #define _HEADER_H
25 
26 #include <stdint.h>
27 #include <unistd.h> /* ssize_t */
28 
59  uint8_t sync_byte;
60  union {
61  uint16_t bitfield;
62  struct {
63  uint16_t pid:13;
64  uint16_t transport_priority:1;
67  } __attribute__((packed));
68  } __attribute__((packed));
69  uint8_t continuity_counter:4;
72 
73  /* Only if adaptation_field_control > 1 */
75 } __attribute__((packed));
76 
94  uint8_t table_id;
95  union {
96  uint16_t bitfield;
97  struct {
98  uint16_t section_length:12;
99  uint8_t one:2;
100  uint8_t zero:1;
101  uint8_t syntax:1;
102  } __attribute__((packed));
103  } __attribute__((packed));
104  uint16_t id; /* TS ID */
105  uint8_t current_next:1;
106  uint8_t version:5;
107  uint8_t one2:2;
108 
109  uint8_t section_id; /* section_number */
110  uint8_t last_section; /* last_section_number */
111 } __attribute__((packed));
112 
113 struct dvb_v5_fe_parms;
114 
115 #ifdef __cplusplus
116 extern "C" {
117 #endif
118 
125 void dvb_table_header_init (struct dvb_table_header *header);
133 void dvb_table_header_print(struct dvb_v5_fe_parms *parms,
134  const struct dvb_table_header *header);
135 
136 #ifdef __cplusplus
137 }
138 #endif
139 
140 #endif
Header of a MPEG-TS table.
Definition: header.h:93
void dvb_table_header_init(struct dvb_table_header *header)
Initializes and parses MPEG-TS table header.
uint8_t last_section
Definition: header.h:110
uint8_t version
Definition: header.h:106
uint8_t current_next
Definition: header.h:105
uint8_t continuity_counter
Definition: header.h:69
uint8_t sync_byte
Definition: header.h:59
uint16_t transport_priority
Definition: header.h:64
uint16_t transport_error_indicator
Definition: header.h:66
uint16_t bitfield
Definition: header.h:96
uint8_t table_id
Definition: header.h:94
uint8_t zero
Definition: header.h:100
uint16_t bitfield
Definition: header.h:61
uint8_t syntax
Definition: header.h:101
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:118
uint8_t section_id
Definition: header.h:109
Header of a MPEG-TS transport packet.
Definition: header.h:58
uint16_t payload_unit_start_indicator
Definition: header.h:65
uint8_t adaptation_field_control
Definition: header.h:70
uint8_t one
Definition: header.h:99
uint16_t section_length
Definition: header.h:98
uint8_t adaptation_field_length
Definition: header.h:74
uint16_t pid
Definition: header.h:63
uint16_t id
Definition: header.h:104
uint8_t transport_scrambling_control
Definition: header.h:71
uint8_t one2
Definition: header.h:107
void dvb_table_header_print(struct dvb_v5_fe_parms *parms, const struct dvb_table_header *header)
Prints the content of the MPEG-TS table header.