]> git.sesse.net Git - vlc/blob - modules/access/dtv/dtv.h
Initial HTCPCP implementation
[vlc] / modules / access / dtv / dtv.h
1 /**
2  * @file dtv.h
3  * @brief Digital TV module common header
4  */
5 /*****************************************************************************
6  * Copyright © 2011 Rémi Denis-Courmont
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1
11  * of the License, or (at your option) any later version.
12  *
13  * This library 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 General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  ****************************************************************************/
22
23 #ifndef VLC_DTV_H
24 # define VLC_DTV_H 1
25 # ifdef __cplusplus
26 extern "C" {
27 # endif
28
29 typedef struct delsys delsys_t;
30
31 extern const delsys_t dvbc, dvbs, dvbs2, dvbt, atsc, cqam;
32
33 typedef struct dvb_device dvb_device_t;
34
35 dvb_device_t *dvb_open (vlc_object_t *obj, bool tune);
36 void dvb_close (dvb_device_t *);
37 ssize_t dvb_read (dvb_device_t *, void *, size_t);
38
39 int dvb_add_pid (dvb_device_t *, uint16_t);
40 void dvb_remove_pid (dvb_device_t *, uint16_t);
41
42 const delsys_t *dvb_guess_system (dvb_device_t *);
43 float dvb_get_signal_strength (dvb_device_t *);
44 float dvb_get_snr (dvb_device_t *);
45
46 int dvb_set_inversion (dvb_device_t *, int);
47 int dvb_tune (dvb_device_t *);
48
49 #define VLC_FEC(a,b)   (((a) << 16u) | (b))
50 #define VLC_FEC_AUTO   0xFFFFFFFF
51 #define VLC_GUARD(a,b) (((a) << 16u) | (b))
52 #define VLC_GUARD_AUTO 0xFFFFFFFF
53
54 /* DVB-C */
55 int dvb_set_dvbc (dvb_device_t *, uint32_t freq, const char *mod,
56                   uint32_t srate, uint32_t fec);
57
58 /* DVB-S */
59 int dvb_set_dvbs (dvb_device_t *, uint32_t freq, uint32_t srate, uint32_t fec);
60 int dvb_set_dvbs2 (dvb_device_t *, uint32_t freq, const char *mod,
61                    uint32_t srate, uint32_t fec, int pilot, int rolloff);
62 int dvb_set_sec (dvb_device_t *, uint32_t freq, char pol,
63                  uint32_t lowf, uint32_t highf, uint32_t switchf);
64
65 /* DVB-T */
66 int dvb_set_dvbt (dvb_device_t *, uint32_t freq, const char *mod,
67                   uint32_t fec_hp, uint32_t fec_lp, uint32_t bandwidth,
68                   int transmission, uint32_t guard, int hierarchy);
69
70 /* ATSC */
71 int dvb_set_atsc (dvb_device_t *, uint32_t freq, const char *mod);
72 int dvb_set_cqam (dvb_device_t *, uint32_t freq, const char *mod);
73
74 /* ISDB-T */
75 typedef struct isdbt_layer
76 {
77     const char *modulation;
78     const char *code_rate;
79     uint8_t segment_count;
80     uint8_t time_interleaving;
81 } isdbt_layer_t;
82
83 typedef struct isdbt_sound
84 {
85     uint8_t subchannel_id;
86     uint8_t segment_index;    uint8_t segment_cound;
87 } isdbt_sound_t;
88
89 int dvb_set_isdbt (dvb_device_t *, uint32_t freq, const isdbt_layer_t *a,
90                    const isdbt_layer_t *b, const isdbt_layer_t *c,
91                    const isdbt_sound_t *sb);
92 # ifdef __cplusplus
93 }
94 # endif
95 #endif