]> git.sesse.net Git - vlc/blob - modules/access/dtv/dtv.h
DTV: add ISDB-T (untested and exclusing sound broadcasting)
[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 enum {
30     ATSC   = 0x00000001,
31
32     DVB_C  = 0x00000010,
33     DVB_C2 = 0x00000020,
34     DVB_S  = 0x00000040,
35     DVB_S2 = 0x00000080,
36     DVB_T  = 0x00000100,
37     DVB_T2 = 0x00000200,
38
39     ISDB_C = 0x00001000,
40     ISDB_S = 0x00002000,
41     ISDB_T = 0x00004000,
42 };
43
44 typedef struct dvb_device dvb_device_t;
45
46 dvb_device_t *dvb_open (vlc_object_t *obj);
47 void dvb_close (dvb_device_t *);
48 ssize_t dvb_read (dvb_device_t *, void *, size_t);
49
50 int dvb_add_pid (dvb_device_t *, uint16_t);
51 void dvb_remove_pid (dvb_device_t *, uint16_t);
52
53 unsigned dvb_enum_systems (dvb_device_t *);
54 float dvb_get_signal_strength (dvb_device_t *);
55 float dvb_get_snr (dvb_device_t *);
56
57 #ifdef HAVE_DVBPSI
58 struct dvbpsi_pmt_s;
59 void dvb_set_ca_pmt (dvb_device_t *, struct dvbpsi_pmt_s *);
60 #endif
61
62 int dvb_set_inversion (dvb_device_t *, int);
63 int dvb_tune (dvb_device_t *);
64
65 #define VLC_FEC(a,b)   (((a) << 16u) | (b))
66 #define VLC_FEC_AUTO   0xFFFFFFFF
67 #define VLC_GUARD(a,b) (((a) << 16u) | (b))
68 #define VLC_GUARD_AUTO 0xFFFFFFFF
69
70 /* DVB-C */
71 int dvb_set_dvbc (dvb_device_t *, uint32_t freq, const char *mod,
72                   uint32_t srate, uint32_t fec);
73
74 /* DVB-S */
75 int dvb_set_dvbs (dvb_device_t *, uint64_t freq, uint32_t srate, uint32_t fec);
76 int dvb_set_dvbs2 (dvb_device_t *, uint64_t freq, const char *mod,
77                    uint32_t srate, uint32_t fec, int pilot, int rolloff);
78 int dvb_set_sec (dvb_device_t *, uint64_t freq, char pol,
79                  uint32_t lowf, uint32_t highf, uint32_t switchf);
80
81 /* DVB-T */
82 int dvb_set_dvbt (dvb_device_t *, uint32_t freq, const char *mod,
83                   uint32_t fec_hp, uint32_t fec_lp, uint32_t bandwidth,
84                   int transmission, uint32_t guard, int hierarchy);
85 int dvb_set_dvbt2 (dvb_device_t *, uint32_t freq, const char *mod,
86                    uint32_t fec, uint32_t bandwidth,
87                    int transmission, uint32_t guard);
88
89 /* ATSC */
90 int dvb_set_atsc (dvb_device_t *, uint32_t freq, const char *mod);
91 int dvb_set_cqam (dvb_device_t *, uint32_t freq, const char *mod);
92
93 /* ISDB-S */
94 /* TODO: modulation? */
95 int dvb_set_isdbs (dvb_device_t *, uint64_t freq, uint16_t ts_id);
96
97 /* ISDB-T */
98 typedef struct isdbt_layer
99 {
100     const char *modulation;
101     uint32_t code_rate;
102     uint8_t segment_count;
103     uint8_t time_interleaving;
104 } isdbt_layer_t;
105
106 int dvb_set_isdbt (dvb_device_t *, uint32_t freq, uint32_t bandwith,
107                    int transmission, uint32_t guard, const isdbt_layer_t[3]);
108
109 typedef struct isdbt_sound
110 {
111     uint8_t subchannel_id;
112     uint8_t segment_index;
113     uint8_t segment_count;
114 } isdbt_sound_t;
115
116 # ifdef __cplusplus
117 }
118 # endif
119 #endif