vct.h
Go to the documentation of this file.
/*
* Copyright (c) 2013 - Mauro Carvalho Chehab <mchehab@kernel.org>
* Copyright (c) 2013 - 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 _VCT_H
#define _VCT_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#include <libdvbv5/atsc_header.h>
#define ATSC_TABLE_TVCT 0xc8
#define ATSC_TABLE_CVCT 0xc9
#define ATSC_TABLE_VCT_PID 0x1ffb
struct atsc_table_vct_channel {
uint16_t __short_name[7];
union {
uint32_t bitfield1;
struct {
uint32_t modulation_mode:8;
uint32_t minor_channel_number:10;
uint32_t major_channel_number:10;
uint32_t reserved1:4;
} __attribute__((packed));
} __attribute__((packed));
uint32_t carrier_frequency;
uint16_t channel_tsid;
uint16_t program_number;
union {
uint16_t bitfield2;
struct {
uint16_t service_type:6;
uint16_t reserved2:3;
uint16_t hide_guide:1;
uint16_t out_of_band:1; /* CVCT only */
uint16_t path_select:1; /* CVCT only */
uint16_t hidden:1;
uint16_t access_controlled:1;
uint16_t ETM_location:2;
} __attribute__((packed));
} __attribute__((packed));
uint16_t source_id;
union {
uint16_t bitfield3;
struct {
uint16_t descriptors_length:10;
uint16_t reserved3:6;
} __attribute__((packed));
} __attribute__((packed));
/*
* Everything after atsc_table_vct_channel::descriptor (including it)
* won't be bit-mapped to the data parsed from the MPEG TS. So,
* metadata are added there
*/
struct dvb_desc *descriptor;
struct atsc_table_vct_channel *next;
/* The channel_short_name is converted to locale charset by vct.c */
char short_name[32];
} __attribute__((packed));
struct atsc_table_vct {
struct dvb_table_header header;
uint8_t protocol_version;
uint8_t num_channels_in_section;
struct atsc_table_vct_channel *channel;
struct dvb_desc *descriptor;
} __attribute__((packed));
union atsc_table_vct_descriptor_length {
uint16_t bitfield;
struct {
uint16_t descriptor_length:10;
uint16_t reserved:6;
} __attribute__((packed));
} __attribute__((packed));
#define atsc_vct_channel_foreach(_channel, _vct) \
if (_vct && _vct->channel) \
for (struct atsc_table_vct_channel *_channel = _vct->channel; _channel; _channel = _channel->next) \
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
ssize_t atsc_table_vct_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
ssize_t buflen, struct atsc_table_vct **table);
void atsc_table_vct_free(struct atsc_table_vct *table);
void atsc_table_vct_print(struct dvb_v5_fe_parms *parms,
struct atsc_table_vct *table);
#ifdef __cplusplus
}
#endif
#endif
atsc_header.h
Provides some common ATSC stuff.
atsc_table_vct_free
void atsc_table_vct_free(struct atsc_table_vct *table)
Frees all data allocated by the VCT table parser.
atsc_table_vct_print
void atsc_table_vct_print(struct dvb_v5_fe_parms *parms, struct atsc_table_vct *table)
Prints the content of the VCT table.
atsc_table_vct_init
ssize_t atsc_table_vct_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct atsc_table_vct **table)
Initializes and parses VCT table.
atsc_table_vct_channel
ATSC VCT channel table (covers both CVCT and TVCT).
Definition vct.h:101
atsc_table_vct_channel::program_number
uint16_t program_number
Definition vct.h:116
atsc_table_vct_channel::reserved2
uint16_t reserved2
Definition vct.h:121
atsc_table_vct_channel::access_controlled
uint16_t access_controlled
Definition vct.h:126
atsc_table_vct_channel::reserved3
uint16_t reserved3
Definition vct.h:137
atsc_table_vct_channel::next
struct atsc_table_vct_channel * next
Definition vct.h:147
atsc_table_vct_channel::bitfield2
uint16_t bitfield2
Definition vct.h:118
atsc_table_vct_channel::reserved1
uint32_t reserved1
Definition vct.h:110
atsc_table_vct_channel::descriptor
struct dvb_desc * descriptor
Definition vct.h:146
atsc_table_vct_channel::__short_name
uint16_t __short_name[7]
Definition vct.h:102
atsc_table_vct_channel::short_name
char short_name[32]
Definition vct.h:151
atsc_table_vct_channel::service_type
uint16_t service_type
Definition vct.h:120
atsc_table_vct_channel::out_of_band
uint16_t out_of_band
Definition vct.h:123
atsc_table_vct_channel::modulation_mode
uint32_t modulation_mode
Definition vct.h:107
atsc_table_vct_channel::hide_guide
uint16_t hide_guide
Definition vct.h:122
atsc_table_vct_channel::minor_channel_number
uint32_t minor_channel_number
Definition vct.h:108
atsc_table_vct_channel::ETM_location
uint16_t ETM_location
Definition vct.h:127
atsc_table_vct_channel::major_channel_number
uint32_t major_channel_number
Definition vct.h:109
atsc_table_vct_channel::path_select
uint16_t path_select
Definition vct.h:124
atsc_table_vct_channel::hidden
uint16_t hidden
Definition vct.h:125
atsc_table_vct_channel::channel_tsid
uint16_t channel_tsid
Definition vct.h:115
atsc_table_vct_channel::source_id
uint16_t source_id
Definition vct.h:132
atsc_table_vct_channel::bitfield3
uint16_t bitfield3
Definition vct.h:134
atsc_table_vct_channel::descriptors_length
uint16_t descriptors_length
Definition vct.h:136
atsc_table_vct_channel::bitfield1
uint32_t bitfield1
Definition vct.h:105
atsc_table_vct_channel::carrier_frequency
uint32_t carrier_frequency
Definition vct.h:114
atsc_table_vct
ATSC VCT table (covers both CVCT and TVCT).
Definition vct.h:168
atsc_table_vct::protocol_version
uint8_t protocol_version
Definition vct.h:170
atsc_table_vct::header
struct dvb_table_header header
Definition vct.h:169
atsc_table_vct::channel
struct atsc_table_vct_channel * channel
Definition vct.h:174
atsc_table_vct::num_channels_in_section
uint8_t num_channels_in_section
Definition vct.h:172
atsc_table_vct::descriptor
struct dvb_desc * descriptor
Definition vct.h:175
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_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117
atsc_table_vct_descriptor_length
ATSC VCT descriptor length.
Definition vct.h:187
atsc_table_vct_descriptor_length::descriptor_length
uint16_t descriptor_length
Definition vct.h:190
atsc_table_vct_descriptor_length::bitfield
uint16_t bitfield
Definition vct.h:188
atsc_table_vct_descriptor_length::reserved
uint16_t reserved
Definition vct.h:191