libdvbv5: lib/include/libdvbv5/header.h Source File

libdvbv5 1.32.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
39
57 struct dvb_ts_packet_header {
58 uint8_t sync_byte;
59 union {
60 uint16_t bitfield;
61 struct {
62 uint16_t pid:13;
63 uint16_t transport_priority:1;
64 uint16_t payload_unit_start_indicator:1;
65 uint16_t transport_error_indicator:1;
66 } __attribute__((packed));
67 } __attribute__((packed));
68 uint8_t continuity_counter:4;
69 uint8_t adaptation_field_control:2;
70 uint8_t transport_scrambling_control:2;
71
72 /* Only if adaptation_field_control > 1 */
73 uint8_t adaptation_field_length;
74 /* Only if adaptation_field_length >= 1 */
75 struct {
76 uint8_t extension:1;
77 uint8_t private_data:1;
78 uint8_t splicing_point:1;
79 uint8_t OPCR:1;
80 uint8_t PCR:1;
81 uint8_t priority:1;
82 uint8_t random_access:1;
83 uint8_t discontinued:1;
84 } __attribute__((packed));
85} __attribute__((packed));
86
103 struct dvb_table_header {
104 uint8_t table_id;
105 union {
106 uint16_t bitfield;
107 struct {
108 uint16_t section_length:12;
109 uint8_t one:2;
110 uint8_t zero:1;
111 uint8_t syntax:1;
112 } __attribute__((packed));
113 } __attribute__((packed));
114 uint16_t id; /* TS ID */
115 uint8_t current_next:1;
116 uint8_t version:5;
117 uint8_t one2:2;
118
119 uint8_t section_id; /* section_number */
120 uint8_t last_section; /* last_section_number */
121} __attribute__((packed));
122
123struct dvb_v5_fe_parms;
124
125#ifdef __cplusplus
126extern "C" {
127#endif
128
135 void dvb_table_header_init (struct dvb_table_header *header);
143 void dvb_table_header_print(struct dvb_v5_fe_parms *parms,
144 const struct dvb_table_header *header);
145
146#ifdef __cplusplus
147}
148#endif
149
150#endif
dvb_table_header_init
void dvb_table_header_init(struct dvb_table_header *header)
Initializes and parses MPEG-TS table header.
dvb_table_header_print
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.
dvb_table_header
Header of a MPEG-TS table.
Definition header.h:103
dvb_table_header::section_id
uint8_t section_id
Definition header.h:119
dvb_table_header::zero
uint8_t zero
Definition header.h:110
dvb_table_header::syntax
uint8_t syntax
Definition header.h:111
dvb_table_header::version
uint8_t version
Definition header.h:116
dvb_table_header::id
uint16_t id
Definition header.h:114
dvb_table_header::one
uint8_t one
Definition header.h:109
dvb_table_header::section_length
uint16_t section_length
Definition header.h:108
dvb_table_header::one2
uint8_t one2
Definition header.h:117
dvb_table_header::table_id
uint8_t table_id
Definition header.h:104
dvb_table_header::current_next
uint8_t current_next
Definition header.h:115
dvb_table_header::last_section
uint8_t last_section
Definition header.h:120
dvb_table_header::bitfield
uint16_t bitfield
Definition header.h:106
dvb_ts_packet_header
Header of a MPEG-TS transport packet.
Definition header.h:57
dvb_ts_packet_header::pid
uint16_t pid
Definition header.h:62
dvb_ts_packet_header::sync_byte
uint8_t sync_byte
Definition header.h:58
dvb_ts_packet_header::splicing_point
uint8_t splicing_point
Definition header.h:78
dvb_ts_packet_header::transport_priority
uint16_t transport_priority
Definition header.h:63
dvb_ts_packet_header::random_access
uint8_t random_access
Definition header.h:82
dvb_ts_packet_header::transport_scrambling_control
uint8_t transport_scrambling_control
Definition header.h:70
dvb_ts_packet_header::payload_unit_start_indicator
uint16_t payload_unit_start_indicator
Definition header.h:64
dvb_ts_packet_header::extension
uint8_t extension
Definition header.h:76
dvb_ts_packet_header::priority
uint8_t priority
Definition header.h:81
dvb_ts_packet_header::adaptation_field_length
uint8_t adaptation_field_length
Definition header.h:73
dvb_ts_packet_header::transport_error_indicator
uint16_t transport_error_indicator
Definition header.h:65
dvb_ts_packet_header::discontinued
uint8_t discontinued
Definition header.h:83
dvb_ts_packet_header::PCR
uint8_t PCR
Definition header.h:80
dvb_ts_packet_header::OPCR
uint8_t OPCR
Definition header.h:79
dvb_ts_packet_header::adaptation_field_control
uint8_t adaptation_field_control
Definition header.h:69
dvb_ts_packet_header::continuity_counter
uint8_t continuity_counter
Definition header.h:68
dvb_ts_packet_header::bitfield
uint16_t bitfield
Definition header.h:60
dvb_ts_packet_header::private_data
uint8_t private_data
Definition header.h:77
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117