libdvbv5  1.11.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 modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation version 2.1 of the License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
17  */
18 #ifndef _LIBSCAN_H
19 #define _LIBSCAN_H
20 
21 #include <stdint.h>
22 #include <linux/dvb/dmx.h>
23 #include <libdvbv5/descriptors.h>
24 #include <libdvbv5/dvb-sat.h>
25 
37 /* According with ISO/IEC 13818-1:2007 */
38 
39 #define MAX_TABLE_SIZE 1024 * 1024
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 struct dvb_entry;
46 
57  struct dvb_table_pmt *pmt;
58 };
59 
88  uint32_t delivery_system;
89 
90  struct dvb_entry *entry;
91  unsigned num_entry;
92 
93  struct dvb_table_pat *pat;
96  struct dvb_table_nit *nit;
97  struct dvb_table_sdt *sdt;
98 
99  unsigned num_program;
100 
102  unsigned num_other_nits;
103 
105  unsigned num_other_sdts;
106 };
107 
123  /* Input data */
124  unsigned char tid;
125  uint16_t pid;
126  int ts_id;
127  void **table;
128 
130 
131  /*
132  * Private temp data used by dvb_read_sections().
133  * Should not be filled outside dvb-scan.c, as they'll be
134  * overrided
135  */
136  void *priv;
137 };
144 void dvb_table_filter_free(struct dvb_table_filter *sect);
145 
186 int dvb_read_section(struct dvb_v5_fe_parms *parms, int dmx_fd,
187  unsigned char tid, uint16_t pid, void **table,
188  unsigned timeout);
189 
208  int dvb_read_section_with_id(struct dvb_v5_fe_parms *parms, int dmx_fd,
209  unsigned char tid, uint16_t pid, int ts_id,
210  void **table, unsigned timeout);
211 
225 int dvb_read_sections(struct dvb_v5_fe_parms *parms, int dmx_fd,
226  struct dvb_table_filter *sect,
227  unsigned timeout);
228 
238 
245 void dvb_scan_free_handler_table(struct dvb_v5_descriptors *dvb_scan_handler);
246 
268 struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *parms, int dmx_fd,
269  uint32_t delivery_system,
270  unsigned other_nit,
271  unsigned timeout_multiply);
272 
283 
293 typedef int (check_frontend_t)(void *args, struct dvb_v5_fe_parms *parms);
294 
341  struct dvb_entry *entry,
342  int dmx_fd,
343  check_frontend_t *check_frontend,
344  void *args,
345  unsigned other_nit,
346  unsigned timeout_multiply);
347 
348 
392  struct dvb_v5_descriptors *dvb_scan_handler,
393  struct dvb_entry *first_entry,
394  struct dvb_entry *entry);
395 
396 #ifndef _DOXYGEN
397 /*
398  * Some ancillary functions used internally inside the library, used to
399  * identify duplicated transport streams and add new found transponder entries
400  */
401 int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *parms);
402 
403 int dvb_new_freq_is_needed(struct dvb_entry *entry, struct dvb_entry *last_entry,
404  uint32_t freq, enum dvb_sat_polarization pol, int shift);
405 
406 struct dvb_entry *dvb_scan_add_entry(struct dvb_v5_fe_parms *parms,
407  struct dvb_entry *first_entry,
408  struct dvb_entry *entry,
409  uint32_t freq, uint32_t shift,
410  enum dvb_sat_polarization pol);
411 
412 int dvb_new_entry_is_needed(struct dvb_entry *entry,
413  struct dvb_entry *last_entry,
414  uint32_t freq, int shift,
415  enum dvb_sat_polarization pol, uint32_t stream_id);
416 
417 struct dvb_entry *dvb_scan_add_entry_ex(struct dvb_v5_fe_parms *parms,
418  struct dvb_entry *first_entry,
419  struct dvb_entry *entry,
420  uint32_t freq, uint32_t shift,
421  enum dvb_sat_polarization pol,
422  uint32_t stream_id);
423 
424 void dvb_update_transponders(struct dvb_v5_fe_parms *parms,
425  struct dvb_v5_descriptors *dvb_scan_handler,
426  struct dvb_entry *first_entry,
427  struct dvb_entry *entry);
428 #endif
429 
430 #ifdef __cplusplus
431 }
432 #endif
433 
434 #endif
struct dvb_entry * entry
Definition: dvb-scan.h:90
struct dvb_v5_descriptors_program * program
Definition: dvb-scan.h:95
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:127
unsigned num_entry
Definition: dvb-scan.h:91
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 ** other_nits
Definition: dvb-scan.h:101
struct dvb_table_nit * nit
Definition: dvb-scan.h:96
struct dvb_table_sdt * sdt
Definition: dvb-scan.h:97
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 num_other_nits
Definition: dvb-scan.h:102
unsigned char tid
Definition: dvb-scan.h:124
struct dvb_table_pmt * pmt
Definition: dvb-scan.h:57
MPEG-TS NIT table.
Definition: nit.h:143
MPEG-TS SDT table.
Definition: sdt.h:123
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...
struct dvb_table_sdt ** other_sdts
Definition: dvb-scan.h:104
uint16_t pid
Definition: dvb-scan.h:125
unsigned num_other_sdts
Definition: dvb-scan.h:105
struct atsc_table_vct * vct
Definition: dvb-scan.h:94
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
MPEG-TS PMT table.
Definition: pmt.h:203
uint32_t delivery_system
Definition: dvb-scan.h:88
unsigned num_program
Definition: dvb-scan.h:99
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:93
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:117
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:293
MPEG-TS PAT table.
Definition: pat.h:108
dvb_sat_polarization
Polarization types for Satellite systems.
Definition: dvb-v5-std.h:138
Associates PMT with PAT tables.
Definition: dvb-scan.h:55
int allow_section_gaps
Definition: dvb-scan.h:129
Represents one entry on a DTV file.
Definition: dvb-file.h:104
Contains the descriptors needed to scan the Service ID and other relevant info at a MPEG-TS Digital T...
Definition: dvb-scan.h:87
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:77
struct dvb_table_pat_program * pat_pgm
Definition: dvb-scan.h:56
Describes the PES filters used by DVB scan.
Definition: dvb-scan.h:122