header.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
*
* Described at ISO/IEC 13818-1
*/
#ifndef _HEADER_H
#define _HEADER_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
struct dvb_ts_packet_header {
uint8_t sync_byte;
union {
uint16_t bitfield;
struct {
uint16_t pid:13;
uint16_t transport_priority:1;
uint16_t payload_unit_start_indicator:1;
uint16_t transport_error_indicator:1;
} __attribute__((packed));
} __attribute__((packed));
uint8_t continuity_counter:4;
uint8_t adaptation_field_control:2;
uint8_t transport_scrambling_control:2;
/* Only if adaptation_field_control > 1 */
uint8_t adaptation_field_length;
/* Only if adaptation_field_length >= 1 */
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));
} __attribute__((packed));
struct dvb_table_header {
uint8_t table_id;
union {
uint16_t bitfield;
struct {
uint16_t section_length:12;
uint8_t one:2;
uint8_t zero:1;
uint8_t syntax:1;
} __attribute__((packed));
} __attribute__((packed));
uint16_t id; /* TS ID */
uint8_t current_next:1;
uint8_t version:5;
uint8_t one2:2;
uint8_t section_id; /* section_number */
uint8_t last_section; /* last_section_number */
} __attribute__((packed));
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
void dvb_table_header_init (struct dvb_table_header *header);
void dvb_table_header_print(struct dvb_v5_fe_parms *parms,
const struct dvb_table_header *header);
#ifdef __cplusplus
}
#endif
#endif
dvb_table_header_init
void dvb_table_header_init(struct dvb_table_header *header)
Initializes and parses MPEG-TS table header.
dvb_table_header_print
void dvb_table_header_print(struct dvb_v5_fe_parms *parms, const struct dvb_table_header *header)
Prints the content of the MPEG-TS table header.
dvb_table_header
Header of a MPEG-TS table.
Definition header.h:103
dvb_table_header::section_id
uint8_t section_id
Definition header.h:119
dvb_table_header::zero
uint8_t zero
Definition header.h:110
dvb_table_header::syntax
uint8_t syntax
Definition header.h:111
dvb_table_header::version
uint8_t version
Definition header.h:116
dvb_table_header::id
uint16_t id
Definition header.h:114
dvb_table_header::one
uint8_t one
Definition header.h:109
dvb_table_header::section_length
uint16_t section_length
Definition header.h:108
dvb_table_header::one2
uint8_t one2
Definition header.h:117
dvb_table_header::table_id
uint8_t table_id
Definition header.h:104
dvb_table_header::current_next
uint8_t current_next
Definition header.h:115
dvb_table_header::last_section
uint8_t last_section
Definition header.h:120
dvb_table_header::bitfield
uint16_t bitfield
Definition header.h:106
dvb_ts_packet_header
Header of a MPEG-TS transport packet.
Definition header.h:57
dvb_ts_packet_header::pid
uint16_t pid
Definition header.h:62
dvb_ts_packet_header::sync_byte
uint8_t sync_byte
Definition header.h:58
dvb_ts_packet_header::splicing_point
uint8_t splicing_point
Definition header.h:78
dvb_ts_packet_header::transport_priority
uint16_t transport_priority
Definition header.h:63
dvb_ts_packet_header::random_access
uint8_t random_access
Definition header.h:82
dvb_ts_packet_header::transport_scrambling_control
uint8_t transport_scrambling_control
Definition header.h:70
dvb_ts_packet_header::payload_unit_start_indicator
uint16_t payload_unit_start_indicator
Definition header.h:64
dvb_ts_packet_header::extension
uint8_t extension
Definition header.h:76
dvb_ts_packet_header::priority
uint8_t priority
Definition header.h:81
dvb_ts_packet_header::adaptation_field_length
uint8_t adaptation_field_length
Definition header.h:73
dvb_ts_packet_header::transport_error_indicator
uint16_t transport_error_indicator
Definition header.h:65
dvb_ts_packet_header::discontinued
uint8_t discontinued
Definition header.h:83
dvb_ts_packet_header::PCR
uint8_t PCR
Definition header.h:80
dvb_ts_packet_header::OPCR
uint8_t OPCR
Definition header.h:79
dvb_ts_packet_header::adaptation_field_control
uint8_t adaptation_field_control
Definition header.h:69
dvb_ts_packet_header::continuity_counter
uint8_t continuity_counter
Definition header.h:68
dvb_ts_packet_header::bitfield
uint16_t bitfield
Definition header.h:60
dvb_ts_packet_header::private_data
uint8_t private_data
Definition header.h:77
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117