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