libdvbv5 1.26.1
Library to work with Digital TV devices on Linux
mgt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 - Andre Roth <neolynx@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation version 2.1 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
17 *
18 */
19
38#ifndef _MGT_H
39#define _MGT_H
40
41#include <stdint.h>
42#include <unistd.h> /* ssize_t */
43
45
51#define ATSC_TABLE_MGT 0xC7
52
78 uint16_t type;
79 union {
80 uint16_t bitfield;
81 struct {
82 uint16_t pid:13;
83 uint16_t one:3;
84 } __attribute__((packed));
85 } __attribute__((packed));
86 uint8_t type_version:5;
87 uint8_t one2:3;
88 uint32_t size;
89 union {
90 uint16_t bitfield2;
91 struct {
92 uint16_t desc_length:12;
93 uint16_t one3:4;
94 } __attribute__((packed));
95 } __attribute__((packed));
98} __attribute__((packed));
99
125 uint16_t tables;
128} __attribute__((packed));
129
136#define atsc_mgt_table_foreach( _table, _mgt ) \
137 if (_mgt && _mgt->_table) \
138 for( struct atsc_table_mgt_table *_table = _mgt->table; _table; _table = _table->next ) \
139
140struct dvb_v5_fe_parms;
141
142#ifdef __cplusplus
143extern "C" {
144#endif
145
162ssize_t atsc_table_mgt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
163 ssize_t buflen, struct atsc_table_mgt **table);
164
172
181 struct atsc_table_mgt *table);
182
183#ifdef __cplusplus
184}
185#endif
186
187#endif
Provides some common ATSC stuff.
void atsc_table_mgt_free(struct atsc_table_mgt *table)
Frees all data allocated by the MGT table parser.
ssize_t atsc_table_mgt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct atsc_table_mgt **table)
Initializes and parses MGT table.
void atsc_table_mgt_print(struct dvb_v5_fe_parms *parms, struct atsc_table_mgt *table)
Prints the content of the MGT table.
ATSC tables descrition at MGT table.
Definition mgt.h:77
uint16_t bitfield
Definition mgt.h:80
struct dvb_desc * descriptor
Definition mgt.h:96
struct atsc_table_mgt_table * next
Definition mgt.h:97
uint32_t size
Definition mgt.h:88
uint8_t one2
Definition mgt.h:87
uint16_t type
Definition mgt.h:78
uint8_t type_version
Definition mgt.h:86
uint16_t desc_length
Definition mgt.h:92
uint16_t one
Definition mgt.h:83
uint16_t one3
Definition mgt.h:93
uint16_t bitfield2
Definition mgt.h:90
uint16_t pid
Definition mgt.h:82
ATSC MGT table.
Definition mgt.h:122
struct dvb_desc * descriptor
Definition mgt.h:127
struct atsc_table_mgt_table * table
Definition mgt.h:126
uint8_t protocol_version
Definition mgt.h:124
uint16_t tables
Definition mgt.h:125
struct dvb_table_header header
Definition mgt.h:123
Linked list containing the several descriptors found on a MPEG-TS table.
Header of a MPEG-TS table.
Definition header.h:103
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117