libdvbv5  1.11.0
Library to work with Digital TV devices on Linux
pmt.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 _PMT_H
40 #define _PMT_H
41 
42 #include <stdint.h>
43 #include <unistd.h> /* ssize_t */
44 
45 #include <libdvbv5/header.h>
46 
52 #define DVB_TABLE_PMT 0x02
53 
108  stream_video = 0x01,
110  stream_audio = 0x03,
114  stream_mheg = 0x07,
115  stream_h222 = 0x08,
130 };
131 
136 extern const char *pmt_stream_name[];
137 
162  uint8_t type;
163  union {
164  uint16_t bitfield;
165  struct {
166  uint16_t elementary_pid:13;
167  uint16_t reserved:3;
168  } __attribute__((packed));
169  } __attribute__((packed));
170  union {
171  uint16_t bitfield2;
172  struct {
173  uint16_t desc_length:10;
174  uint16_t zero:2;
175  uint16_t reserved2:4;
176  } __attribute__((packed));
177  } __attribute__((packed));
180 } __attribute__((packed));
181 
205  union {
206  uint16_t bitfield;
207  struct {
208  uint16_t pcr_pid:13;
209  uint16_t reserved2:3;
210  } __attribute__((packed));
211  } __attribute__((packed));
212 
213  union {
214  uint16_t bitfield2;
215  struct {
216  uint16_t desc_length:10;
217  uint16_t zero3:2;
218  uint16_t reserved3:4;
219  } __attribute__((packed));
220  } __attribute__((packed));
223 } __attribute__((packed));
224 
226 #define dvb_pmt_field_first header
227 
229 #define dvb_pmt_field_last descriptor
230 
238 #define dvb_pmt_stream_foreach(_stream, _pmt) \
239  for (struct dvb_table_pmt_stream *_stream = _pmt->stream; _stream; _stream = _stream->next) \
240 
241 struct dvb_v5_fe_parms;
242 
243 #ifdef __cplusplus
244 extern "C" {
245 #endif
246 
263 ssize_t dvb_table_pmt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
264  ssize_t buflen, struct dvb_table_pmt **table);
265 
272 void dvb_table_pmt_free(struct dvb_table_pmt *table);
273 
281 void dvb_table_pmt_print(struct dvb_v5_fe_parms *parms,
282  const struct dvb_table_pmt *table);
283 
284 #ifdef __cplusplus
285 }
286 #endif
287 
288 #endif
ITU-T Rec.
Definition: pmt.h:115
struct dvb_desc * descriptor
Definition: pmt.h:178
ITU-T Rec.
Definition: pmt.h:121
Header of a MPEG-TS table.
Definition: header.h:92
uint16_t reserved3
Definition: pmt.h:218
uint16_t reserved2
Definition: pmt.h:209
Provides the MPEG TS table headers.
uint16_t desc_length
Definition: pmt.h:216
uint16_t elementary_pid
Definition: pmt.h:166
uint16_t reserved2
Definition: pmt.h:175
void dvb_table_pmt_print(struct dvb_v5_fe_parms *parms, const struct dvb_table_pmt *table)
Prints the content of the PAT table.
ITU-T Rec.
Definition: pmt.h:113
ISO/IEC 11172 Video.
Definition: pmt.h:108
ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried in PES packets.
Definition: pmt.h:125
ITU-T | ISO/IEC Reserved.
Definition: pmt.h:107
uint16_t bitfield
Definition: pmt.h:164
ISO/IEC 13818-6 type B.
Definition: pmt.h:118
uint16_t bitfield2
Definition: pmt.h:171
MPEG-TS PMT stream table.
Definition: pmt.h:161
ISO/IEC 11172 Audio.
Definition: pmt.h:110
ITU-T Rec.
Definition: pmt.h:109
uint16_t bitfield2
Definition: pmt.h:214
ISO/IEC 14496-2 Visual.
Definition: pmt.h:123
ISO/IEC 13818-6 type D.
Definition: pmt.h:120
ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried in ISO/IEC14496_sections.
Definition: pmt.h:126
const char * pmt_stream_name[]
Converts from enum dvb_streams into a string.
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117
User Private (from 0x80 to 0xff)
Definition: pmt.h:129
ISO/IEC 13818-3 Audio.
Definition: pmt.h:111
MPEG-TS PMT table.
Definition: pmt.h:203
ISO/IEC 13522 MHEG.
Definition: pmt.h:114
ISO/IEC 13818-6 type A.
Definition: pmt.h:117
uint8_t type
Definition: pmt.h:162
ISO/IEC 13818-7 Audio with ADTS transport syntax.
Definition: pmt.h:122
uint16_t reserved
Definition: pmt.h:167
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:117
ITU-T Rec.
Definition: pmt.h:128
ITU-T Rec.
Definition: pmt.h:112
ISO/IEC 13818-6 Synchronized Download Protocol.
Definition: pmt.h:127
void dvb_table_pmt_free(struct dvb_table_pmt *table)
Frees all data allocated by the PMT table parser.
uint16_t desc_length
Definition: pmt.h:173
ISO/IEC 13818-6 type C.
Definition: pmt.h:119
struct dvb_desc * descriptor
Definition: pmt.h:221
ISO/IEC 14496-3 Audio with the LATM transport syntax as defined in ISO/IEC 14496-3 / AMD 1...
Definition: pmt.h:124
struct dvb_table_header header
Definition: pmt.h:204
uint16_t zero3
Definition: pmt.h:217
struct dvb_table_pmt_stream * next
Definition: pmt.h:179
struct dvb_table_pmt_stream * stream
Definition: pmt.h:222
dvb_streams
Add support for MPEG-TS Stream types.
Definition: pmt.h:106
uint16_t pcr_pid
Definition: pmt.h:208
uint16_t bitfield
Definition: pmt.h:206
uint16_t zero
Definition: pmt.h:174
ssize_t dvb_table_pmt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_pmt **table)
Initializes and parses PMT table.
ITU-T Rec.
Definition: pmt.h:116