libdvbv5  1.11.0
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  for (struct dvb_table_pat_program *_pgm = _pat->program; _pgm; _pgm = _pgm->next) \
123 
124 struct dvb_v5_fe_parms;
125 
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
129 
146 ssize_t dvb_table_pat_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
147  ssize_t buflen, struct dvb_table_pat **table);
148 
155 void dvb_table_pat_free(struct dvb_table_pat *table);
156 
164 void dvb_table_pat_print(struct dvb_v5_fe_parms *parms,
165  struct dvb_table_pat *table);
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif
uint8_t reserved
Definition: pat.h:83
struct dvb_table_pat_program * program
Definition: pat.h:111
Header of a MPEG-TS table.
Definition: header.h:92
Provides the MPEG TS table headers.
uint16_t pid
Definition: pat.h:82
void dvb_table_pat_print(struct dvb_v5_fe_parms *parms, struct dvb_table_pat *table)
Prints the content of the PAT table.
uint16_t service_id
Definition: pat.h:78
struct dvb_table_pat_program * next
Definition: pat.h:86
uint16_t bitfield
Definition: pat.h:80
struct dvb_table_header header
Definition: pat.h:109
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117
uint16_t programs
Definition: pat.h:110
MPEG-TS PAT table.
Definition: pat.h:108
void dvb_table_pat_free(struct dvb_table_pat *table)
Frees all data allocated by the PAT table parser.
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.
MPEG-TS PAT program table.
Definition: pat.h:77