libdvbv5 1.22.1
Library to work with Digital TV devices on Linux
pat.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 */
20
39#ifndef _PAT_H
40#define _PAT_H
41
42#include <stdint.h>
43#include <unistd.h> /* ssize_t */
44
45#include <libdvbv5/header.h>
46
55#define DVB_TABLE_PAT 0x00
56#define DVB_TABLE_PAT_PID 0x0000
57
78 uint16_t service_id;
79 union {
80 uint16_t bitfield;
81 struct {
82 uint16_t pid:13;
83 uint8_t reserved:3;
84 } __attribute__((packed));
85 } __attribute__((packed));
87} __attribute__((packed));
88
110 uint16_t programs;
112} __attribute__((packed));
113
121#define dvb_pat_program_foreach(_pgm, _pat) \
122 if (_pat && _pat->program) \
123 for (struct dvb_table_pat_program *_pgm = _pat->program; _pgm; _pgm = _pgm->next) \
124
125struct dvb_v5_fe_parms;
126
127#ifdef __cplusplus
128extern "C" {
129#endif
130
147ssize_t dvb_table_pat_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
148 ssize_t buflen, struct dvb_table_pat **table);
149
157
166 struct dvb_table_pat *table);
167
168#ifdef __cplusplus
169}
170#endif
171
172#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)
Initializes and parses PAT table.
void dvb_table_pat_free(struct dvb_table_pat *table)
Frees all data allocated by the PAT table parser.
void dvb_table_pat_print(struct dvb_v5_fe_parms *parms, struct dvb_table_pat *table)
Prints the content of the PAT table.
Provides the MPEG TS table headers.
Header of a MPEG-TS table.
Definition: header.h:103
MPEG-TS PAT program table.
Definition: pat.h:77
uint16_t service_id
Definition: pat.h:78
uint16_t pid
Definition: pat.h:82
struct dvb_table_pat_program * next
Definition: pat.h:86
uint16_t bitfield
Definition: pat.h:80
uint8_t reserved
Definition: pat.h:83
MPEG-TS PAT table.
Definition: pat.h:108
struct dvb_table_pat_program * program
Definition: pat.h:111
uint16_t programs
Definition: pat.h:110
struct dvb_table_header header
Definition: pat.h:109
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117