libdvbv5: lib/include/libdvbv5/vct.h Source File

libdvbv5 1.32.0 Library to work with Digital TV devices on Linux

vct.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 - Mauro Carvalho Chehab <mchehab@kernel.org>
3 * Copyright (c) 2013 - Andre Roth <neolynx@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation version 2.1 of the License.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18 *
19 */
20
39
40#ifndef _VCT_H
41#define _VCT_H
42
43#include <stdint.h>
44#include <unistd.h> /* ssize_t */
45
46#include <libdvbv5/atsc_header.h>
47
59#define ATSC_TABLE_TVCT 0xc8
60#define ATSC_TABLE_CVCT 0xc9
61#define ATSC_TABLE_VCT_PID 0x1ffb
62
101 struct atsc_table_vct_channel {
102 uint16_t __short_name[7];
103
104 union {
105 uint32_t bitfield1;
106 struct {
107 uint32_t modulation_mode:8;
108 uint32_t minor_channel_number:10;
109 uint32_t major_channel_number:10;
110 uint32_t reserved1:4;
111 } __attribute__((packed));
112 } __attribute__((packed));
113
114 uint32_t carrier_frequency;
115 uint16_t channel_tsid;
116 uint16_t program_number;
117 union {
118 uint16_t bitfield2;
119 struct {
120 uint16_t service_type:6;
121 uint16_t reserved2:3;
122 uint16_t hide_guide:1;
123 uint16_t out_of_band:1; /* CVCT only */
124 uint16_t path_select:1; /* CVCT only */
125 uint16_t hidden:1;
126 uint16_t access_controlled:1;
127 uint16_t ETM_location:2;
128
129 } __attribute__((packed));
130 } __attribute__((packed));
131
132 uint16_t source_id;
133 union {
134 uint16_t bitfield3;
135 struct {
136 uint16_t descriptors_length:10;
137 uint16_t reserved3:6;
138 } __attribute__((packed));
139 } __attribute__((packed));
140
141 /*
142 * Everything after atsc_table_vct_channel::descriptor (including it)
143 * won't be bit-mapped to the data parsed from the MPEG TS. So,
144 * metadata are added there
145 */
146 struct dvb_desc *descriptor;
147 struct atsc_table_vct_channel *next;
148
149 /* The channel_short_name is converted to locale charset by vct.c */
150
151 char short_name[32];
152} __attribute__((packed));
153
168 struct atsc_table_vct {
169 struct dvb_table_header header;
170 uint8_t protocol_version;
171
172 uint8_t num_channels_in_section;
173
174 struct atsc_table_vct_channel *channel;
175 struct dvb_desc *descriptor;
176} __attribute__((packed));
177
187 union atsc_table_vct_descriptor_length {
188 uint16_t bitfield;
189 struct {
190 uint16_t descriptor_length:10;
191 uint16_t reserved:6;
192 } __attribute__((packed));
193} __attribute__((packed));
194
202 #define atsc_vct_channel_foreach(_channel, _vct) \
203 if (_vct && _vct->channel) \
204 for (struct atsc_table_vct_channel *_channel = _vct->channel; _channel; _channel = _channel->next) \
205
206struct dvb_v5_fe_parms;
207
208#ifdef __cplusplus
209extern "C" {
210#endif
211
228ssize_t atsc_table_vct_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
229 ssize_t buflen, struct atsc_table_vct **table);
236 void atsc_table_vct_free(struct atsc_table_vct *table);
244 void atsc_table_vct_print(struct dvb_v5_fe_parms *parms,
245 struct atsc_table_vct *table);
246
247#ifdef __cplusplus
248}
249#endif
250
251#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