libdvbv5  1.6.0
Library to work with Digital TV devices on Linux
dvb-scan.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2014 - Mauro Carvalho Chehab
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation version 2
7  * 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 General Public License for more details.
13  *
14  * You should have received a copy of the GNU 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 #ifndef _LIBSCAN_H
20 #define _LIBSCAN_H
21 
22 #include <stdint.h>
23 #include <linux/dvb/dmx.h>
24 #include <libdvbv5/descriptors.h>
25 #include <libdvbv5/dvb-sat.h>
26 
38 /* According with ISO/IEC 13818-1:2007 */
39 
40 #define MAX_TABLE_SIZE 1024 * 1024
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 struct dvb_entry;
47 
58  struct dvb_table_pmt *pmt;
59 };
60 
79  uint32_t delivery_system;
80 
81  struct dvb_entry *entry;
82  unsigned num_entry;
83 
84  struct dvb_table_pat *pat;
87  struct dvb_table_nit *nit;
88  struct dvb_table_sdt *sdt;
89 
90  unsigned num_program;
91 };
92 
108  /* Input data */
109  unsigned char tid;
110  uint16_t pid;
111  int ts_id;
112  void **table;
113 
115 
116  /*
117  * Private temp data used by dvb_read_sections().
118  * Should not be filled outside dvb-scan.c, as they'll be
119  * overrided
120  */
121  void *priv;
122 };
129 void dvb_table_filter_free(struct dvb_table_filter *sect);
130 
171 int dvb_read_section(struct dvb_v5_fe_parms *parms, int dmx_fd,
172  unsigned char tid, uint16_t pid, void **table,
173  unsigned timeout);
174 
193  int dvb_read_section_with_id(struct dvb_v5_fe_parms *parms, int dmx_fd,
194  unsigned char tid, uint16_t pid, int ts_id,
195  void **table, unsigned timeout);
196 
210 int dvb_read_sections(struct dvb_v5_fe_parms *parms, int dmx_fd,
211  struct dvb_table_filter *sect,
212  unsigned timeout);
213 
223 
230 void dvb_scan_free_handler_table(struct dvb_v5_descriptors *dvb_scan_handler);
231 
253 struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *parms, int dmx_fd,
254  uint32_t delivery_system,
255  unsigned other_nit,
256  unsigned timeout_multiply);
257 
268 
278 typedef int (check_frontend_t)(void *args, struct dvb_v5_fe_parms *parms);
279 
326  struct dvb_entry *entry,
327  int dmx_fd,
328  check_frontend_t *check_frontend,
329  void *args,
330  unsigned other_nit,
331  unsigned timeout_multiply);
332 
333 
377  struct dvb_v5_descriptors *dvb_scan_handler,
378  struct dvb_entry *first_entry,
379  struct dvb_entry *entry);
380 
381 #ifndef _DOXYGEN
382 /*
383  * Some ancillary functions used internally inside the library, used to
384  * identify duplicated transport streams and add new found transponder entries
385  */
386 int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *parms);
387 
388 int dvb_new_freq_is_needed(struct dvb_entry *entry, struct dvb_entry *last_entry,
389  uint32_t freq, enum dvb_sat_polarization pol, int shift);
390 
391 struct dvb_entry *dvb_scan_add_entry(struct dvb_v5_fe_parms *parms,
392  struct dvb_entry *first_entry,
393  struct dvb_entry *entry,
394  uint32_t freq, uint32_t shift,
395  enum dvb_sat_polarization pol);
396 
397 void dvb_update_transponders(struct dvb_v5_fe_parms *parms,
398  struct dvb_v5_descriptors *dvb_scan_handler,
399  struct dvb_entry *first_entry,
400  struct dvb_entry *entry);
401 #endif
402 
403 #ifdef __cplusplus
404 }
405 #endif
406 
407 #endif
struct dvb_entry * entry
Definition: dvb-scan.h:81
struct dvb_v5_descriptors_program * program
Definition: dvb-scan.h:86
void dvb_add_scaned_transponders(struct dvb_v5_fe_parms *parms, struct dvb_v5_descriptors *dvb_scan_handler, struct dvb_entry *first_entry, struct dvb_entry *entry)
Add new transponders to a dvb_file.
void ** table
Definition: dvb-scan.h:112
unsigned num_entry
Definition: dvb-scan.h:82
int dvb_read_section(struct dvb_v5_fe_parms *parms, int dmx_fd, unsigned char tid, uint16_t pid, void **table, unsigned timeout)
read MPEG-TS tables that comes from a DTV card
Provides interfaces to deal with DVB Satellite systems.
void dvb_scan_free_handler_table(struct dvb_v5_descriptors *dvb_scan_handler)
frees a struct dvb_v5_descriptors
void dvb_table_filter_free(struct dvb_table_filter *sect)
deallocates all data associated with a table filter
int dvb_read_sections(struct dvb_v5_fe_parms *parms, int dmx_fd, struct dvb_table_filter *sect, unsigned timeout)
read MPEG-TS tables that comes from a DTV card
struct dvb_table_nit * nit
Definition: dvb-scan.h:87
struct dvb_table_sdt * sdt
Definition: dvb-scan.h:88
struct dvb_v5_descriptors * dvb_scan_transponder(struct dvb_v5_fe_parms *parms, struct dvb_entry *entry, int dmx_fd, check_frontend_t *check_frontend, void *args, unsigned other_nit, unsigned timeout_multiply)
Scans a DVB dvb_add_scaned_transponder.
unsigned char tid
Definition: dvb-scan.h:109
struct dvb_table_pmt * pmt
Definition: dvb-scan.h:58
MPEG-TS NIT table.
Definition: nit.h:144
MPEG-TS SDT table.
Definition: sdt.h:124
struct dvb_v5_descriptors * dvb_get_ts_tables(struct dvb_v5_fe_parms *parms, int dmx_fd, uint32_t delivery_system, unsigned other_nit, unsigned timeout_multiply)
Scans a DVB stream, looking for the tables needed to identify the programs inside a MPEG-TS...
uint16_t pid
Definition: dvb-scan.h:110
struct atsc_table_vct * vct
Definition: dvb-scan.h:85
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
MPEG-TS PMT table.
Definition: pmt.h:204
uint32_t delivery_system
Definition: dvb-scan.h:79
unsigned num_program
Definition: dvb-scan.h:90
int dvb_read_section_with_id(struct dvb_v5_fe_parms *parms, int dmx_fd, unsigned char tid, uint16_t pid, int ts_id, void **table, unsigned timeout)
read MPEG-TS tables that comes from a DTV card with an specific table section ID
struct dvb_v5_descriptors * dvb_scan_alloc_handler_table(uint32_t delivery_system)
allocates a struct dvb_v5_descriptors
struct dvb_table_pat * pat
Definition: dvb-scan.h:84
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:118
int( check_frontend_t)(void *args, struct dvb_v5_fe_parms *parms)
Callback for the application to show the frontend status.
Definition: dvb-scan.h:278
MPEG-TS PAT table.
Definition: pat.h:109
dvb_sat_polarization
Polarization types for Satellite systems.
Definition: dvb-v5-std.h:134
Associates PMT with PAT tables.
Definition: dvb-scan.h:56
int allow_section_gaps
Definition: dvb-scan.h:114
Represents one entry on a DTV file.
Definition: dvb-file.h:102
Contains the descriptors needed to scan the Service ID and other relevant info at a MPEG-TS Digital T...
Definition: dvb-scan.h:78
void dvb_free_ts_tables(struct dvb_v5_descriptors *dvb_desc)
frees a struct dvb_v5_descriptors
Provides a way to handle MPEG-TS descriptors found on Digital TV streams.
MPEG-TS PAT program table.
Definition: pat.h:78
struct dvb_table_pat_program * pat_pgm
Definition: dvb-scan.h:57
Describes the PES filters used by DVB scan.
Definition: dvb-scan.h:107