pmt.h
Go to the documentation of this file.
/*
* Copyright (c) 2011-2012 - Mauro Carvalho Chehab
* Copyright (c) 2012 - Andre Roth <neolynx@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation version 2.1 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
*/
#ifndef _PMT_H
#define _PMT_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#include <libdvbv5/header.h>
#define DVB_TABLE_PMT 0x02
enum dvb_streams {
stream_video = 0x01,
stream_video_h262 = 0x02,
stream_audio = 0x03,
stream_audio_13818_3 = 0x04,
stream_private_sections = 0x05,
stream_private_data = 0x06,
stream_mheg = 0x07,
stream_h222 = 0x08,
stream_h222_1 = 0x09,
stream_13818_6_A = 0x0A,
stream_13818_6_B = 0x0B,
stream_13818_6_C = 0x0C,
stream_13818_6_D = 0x0D,
stream_h222_aux = 0x0E,
stream_audio_adts = 0x0F,
stream_video_14496_2 = 0x10,
stream_audio_latm = 0x11,
stream_14496_1_pes = 0x12,
stream_14496_1_iso = 0x13,
stream_download = 0x14,
stream_video_h264 = 0x1b,
stream_audio_14496_3 = 0x1c,
stream_video_hevc = 0x24,
stream_video_cavs = 0x42,
stream_video_moto = 0x80,
stream_audio_a52 = 0x81,
stream_scte_27 = 0x82,
stream_audio_sdds = 0x84,
stream_audio_dts_hdmv = 0x85,
stream_audio_e_ac3 = 0x87,
stream_audio_dts = 0x8a,
stream_audio_a52_vls = 0x91,
stream_spu_vls = 0x92,
stream_audio_sdds2 = 0x94,
};
extern const char *pmt_stream_name[];
struct dvb_table_pmt_stream {
uint8_t type;
union {
uint16_t bitfield;
struct {
uint16_t elementary_pid:13;
uint16_t reserved:3;
} __attribute__((packed));
} __attribute__((packed));
union {
uint16_t bitfield2;
struct {
uint16_t desc_length:10;
uint16_t zero:2;
uint16_t reserved2:4;
} __attribute__((packed));
} __attribute__((packed));
struct dvb_desc *descriptor;
struct dvb_table_pmt_stream *next;
} __attribute__((packed));
struct dvb_table_pmt {
struct dvb_table_header header;
union {
uint16_t bitfield;
struct {
uint16_t pcr_pid:13;
uint16_t reserved2:3;
} __attribute__((packed));
} __attribute__((packed));
union {
uint16_t bitfield2;
struct {
uint16_t desc_length:10;
uint16_t zero3:2;
uint16_t reserved3:4;
} __attribute__((packed));
} __attribute__((packed));
struct dvb_desc *descriptor;
struct dvb_table_pmt_stream *stream;
} __attribute__((packed));
#define dvb_pmt_field_first header
#define dvb_pmt_field_last descriptor
#define dvb_pmt_stream_foreach(_stream, _pmt) \
if (_pmt && _pmt->stream) \
for (struct dvb_table_pmt_stream *_stream = _pmt->stream; _stream; _stream = _stream->next) \
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
ssize_t dvb_table_pmt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
ssize_t buflen, struct dvb_table_pmt **table);
void dvb_table_pmt_free(struct dvb_table_pmt *table);
void dvb_table_pmt_print(struct dvb_v5_fe_parms *parms,
const struct dvb_table_pmt *table);
#ifdef __cplusplus
}
#endif
#endif
pmt_stream_name
const char * pmt_stream_name[]
Converts from enum dvb_streams into a string.
dvb_streams
dvb_streams
Add support for MPEG-TS Stream types.
Definition pmt.h:100
dvb_table_pmt_print
void dvb_table_pmt_print(struct dvb_v5_fe_parms *parms, const struct dvb_table_pmt *table)
Prints the content of the PAT table.
dvb_table_pmt_free
void dvb_table_pmt_free(struct dvb_table_pmt *table)
Frees all data allocated by the PMT table parser.
dvb_table_pmt_init
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.
header.h
Provides the MPEG TS table headers.
stream_audio_a52_vls
@ stream_audio_a52_vls
Definition pmt.h:132
stream_audio_dts
@ stream_audio_dts
Definition pmt.h:131
stream_mheg
@ stream_mheg
ISO/IEC 13522 MHEG.
Definition pmt.h:107
stream_audio_sdds
@ stream_audio_sdds
Definition pmt.h:128
stream_13818_6_C
@ stream_13818_6_C
ISO/IEC 13818-6 type C.
Definition pmt.h:112
stream_video_moto
@ stream_video_moto
Definition pmt.h:125
stream_h222_aux
@ stream_h222_aux
ITU-T Rec.
Definition pmt.h:114
stream_download
@ stream_download
ISO/IEC 13818-6 Synchronized Download Protocol.
Definition pmt.h:120
stream_h222
@ stream_h222
ITU-T Rec.
Definition pmt.h:108
stream_video_h264
@ stream_video_h264
Definition pmt.h:121
stream_audio_14496_3
@ stream_audio_14496_3
Definition pmt.h:122
stream_13818_6_D
@ stream_13818_6_D
ISO/IEC 13818-6 type D.
Definition pmt.h:113
stream_audio_dts_hdmv
@ stream_audio_dts_hdmv
Definition pmt.h:129
stream_scte_27
@ stream_scte_27
Definition pmt.h:127
stream_audio
@ stream_audio
ISO/IEC 11172 Audio.
Definition pmt.h:103
stream_audio_latm
@ stream_audio_latm
ISO/IEC 14496-3 Audio with the LATM transport syntax as defined in ISO/IEC 14496-3 / AMD 1.
Definition pmt.h:117
stream_audio_adts
@ stream_audio_adts
ISO/IEC 13818-7 Audio with ADTS transport syntax.
Definition pmt.h:115
stream_audio_13818_3
@ stream_audio_13818_3
ISO/IEC 13818-3 Audio.
Definition pmt.h:104
stream_audio_e_ac3
@ stream_audio_e_ac3
Definition pmt.h:130
stream_video_cavs
@ stream_video_cavs
Definition pmt.h:124
stream_video_14496_2
@ stream_video_14496_2
ISO/IEC 14496-2 Visual.
Definition pmt.h:116
stream_video
@ stream_video
ISO/IEC 11172 Video.
Definition pmt.h:101
stream_audio_a52
@ stream_audio_a52
Definition pmt.h:126
stream_14496_1_pes
@ stream_14496_1_pes
ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried in PES packets.
Definition pmt.h:118
stream_private_data
@ stream_private_data
ITU-T Rec.
Definition pmt.h:106
stream_video_h262
@ stream_video_h262
ITU-T Rec.
Definition pmt.h:102
stream_13818_6_A
@ stream_13818_6_A
ISO/IEC 13818-6 type A.
Definition pmt.h:110
stream_spu_vls
@ stream_spu_vls
Definition pmt.h:133
stream_video_hevc
@ stream_video_hevc
Definition pmt.h:123
stream_audio_sdds2
@ stream_audio_sdds2
Definition pmt.h:134
stream_13818_6_B
@ stream_13818_6_B
ISO/IEC 13818-6 type B.
Definition pmt.h:111
stream_private_sections
@ stream_private_sections
ITU-T Rec.
Definition pmt.h:105
stream_14496_1_iso
@ stream_14496_1_iso
ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried in ISO/IEC14496_sections.
Definition pmt.h:119
stream_h222_1
@ stream_h222_1
ITU-T Rec.
Definition pmt.h:109
dvb_desc
Linked list containing the several descriptors found on a MPEG-TS table.
Definition descriptors.h:117
dvb_table_header
Header of a MPEG-TS table.
Definition header.h:103
dvb_table_pmt_stream
MPEG-TS PMT stream table.
Definition pmt.h:166
dvb_table_pmt_stream::reserved2
uint16_t reserved2
Definition pmt.h:180
dvb_table_pmt_stream::descriptor
struct dvb_desc * descriptor
Definition pmt.h:183
dvb_table_pmt_stream::reserved
uint16_t reserved
Definition pmt.h:172
dvb_table_pmt_stream::elementary_pid
uint16_t elementary_pid
Definition pmt.h:171
dvb_table_pmt_stream::zero
uint16_t zero
Definition pmt.h:179
dvb_table_pmt_stream::bitfield2
uint16_t bitfield2
Definition pmt.h:176
dvb_table_pmt_stream::next
struct dvb_table_pmt_stream * next
Definition pmt.h:184
dvb_table_pmt_stream::type
uint8_t type
Definition pmt.h:167
dvb_table_pmt_stream::bitfield
uint16_t bitfield
Definition pmt.h:169
dvb_table_pmt_stream::desc_length
uint16_t desc_length
Definition pmt.h:178
dvb_table_pmt
MPEG-TS PMT table.
Definition pmt.h:208
dvb_table_pmt::reserved2
uint16_t reserved2
Definition pmt.h:214
dvb_table_pmt::stream
struct dvb_table_pmt_stream * stream
Definition pmt.h:227
dvb_table_pmt::bitfield2
uint16_t bitfield2
Definition pmt.h:219
dvb_table_pmt::zero3
uint16_t zero3
Definition pmt.h:222
dvb_table_pmt::bitfield
uint16_t bitfield
Definition pmt.h:211
dvb_table_pmt::descriptor
struct dvb_desc * descriptor
Definition pmt.h:226
dvb_table_pmt::header
struct dvb_table_header header
Definition pmt.h:209
dvb_table_pmt::reserved3
uint16_t reserved3
Definition pmt.h:223
dvb_table_pmt::pcr_pid
uint16_t pcr_pid
Definition pmt.h:213
dvb_table_pmt::desc_length
uint16_t desc_length
Definition pmt.h:221
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117