mpeg_ts.h
Go to the documentation of this file.
/*
* Copyright (c) 2013-2014 - 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 _MPEG_TS_H
#define _MPEG_TS_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#define DVB_MPEG_TS 0x47
#define DVB_MPEG_TS_PACKET_SIZE 188
struct dvb_mpeg_ts_adaption {
uint8_t length;
struct {
uint8_t extension:1;
uint8_t private_data:1;
uint8_t splicing_point:1;
uint8_t OPCR:1;
uint8_t PCR:1;
uint8_t priority:1;
uint8_t random_access:1;
uint8_t discontinued:1;
} __attribute__((packed));
uint8_t data[];
} __attribute__((packed));
struct dvb_mpeg_ts {
uint8_t sync_byte;
union {
uint16_t bitfield;
struct {
uint16_t pid:13;
uint16_t priority:1;
uint16_t payload_start:1;
uint16_t tei:1;
} __attribute__((packed));
} __attribute__((packed));
struct {
uint8_t continuity_counter:4;
uint8_t payload:1;
uint8_t adaptation_field:1;
uint8_t scrambling:2;
} __attribute__((packed));
struct dvb_mpeg_ts_adaption adaption[];
} __attribute__((packed));
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
ssize_t dvb_mpeg_ts_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen,
uint8_t *table, ssize_t *table_length);
void dvb_mpeg_ts_free(struct dvb_mpeg_ts *ts);
void dvb_mpeg_ts_print(struct dvb_v5_fe_parms *parms, struct dvb_mpeg_ts *ts);
#ifdef __cplusplus
}
#endif
#endif
dvb_mpeg_ts_print
void dvb_mpeg_ts_print(struct dvb_v5_fe_parms *parms, struct dvb_mpeg_ts *ts)
Print details of struct dvb_mpeg_ts.
dvb_mpeg_ts_free
void dvb_mpeg_ts_free(struct dvb_mpeg_ts *ts)
Deallocate memory associated with a struct dvb_mpeg_ts.
dvb_mpeg_ts_init
ssize_t dvb_mpeg_ts_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, uint8_t *table, ssize_t *table_length)
Initialize a struct dvb_mpeg_ts from buffer.
dvb_mpeg_ts_adaption
MPEG TS header adaption field.
Definition mpeg_ts.h:70
dvb_mpeg_ts_adaption::extension
uint8_t extension
Definition mpeg_ts.h:73
dvb_mpeg_ts_adaption::data
uint8_t data[]
Definition mpeg_ts.h:82
dvb_mpeg_ts_adaption::random_access
uint8_t random_access
Definition mpeg_ts.h:79
dvb_mpeg_ts_adaption::private_data
uint8_t private_data
Definition mpeg_ts.h:74
dvb_mpeg_ts_adaption::splicing_point
uint8_t splicing_point
Definition mpeg_ts.h:75
dvb_mpeg_ts_adaption::OPCR
uint8_t OPCR
Definition mpeg_ts.h:76
dvb_mpeg_ts_adaption::PCR
uint8_t PCR
Definition mpeg_ts.h:77
dvb_mpeg_ts_adaption::priority
uint8_t priority
Definition mpeg_ts.h:78
dvb_mpeg_ts_adaption::discontinued
uint8_t discontinued
Definition mpeg_ts.h:80
dvb_mpeg_ts_adaption::length
uint8_t length
Definition mpeg_ts.h:71
dvb_mpeg_ts
MPEG TS header.
Definition mpeg_ts.h:101
dvb_mpeg_ts::bitfield
uint16_t bitfield
Definition mpeg_ts.h:104
dvb_mpeg_ts::continuity_counter
uint8_t continuity_counter
Definition mpeg_ts.h:113
dvb_mpeg_ts::priority
uint16_t priority
Definition mpeg_ts.h:107
dvb_mpeg_ts::payload
uint8_t payload
Definition mpeg_ts.h:114
dvb_mpeg_ts::scrambling
uint8_t scrambling
Definition mpeg_ts.h:116
dvb_mpeg_ts::adaption
struct dvb_mpeg_ts_adaption adaption[]
Definition mpeg_ts.h:118
dvb_mpeg_ts::payload_start
uint16_t payload_start
Definition mpeg_ts.h:108
dvb_mpeg_ts::tei
uint16_t tei
Definition mpeg_ts.h:109
dvb_mpeg_ts::adaptation_field
uint8_t adaptation_field
Definition mpeg_ts.h:115
dvb_mpeg_ts::sync_byte
uint8_t sync_byte
Definition mpeg_ts.h:102
dvb_mpeg_ts::pid
uint16_t pid
Definition mpeg_ts.h:106
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117