DVB: make scanning fully independent of Linux DVB
[vlc.git] / modules / access / dvb / scan.h
1 /*****************************************************************************
2  * scan.h : functions to ease DVB scanning
3  *****************************************************************************
4  * Copyright (C) 2008,2010 the VideoLAN team
5  *
6  * Authors: Laurent Aimar <fenrir@videolan.org>
7  *          David Kaplan <david@2of1.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA    02111, USA.
22  *****************************************************************************/
23
24 typedef enum
25 {
26     SCAN_NONE,
27     SCAN_DVB_T,
28     SCAN_DVB_S,
29     SCAN_DVB_C,
30 } scan_type_t;
31
32 typedef struct
33 {
34     int i_frequency;
35     int i_symbol_rate;
36     int i_fec;
37     char c_polarization;
38 } scan_dvbs_transponder_t;
39
40 typedef struct scan_parameter_t
41 {
42     scan_type_t type;
43     bool b_exhaustive;
44     bool b_use_nit;
45     bool b_free_only;
46
47     struct
48     {
49         int i_min;
50         int i_max;
51         int i_step;
52
53         int i_count;    /* Number of frequency test to do */
54     } frequency;
55
56     struct
57     {
58         /* Bandwidth should be 6, 7 or 8 */
59         int i_min;
60         int i_max;
61         int i_step;
62
63         int i_count;
64     } bandwidth;
65
66     struct
67     {
68         char *psz_name;         /* satellite name */
69         char *psz_path;         /* config file path */
70
71         scan_dvbs_transponder_t *p_transponders;
72         int i_count;
73     } sat_info;
74 } scan_parameter_t;
75
76 typedef struct
77 {
78     int i_frequency;
79     union
80     {
81         int i_bandwidth;
82         int i_symbol_rate;
83     };
84     int i_fec;
85     char c_polarization;
86 } scan_configuration_t;
87
88 typedef struct scan_t scan_t;
89
90 scan_t *scan_New( vlc_object_t *p_obj, const scan_parameter_t *p_parameter );
91 void scan_Destroy( scan_t *p_scan );
92
93 int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg );
94
95 block_t *scan_GetM3U( scan_t *p_scan );
96 bool scan_IsCancelled( scan_t *p_scan );
97
98 typedef struct scan_session_t scan_session_t;
99
100 scan_session_t *scan_session_New( vlc_object_t *,
101                                   const scan_configuration_t * );
102 void scan_session_Destroy( scan_t *, scan_session_t * );
103 bool scan_session_Push( scan_session_t *p_scan, block_t *p_block );
104 void scan_service_SetSNR( scan_session_t *p_scan, int i_snr );
105