contrib: soxr: enable by default
[vlc.git] / modules / access / dtv / dtv.h
blobb1323ed9781bbc3a0666e9dc5ddda80f574efbff
1 /**
2 * @file dtv.h
3 * @brief Digital TV module common header
4 */
5 /*****************************************************************************
6 * Copyright © 2011 Rémi Denis-Courmont
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 #ifndef VLC_DTV_H
24 # define VLC_DTV_H 1
25 # ifdef __cplusplus
26 extern "C" {
27 # endif
29 typedef enum {
30 DTV_DELIVERY_NONE = 0x00000000,
31 DTV_DELIVERY_ATSC = 0x00000001,
32 DTV_DELIVERY_CQAM = 0x00000002,
34 DTV_DELIVERY_DVB_C = 0x00000010,
35 DTV_DELIVERY_DVB_C2 = 0x00000020,
36 DTV_DELIVERY_DVB_S = 0x00000040,
37 DTV_DELIVERY_DVB_S2 = 0x00000080,
38 DTV_DELIVERY_DVB_T = 0x00000100,
39 DTV_DELIVERY_DVB_T2 = 0x00000200,
41 DTV_DELIVERY_ISDB_C = 0x00001000,
42 DTV_DELIVERY_ISDB_S = 0x00002000,
43 DTV_DELIVERY_ISDB_T = 0x00004000,
44 } dtv_delivery_t;
46 #define DTV_DELGROUP_G2 ( DTV_DELIVERY_DVB_C2 | DTV_DELIVERY_DVB_T2 | \
47 DTV_DELIVERY_DVB_S2 )
49 #define DTV_DELGROUP_SAT ( DTV_DELIVERY_DVB_S | DTV_DELIVERY_DVB_S2 | \
50 DTV_DELIVERY_ISDB_S )
52 #define DTV_DELGROUP_CABLE ( DTV_DELIVERY_DVB_C | DTV_DELIVERY_DVB_C2 | \
53 DTV_DELIVERY_CQAM | DTV_DELIVERY_ISDB_C )
55 #define DTV_DELGROUP_TERRES ( DTV_DELIVERY_DVB_T | DTV_DELIVERY_DVB_T2 | \
56 DTV_DELIVERY_ATSC | DTV_DELIVERY_ISDB_T )
58 typedef struct dvb_device dvb_device_t;
60 typedef int (* tuner_setup_t) (vlc_object_t *, dvb_device_t *, uint64_t freq);
61 tuner_setup_t dtv_get_delivery_tuner_setup( dtv_delivery_t );
63 dvb_device_t *dvb_open (vlc_object_t *obj);
64 void dvb_close (dvb_device_t *);
65 ssize_t dvb_read (dvb_device_t *, void *, size_t, int);
67 int dvb_add_pid (dvb_device_t *, uint16_t);
68 void dvb_remove_pid (dvb_device_t *, uint16_t);
69 bool dvb_get_pid_state (const dvb_device_t *, uint16_t);
71 unsigned dvb_enum_systems (dvb_device_t *);
72 float dvb_get_signal_strength (dvb_device_t *);
73 float dvb_get_snr (dvb_device_t *);
75 typedef struct en50221_capmt_info_s en50221_capmt_info_t;
76 bool dvb_set_ca_pmt (dvb_device_t *, en50221_capmt_info_t *);
78 int dvb_set_inversion (dvb_device_t *, int);
79 int dvb_tune (dvb_device_t *);
81 typedef struct
83 struct
85 unsigned min;
86 unsigned max;
87 unsigned step;
88 } frequency;
89 struct
91 unsigned min;
92 unsigned max;
93 unsigned step;
94 } symbolrate;
95 bool b_can_cam_auto;
96 } dvb_device_caps_t;
98 int dvb_fill_device_caps( dvb_device_t *, dvb_device_caps_t * );
100 #define VLC_FEC(a,b) (((a) << 16u) | (b))
101 #define VLC_FEC_AUTO 0xFFFFFFFF
102 #define VLC_GUARD(a,b) (((a) << 16u) | (b))
103 #define VLC_GUARD_AUTO 0xFFFFFFFF
105 /* DVB-C */
106 int dvb_set_dvbc (dvb_device_t *, uint32_t freq, const char *mod,
107 uint32_t srate, uint32_t fec);
109 /* DVB-S */
110 int dvb_set_dvbs (dvb_device_t *, uint64_t freq, uint32_t srate, uint32_t fec);
111 int dvb_set_dvbs2 (dvb_device_t *, uint64_t freq, const char *mod,
112 uint32_t srate, uint32_t fec, int pilot, int rolloff,
113 uint8_t sid);
114 int dvb_set_sec (dvb_device_t *, uint64_t freq, char pol,
115 uint32_t lowf, uint32_t highf, uint32_t switchf);
117 /* DVB-T */
118 int dvb_set_dvbt (dvb_device_t *, uint32_t freq, const char *mod,
119 uint32_t fec_hp, uint32_t fec_lp, uint32_t bandwidth,
120 int transmission, uint32_t guard, int hierarchy);
121 int dvb_set_dvbt2 (dvb_device_t *, uint32_t freq, const char *mod,
122 uint32_t fec, uint32_t bandwidth,
123 int transmission, uint32_t guard, uint8_t plp);
125 /* ATSC */
126 int dvb_set_atsc (dvb_device_t *, uint32_t freq, const char *mod);
127 int dvb_set_cqam (dvb_device_t *, uint32_t freq, const char *mod);
129 /* ISDB-C */
130 int dvb_set_isdbc (dvb_device_t *, uint32_t freq, const char *mod,
131 uint32_t srate, uint32_t fec);
133 /* ISDB-S */
134 /* TODO: modulation? */
135 int dvb_set_isdbs (dvb_device_t *, uint64_t freq, uint16_t ts_id);
137 /* ISDB-T */
138 typedef struct isdbt_layer
140 const char *modulation;
141 uint32_t code_rate;
142 uint8_t segment_count;
143 uint8_t time_interleaving;
144 } isdbt_layer_t;
146 int dvb_set_isdbt (dvb_device_t *, uint32_t freq, uint32_t bandwidth,
147 int transmission, uint32_t guard, const isdbt_layer_t[3]);
149 typedef struct isdbt_sound
151 uint8_t subchannel_id;
152 uint8_t segment_index;
153 uint8_t segment_count;
154 } isdbt_sound_t;
156 # ifdef __cplusplus
158 # endif
159 #endif