libdvbv5  1.10.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
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation version 2
8  * of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  *
20  */
21 
40 #ifndef _PAT_H
41 #define _PAT_H
42 
43 #include <stdint.h>
44 #include <unistd.h> /* ssize_t */
45 
46 #include <libdvbv5/header.h>
47 
56 #define DVB_TABLE_PAT 0x00
57 #define DVB_TABLE_PAT_PID 0x0000
58 
79  uint16_t service_id;
80  union {
81  uint16_t bitfield;
82  struct {
83  uint16_t pid:13;
84  uint8_t reserved:3;
85  } __attribute__((packed));
86  } __attribute__((packed));
88 } __attribute__((packed));
89 
111  uint16_t programs;
113 } __attribute__((packed));
114 
122 #define dvb_pat_program_foreach(_pgm, _pat) \
123  for (struct dvb_table_pat_program *_pgm = _pat->program; _pgm; _pgm = _pgm->next) \
124 
125 struct dvb_v5_fe_parms;
126 
127 #ifdef __cplusplus
128 extern "C" {
129 #endif
130 
147 ssize_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 
156 void dvb_table_pat_free(struct dvb_table_pat *table);
157 
165 void dvb_table_pat_print(struct dvb_v5_fe_parms *parms,
166  struct dvb_table_pat *table);
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif
uint8_t reserved
Definition: pat.h:84
struct dvb_table_pat_program * program
Definition: pat.h:112
Header of a MPEG-TS table.
Definition: header.h:93
Provides the MPEG TS table headers.
uint16_t pid
Definition: pat.h:83
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:79
struct dvb_table_pat_program * next
Definition: pat.h:87
uint16_t bitfield
Definition: pat.h:81
struct dvb_table_header header
Definition: pat.h:110
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:118
uint16_t programs
Definition: pat.h:111
MPEG-TS PAT table.
Definition: pat.h:109
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:78