pat.h
Go to the documentation of this file.
/*
* Copyright (c) 2011-2012 - Mauro Carvalho Chehab
* Copyright (c) 2012 - 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 _PAT_H
#define _PAT_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#include <libdvbv5/header.h>
#define DVB_TABLE_PAT 0x00
#define DVB_TABLE_PAT_PID 0x0000
struct dvb_table_pat_program {
uint16_t service_id;
union {
uint16_t bitfield;
struct {
uint16_t pid:13;
uint8_t reserved:3;
} __attribute__((packed));
} __attribute__((packed));
struct dvb_table_pat_program *next;
} __attribute__((packed));
struct dvb_table_pat {
struct dvb_table_header header;
uint16_t programs;
struct dvb_table_pat_program *program;
} __attribute__((packed));
#define dvb_pat_program_foreach(_pgm, _pat) \
if (_pat && _pat->program) \
for (struct dvb_table_pat_program *_pgm = _pat->program; _pgm; _pgm = _pgm->next) \
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
ssize_t dvb_table_pat_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
ssize_t buflen, struct dvb_table_pat **table);
void dvb_table_pat_free(struct dvb_table_pat *table);
void dvb_table_pat_print(struct dvb_v5_fe_parms *parms,
struct dvb_table_pat *table);
#ifdef __cplusplus
}
#endif
#endif
dvb_table_pat_init
ssize_t dvb_table_pat_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_pat **table)
Initializes and parses PAT table.
dvb_table_pat_free
void dvb_table_pat_free(struct dvb_table_pat *table)
Frees all data allocated by the PAT table parser.
dvb_table_pat_print
void dvb_table_pat_print(struct dvb_v5_fe_parms *parms, struct dvb_table_pat *table)
Prints the content of the PAT table.
header.h
Provides the MPEG TS table headers.
dvb_table_header
Header of a MPEG-TS table.
Definition header.h:103
dvb_table_pat_program
MPEG-TS PAT program table.
Definition pat.h:77
dvb_table_pat_program::service_id
uint16_t service_id
Definition pat.h:78
dvb_table_pat_program::pid
uint16_t pid
Definition pat.h:82
dvb_table_pat_program::next
struct dvb_table_pat_program * next
Definition pat.h:86
dvb_table_pat_program::bitfield
uint16_t bitfield
Definition pat.h:80
dvb_table_pat_program::reserved
uint8_t reserved
Definition pat.h:83
dvb_table_pat
MPEG-TS PAT table.
Definition pat.h:108
dvb_table_pat::program
struct dvb_table_pat_program * program
Definition pat.h:111
dvb_table_pat::programs
uint16_t programs
Definition pat.h:110
dvb_table_pat::header
struct dvb_table_header header
Definition pat.h:109
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117