libdvbv5  1.4.0
Library to work with Digital TV streams
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 
36 /* According with ISO/IEC 13818-1:2007 */
37 
38 #define MAX_TABLE_SIZE 1024 * 1024
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 struct dvb_entry;
45 
54  struct dvb_table_pat_program *pat_pgm;
55  struct dvb_table_pmt *pmt;
56 };
57 
75  uint32_t delivery_system;
76 
77  struct dvb_entry *entry;
78  unsigned num_entry;
79 
80  struct dvb_table_pat *pat;
81  struct atsc_table_vct *vct;
83  struct dvb_table_nit *nit;
84  struct dvb_table_sdt *sdt;
85 
86  unsigned num_program;
87 };
88 
103  /* Input data */
104  unsigned char tid;
105  uint16_t pid;
106  int ts_id;
107  void **table;
108 
110 
111  /*
112  * Private temp data used by dvb_read_sections().
113  * Should not be filled outside dvb-scan.c, as they'll be
114  * overrided
115  */
116  void *priv;
117 };
124 void dvb_table_filter_free(struct dvb_table_filter *sect);
125 
165 int dvb_read_section(struct dvb_v5_fe_parms *parms, int dmx_fd,
166  unsigned char tid, uint16_t pid, void **table,
167  unsigned timeout);
168 
186  int dvb_read_section_with_id(struct dvb_v5_fe_parms *parms, int dmx_fd,
187  unsigned char tid, uint16_t pid, int ts_id,
188  void **table, unsigned timeout);
189 
202 int dvb_read_sections(struct dvb_v5_fe_parms *parms, int dmx_fd,
203  struct dvb_table_filter *sect,
204  unsigned timeout);
205 
214 
220 void dvb_scan_free_handler_table(struct dvb_v5_descriptors *dvb_scan_handler);
221 
241 struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *parms, int dmx_fd,
242  uint32_t delivery_system,
243  unsigned other_nit,
244  unsigned timeout_multiply);
245 
255 
256 typedef int (check_frontend_t)(void *args, struct dvb_v5_fe_parms *parms);
257 
303  struct dvb_entry *entry,
304  int dmx_fd,
305  check_frontend_t *check_frontend,
306  void *args,
307  unsigned other_nit,
308  unsigned timeout_multiply);
309 
310 
353  struct dvb_v5_descriptors *dvb_scan_handler,
354  struct dvb_entry *first_entry,
355  struct dvb_entry *entry);
356 
357 /*
358  * Some ancillary functions used internally inside the library, used to
359  * identify duplicated transport streams and add new found transponder entries
360  */
361 int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *parms);
362 
363 int dvb_new_freq_is_needed(struct dvb_entry *entry, struct dvb_entry *last_entry,
364  uint32_t freq, enum dvb_sat_polarization pol, int shift);
365 
366 struct dvb_entry *dvb_scan_add_entry(struct dvb_v5_fe_parms *parms,
367  struct dvb_entry *first_entry,
368  struct dvb_entry *entry,
369  uint32_t freq, uint32_t shift,
370  enum dvb_sat_polarization pol);
371 
372 void dvb_update_transponders(struct dvb_v5_fe_parms *parms,
373  struct dvb_v5_descriptors *dvb_scan_handler,
374  struct dvb_entry *first_entry,
375  struct dvb_entry *entry);
376 
377 
378 #ifdef __cplusplus
379 }
380 #endif
381 
382 #endif
struct dvb_entry * entry
Definition: dvb-scan.h:77
struct dvb_v5_descriptors_program * program
Definition: dvb-scan.h:82
void ** table
Definition: dvb-scan.h:107
int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *parms)
unsigned num_entry
Definition: dvb-scan.h:78
Provides interfaces to deal with DVB Satellite systems.
int( check_frontend_t)(void *args, struct dvb_v5_fe_parms *parms)
Definition: dvb-scan.h:256
struct dvb_table_nit * nit
Definition: dvb-scan.h:83
struct dvb_table_sdt * sdt
Definition: dvb-scan.h:84
unsigned char tid
Definition: dvb-scan.h:104
struct dvb_table_pmt * pmt
Definition: dvb-scan.h:55
struct dvb_v5_descriptors * dvb_scan_alloc_handler_table(uint32_t delivery_system)
allocates a struct dvb_v5_descriptors
struct dvb_entry * dvb_scan_add_entry(struct dvb_v5_fe_parms *parms, struct dvb_entry *first_entry, struct dvb_entry *entry, uint32_t freq, uint32_t shift, enum dvb_sat_polarization pol)
int dvb_new_freq_is_needed(struct dvb_entry *entry, struct dvb_entry *last_entry, uint32_t freq, enum dvb_sat_polarization pol, int shift)
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...
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
uint16_t pid
Definition: dvb-scan.h:105
void dvb_scan_free_handler_table(struct dvb_v5_descriptors *dvb_scan_handler)
frees a struct dvb_v5_descriptors
struct atsc_table_vct * vct
Definition: dvb-scan.h:81
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
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:113
void dvb_table_filter_free(struct dvb_table_filter *sect)
deallocates all data associated with a table filter
uint32_t delivery_system
Definition: dvb-scan.h:75
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
unsigned num_program
Definition: dvb-scan.h:86
struct dvb_table_pat * pat
Definition: dvb-scan.h:80
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:93
void dvb_free_ts_tables(struct dvb_v5_descriptors *dvb_desc)
frees a struct dvb_v5_descriptors
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.
Associates PMT with PAT tables.
Definition: dvb-scan.h:53
int allow_section_gaps
Definition: dvb-scan.h:109
Represents one entry on a DTV file.
Definition: dvb-file.h:92
Contains the descriptors needed to scan the Service ID and other relevant info at a MPEG-TS Digital T...
Definition: dvb-scan.h:74
Provides a way to handle MPEG-TS descriptors found on Digital TV streams.
void dvb_update_transponders(struct dvb_v5_fe_parms *parms, struct dvb_v5_descriptors *dvb_scan_handler, struct dvb_entry *first_entry, struct dvb_entry *entry)
dvb_sat_polarization
enum dvb_sat_polarization - Polarization types for Satellite systems
Definition: dvb-v5-std.h:115
struct dvb_table_pat_program * pat_pgm
Definition: dvb-scan.h:54
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.
Describes the PES filters used by DVB scan.
Definition: dvb-scan.h:102