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