mgt.h
Go to the documentation of this file.
/*
* Copyright (c) 2013 - Andre Roth <neolynx@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation version 2.1 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
*/
#ifndef _MGT_H
#define _MGT_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#include <libdvbv5/atsc_header.h>
#define ATSC_TABLE_MGT 0xC7
struct atsc_table_mgt_table {
uint16_t type;
union {
uint16_t bitfield;
struct {
uint16_t pid:13;
uint16_t one:3;
} __attribute__((packed));
} __attribute__((packed));
uint8_t type_version:5;
uint8_t one2:3;
uint32_t size;
union {
uint16_t bitfield2;
struct {
uint16_t desc_length:12;
uint16_t one3:4;
} __attribute__((packed));
} __attribute__((packed));
struct dvb_desc *descriptor;
struct atsc_table_mgt_table *next;
} __attribute__((packed));
struct atsc_table_mgt {
struct dvb_table_header header;
uint8_t protocol_version;
uint16_t tables;
struct atsc_table_mgt_table *table;
struct dvb_desc *descriptor;
} __attribute__((packed));
#define atsc_mgt_table_foreach( _table, _mgt ) \
if (_mgt && _mgt->_table) \
for( struct atsc_table_mgt_table *_table = _mgt->table; _table; _table = _table->next ) \
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
ssize_t atsc_table_mgt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
ssize_t buflen, struct atsc_table_mgt **table);
void atsc_table_mgt_free(struct atsc_table_mgt *table);
void atsc_table_mgt_print(struct dvb_v5_fe_parms *parms,
struct atsc_table_mgt *table);
#ifdef __cplusplus
}
#endif
#endif
atsc_header.h
Provides some common ATSC stuff.
atsc_table_mgt_free
void atsc_table_mgt_free(struct atsc_table_mgt *table)
Frees all data allocated by the MGT table parser.
atsc_table_mgt_init
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.
atsc_table_mgt_print
void atsc_table_mgt_print(struct dvb_v5_fe_parms *parms, struct atsc_table_mgt *table)
Prints the content of the MGT table.
atsc_table_mgt_table
ATSC tables descrition at MGT table.
Definition mgt.h:77
atsc_table_mgt_table::bitfield
uint16_t bitfield
Definition mgt.h:80
atsc_table_mgt_table::descriptor
struct dvb_desc * descriptor
Definition mgt.h:96
atsc_table_mgt_table::next
struct atsc_table_mgt_table * next
Definition mgt.h:97
atsc_table_mgt_table::size
uint32_t size
Definition mgt.h:88
atsc_table_mgt_table::one2
uint8_t one2
Definition mgt.h:87
atsc_table_mgt_table::type
uint16_t type
Definition mgt.h:78
atsc_table_mgt_table::type_version
uint8_t type_version
Definition mgt.h:86
atsc_table_mgt_table::desc_length
uint16_t desc_length
Definition mgt.h:92
atsc_table_mgt_table::one
uint16_t one
Definition mgt.h:83
atsc_table_mgt_table::one3
uint16_t one3
Definition mgt.h:93
atsc_table_mgt_table::bitfield2
uint16_t bitfield2
Definition mgt.h:90
atsc_table_mgt_table::pid
uint16_t pid
Definition mgt.h:82
atsc_table_mgt
ATSC MGT table.
Definition mgt.h:122
atsc_table_mgt::descriptor
struct dvb_desc * descriptor
Definition mgt.h:127
atsc_table_mgt::table
struct atsc_table_mgt_table * table
Definition mgt.h:126
atsc_table_mgt::protocol_version
uint8_t protocol_version
Definition mgt.h:124
atsc_table_mgt::tables
uint16_t tables
Definition mgt.h:125
atsc_table_mgt::header
struct dvb_table_header header
Definition mgt.h:123
dvb_desc
Linked list containing the several descriptors found on a MPEG-TS table.
Definition descriptors.h:117
dvb_table_header
Header of a MPEG-TS table.
Definition header.h:103
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117