dvb: initial support on scanning symbolrates on dvb-c and set default symbolrate...
[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     bool b_modulation_set;
47     bool b_symbolrate_set;
48
49     int i_modulation;
50     int i_symbolrate;
51     struct
52     {
53         int i_min;
54         int i_max;
55         int i_step;
56
57         int i_count;    /* Number of frequency test to do */
58     } frequency;
59
60     struct
61     {
62         /* Bandwidth should be 6, 7 or 8 */
63         int i_min;
64         int i_max;
65         int i_step;
66
67         int i_count;
68     } bandwidth;
69
70     struct
71     {
72         char *psz_name;         /* satellite name */
73         char *psz_path;         /* config file path */
74
75         scan_dvbs_transponder_t *p_transponders;
76         int i_count;
77     } sat_info;
78 } scan_parameter_t;
79
80 typedef struct
81 {
82     int i_frequency;
83     union
84     {
85         int i_bandwidth;
86         int i_symbol_rate;
87     };
88     int i_fec;
89     int i_modulation;
90     int i_symbolrate;
91     char c_polarization;
92 } scan_configuration_t;
93
94 typedef struct scan_t scan_t;
95
96 scan_t *scan_New( vlc_object_t *p_obj, const scan_parameter_t *p_parameter );
97 void scan_Destroy( scan_t *p_scan );
98
99 int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg );
100
101 block_t *scan_GetM3U( scan_t *p_scan );
102 bool scan_IsCancelled( scan_t *p_scan );
103
104 typedef struct scan_session_t scan_session_t;
105
106 scan_session_t *scan_session_New( vlc_object_t *,
107                                   const scan_configuration_t * );
108 void scan_session_Destroy( scan_t *, scan_session_t * );
109 bool scan_session_Push( scan_session_t *p_scan, block_t *p_block );
110 void scan_service_SetSNR( scan_session_t *p_scan, int i_snr );
111