libdvbv5  1.11.0
Library to work with Digital TV devices on Linux
sdt.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2012 - Mauro Carvalho Chehab
3  * Copyright (c) 2012 - 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 
21 #ifndef _SDT_H
22 #define _SDT_H
23 
42 #include <stdint.h>
43 #include <unistd.h> /* ssize_t */
44 
45 #include <libdvbv5/header.h>
46 
58 #define DVB_TABLE_SDT 0x42
59 #define DVB_TABLE_SDT2 0x46
60 #define DVB_TABLE_SDT_PID 0x0011
61 
88  uint16_t service_id;
90  uint8_t EIT_schedule:1;
91  uint8_t reserved:6;
92  union {
93  uint16_t bitfield;
94  struct {
95  uint16_t desc_length:12;
96  uint16_t free_CA_mode:1;
97  uint16_t running_status:3;
98  } __attribute__((packed));
99  } __attribute__((packed));
102 } __attribute__((packed));
103 
125  uint16_t network_id;
126  uint8_t reserved;
128 } __attribute__((packed));
129 
137 #define dvb_sdt_service_foreach(_service, _sdt) \
138  for (struct dvb_table_sdt_service *_service = _sdt->service; _service; _service = _service->next ) \
139 
140 struct dvb_v5_fe_parms;
141 
142 #ifdef __cplusplus
143 extern "C" {
144 #endif
145 
162 ssize_t dvb_table_sdt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
163  ssize_t buflen, struct dvb_table_sdt **table);
164 
171 void dvb_table_sdt_free(struct dvb_table_sdt *table);
172 
180 void dvb_table_sdt_print(struct dvb_v5_fe_parms *parms, struct dvb_table_sdt *table);
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif
uint16_t network_id
Definition: sdt.h:125
Header of a MPEG-TS table.
Definition: header.h:92
uint8_t EIT_schedule
Definition: sdt.h:90
Provides the MPEG TS table headers.
MPEG-TS SDT service table.
Definition: sdt.h:87
struct dvb_desc * descriptor
Definition: sdt.h:100
uint8_t EIT_present_following
Definition: sdt.h:89
MPEG-TS SDT table.
Definition: sdt.h:123
uint8_t reserved
Definition: sdt.h:91
uint16_t service_id
Definition: sdt.h:88
void dvb_table_sdt_print(struct dvb_v5_fe_parms *parms, struct dvb_table_sdt *table)
Prints the content of the SDT table.
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117
struct dvb_table_sdt_service * service
Definition: sdt.h:127
uint16_t desc_length
Definition: sdt.h:95
void dvb_table_sdt_free(struct dvb_table_sdt *table)
Frees all data allocated by the SDT table parser.
struct dvb_table_sdt_service * next
Definition: sdt.h:101
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:117
uint16_t bitfield
Definition: sdt.h:93
uint8_t reserved
Definition: sdt.h:126
struct dvb_table_header header
Definition: sdt.h:124
ssize_t dvb_table_sdt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_sdt **table)
Initializes and parses SDT table.
uint16_t free_CA_mode
Definition: sdt.h:96
uint16_t running_status
Definition: sdt.h:97