libdvbv5  1.11.0
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 
44 #include <libdvbv5/atsc_header.h>
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  for( struct atsc_table_mgt_table *_table = _mgt->table; _table; _table = _table->next ) \
138 
139 struct dvb_v5_fe_parms;
140 
141 #ifdef __cplusplus
142 extern "C" {
143 #endif
144 
161 ssize_t atsc_table_mgt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
162  ssize_t buflen, struct atsc_table_mgt **table);
163 
170 void atsc_table_mgt_free(struct atsc_table_mgt *table);
171 
179 void atsc_table_mgt_print(struct dvb_v5_fe_parms *parms,
180  struct atsc_table_mgt *table);
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif
Header of a MPEG-TS table.
Definition: header.h:92
void atsc_table_mgt_free(struct atsc_table_mgt *table)
Frees all data allocated by the MGT table parser.
uint16_t one
Definition: mgt.h:83
uint32_t size
Definition: mgt.h:88
uint16_t one3
Definition: mgt.h:93
ATSC tables descrition at MGT table.
Definition: mgt.h:77
struct dvb_table_header header
Definition: mgt.h:123
uint8_t protocol_version
Definition: mgt.h:124
uint16_t type
Definition: mgt.h:78
uint8_t one2
Definition: mgt.h:87
uint16_t bitfield2
Definition: mgt.h:90
uint8_t type_version
Definition: mgt.h:86
struct atsc_table_mgt_table * table
Definition: mgt.h:126
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.
uint16_t desc_length
Definition: mgt.h:92
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117
struct dvb_desc * descriptor
Definition: mgt.h:96
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:117
struct atsc_table_mgt_table * next
Definition: mgt.h:97
ATSC MGT table.
Definition: mgt.h:122
uint16_t pid
Definition: mgt.h:82
uint16_t bitfield
Definition: mgt.h:80
void atsc_table_mgt_print(struct dvb_v5_fe_parms *parms, struct atsc_table_mgt *table)
Prints the content of the MGT table.
uint16_t tables
Definition: mgt.h:125
struct dvb_desc * descriptor
Definition: mgt.h:127
Provides some common ATSC stuff.