libdvbv5  1.6.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
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation version 2
8  * of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  *
20  */
21 
41 #ifndef _VCT_H
42 #define _VCT_H
43 
44 #include <stdint.h>
45 #include <unistd.h> /* ssize_t */
46 
47 #include <libdvbv5/atsc_header.h>
48 
60 #define ATSC_TABLE_TVCT 0xc8
61 #define ATSC_TABLE_CVCT 0xc9
62 #define ATSC_TABLE_VCT_PID 0x1ffb
63 
103  uint16_t __short_name[7];
104 
105  union {
106  uint32_t bitfield1;
107  struct {
108  uint32_t modulation_mode:8;
109  uint32_t minor_channel_number:10;
110  uint32_t major_channel_number:10;
111  uint32_t reserved1:4;
112  } __attribute__((packed));
113  } __attribute__((packed));
114 
116  uint16_t channel_tsid;
117  uint16_t program_number;
118  union {
119  uint16_t bitfield2;
120  struct {
121  uint16_t service_type:6;
122  uint16_t reserved2:3;
123  uint16_t hide_guide:1;
124  uint16_t out_of_band:1; /* CVCT only */
125  uint16_t path_select:1; /* CVCT only */
126  uint16_t hidden:1;
127  uint16_t access_controlled:1;
128  uint16_t ETM_location:2;
129 
130  } __attribute__((packed));
131  } __attribute__((packed));
132 
133  uint16_t source_id;
134  union {
135  uint16_t bitfield3;
136  struct {
137  uint16_t descriptors_length:10;
138  uint16_t reserved3:6;
139  } __attribute__((packed));
140  } __attribute__((packed));
141 
142  /*
143  * Everything after atsc_table_vct_channel::descriptor (including it)
144  * won't be bit-mapped to the data parsed from the MPEG TS. So,
145  * metadata are added there
146  */
149 
150  /* The channel_short_name is converted to locale charset by vct.c */
151 
152  char short_name[32];
153 } __attribute__((packed));
154 
172 
174 
177 } __attribute__((packed));
178 
189  uint16_t bitfield;
190  struct {
191  uint16_t descriptor_length:10;
192  uint16_t reserved:6;
193  } __attribute__((packed));
194 } __attribute__((packed));
195 
203  #define atsc_vct_channel_foreach(_channel, _vct) \
204  for (struct atsc_table_vct_channel *_channel = _vct->channel; _channel; _channel = _channel->next) \
205 
206 struct dvb_v5_fe_parms;
207 
208 #ifdef __cplusplus
209 extern "C" {
210 #endif
211 
228 ssize_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
uint16_t hide_guide
Definition: vct.h:123
char short_name[32]
Definition: vct.h:152
uint8_t num_channels_in_section
Definition: vct.h:173
uint32_t bitfield1
Definition: vct.h:106
Header of a MPEG-TS table.
Definition: header.h:93
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:119
uint16_t reserved3
Definition: vct.h:138
uint16_t path_select
Definition: vct.h:125
struct atsc_table_vct_channel * next
Definition: vct.h:148
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:135
uint16_t service_type
Definition: vct.h:121
uint32_t minor_channel_number
Definition: vct.h:109
uint16_t descriptors_length
Definition: vct.h:137
uint16_t ETM_location
Definition: vct.h:128
uint16_t __short_name[7]
Definition: vct.h:103
uint16_t channel_tsid
Definition: vct.h:116
uint16_t access_controlled
Definition: vct.h:127
uint32_t major_channel_number
Definition: vct.h:110
struct dvb_table_header header
Definition: vct.h:170
uint16_t hidden
Definition: vct.h:126
uint16_t reserved2
Definition: vct.h:122
ATSC VCT table (covers both CVCT and TVCT)
Definition: vct.h:169
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:118
uint16_t out_of_band
Definition: vct.h:124
ATSC VCT descriptor length.
Definition: vct.h:188
ATSC VCT channel table (covers both CVCT and TVCT)
Definition: vct.h:102
uint32_t reserved1
Definition: vct.h:111
uint16_t program_number
Definition: vct.h:117
struct dvb_desc * descriptor
Definition: vct.h:147
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:118
uint32_t carrier_frequency
Definition: vct.h:115
struct atsc_table_vct_channel * channel
Definition: vct.h:175
struct dvb_desc * descriptor
Definition: vct.h:176
uint16_t source_id
Definition: vct.h:133
uint8_t protocol_version
Definition: vct.h:171
uint32_t modulation_mode
Definition: vct.h:108
Provides some common ATSC stuff.