libdvbv5  1.11.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 <m.chehab@samsung.com>
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 
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 
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 
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  */
148 
149  /* The channel_short_name is converted to locale charset by vct.c */
150 
151  char short_name[32];
152 } __attribute__((packed));
153 
171 
173 
176 } __attribute__((packed));
177 
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  for (struct atsc_table_vct_channel *_channel = _vct->channel; _channel; _channel = _channel->next) \
204 
205 struct dvb_v5_fe_parms;
206 
207 #ifdef __cplusplus
208 extern "C" {
209 #endif
210 
227 ssize_t atsc_table_vct_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
228  ssize_t buflen, struct atsc_table_vct **table);
235 void atsc_table_vct_free(struct atsc_table_vct *table);
243 void atsc_table_vct_print(struct dvb_v5_fe_parms *parms,
244  struct atsc_table_vct *table);
245 
246 #ifdef __cplusplus
247 }
248 #endif
249 
250 #endif
uint16_t hide_guide
Definition: vct.h:122
char short_name[32]
Definition: vct.h:151
uint8_t num_channels_in_section
Definition: vct.h:172
uint32_t bitfield1
Definition: vct.h:105
Header of a MPEG-TS table.
Definition: header.h:92
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.
uint16_t bitfield2
Definition: vct.h:118
uint16_t reserved3
Definition: vct.h:137
uint16_t path_select
Definition: vct.h:124
struct atsc_table_vct_channel * next
Definition: vct.h:147
void atsc_table_vct_print(struct dvb_v5_fe_parms *parms, struct atsc_table_vct *table)
Prints the content of the VCT table.
void atsc_table_vct_free(struct atsc_table_vct *table)
Frees all data allocated by the VCT table parser.
uint16_t bitfield3
Definition: vct.h:134
uint16_t service_type
Definition: vct.h:120
uint32_t minor_channel_number
Definition: vct.h:108
uint16_t descriptors_length
Definition: vct.h:136
uint16_t ETM_location
Definition: vct.h:127
uint16_t __short_name[7]
Definition: vct.h:102
uint16_t channel_tsid
Definition: vct.h:115
uint16_t access_controlled
Definition: vct.h:126
uint32_t major_channel_number
Definition: vct.h:109
struct dvb_table_header header
Definition: vct.h:169
uint16_t hidden
Definition: vct.h:125
uint16_t reserved2
Definition: vct.h:121
ATSC VCT table (covers both CVCT and TVCT)
Definition: vct.h:168
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117
uint16_t out_of_band
Definition: vct.h:123
ATSC VCT descriptor length.
Definition: vct.h:187
ATSC VCT channel table (covers both CVCT and TVCT)
Definition: vct.h:101
uint32_t reserved1
Definition: vct.h:110
uint16_t program_number
Definition: vct.h:116
struct dvb_desc * descriptor
Definition: vct.h:146
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:117
uint32_t carrier_frequency
Definition: vct.h:114
struct atsc_table_vct_channel * channel
Definition: vct.h:174
struct dvb_desc * descriptor
Definition: vct.h:175
uint16_t source_id
Definition: vct.h:132
uint8_t protocol_version
Definition: vct.h:170
uint32_t modulation_mode
Definition: vct.h:107
Provides some common ATSC stuff.