1 /*
2 * Tvheadend - MPEGTS DVB support routines and defines
3 * Copyright (C) 2013 Adam Sutton
4 * Copyright (C) 2014 Jaroslav Kysela
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef __TVH_MPEGTS_DVB_H__
21 #define __TVH_MPEGTS_DVB_H__
22
23 typedef struct dvb_network
24 {
25 mpegts_network_t;
26
27 /*
28 * Network type
29 */
30 dvb_fe_type_t ln_type;
31 } dvb_network_t;
32
33 typedef struct dvb_mux
34 {
35 mpegts_mux_t;
36
37 /*
38 * Tuning information
39 */
40 dvb_mux_conf_t lm_tuning;
41 } dvb_mux_t;
42
43 /*
44 * Network
45 */
46
47 extern const idclass_t dvb_network_class;
48 extern const idclass_t dvb_network_dvbt_class;
49 extern const idclass_t dvb_network_dvbc_class;
50 extern const idclass_t dvb_network_dvbs_class;
51 extern const idclass_t dvb_network_atsc_t_class;
52 extern const idclass_t dvb_network_atsc_c_class;
53 extern const idclass_t dvb_network_isdb_t_class;
54 extern const idclass_t dvb_network_isdb_c_class;
55 extern const idclass_t dvb_network_isdb_s_class;
56 extern const idclass_t dvb_network_dab_class;
57
58 void dvb_network_init ( void );
59 void dvb_network_done ( void );
60
dvb_network_find_by_uuid(const char * uuid)61 static inline dvb_network_t *dvb_network_find_by_uuid(const char *uuid)
62 { return idnode_find(uuid, &dvb_network_class, NULL); }
63
64 const idclass_t *dvb_network_class_by_fe_type(dvb_fe_type_t type);
65 dvb_fe_type_t dvb_fe_type_by_network_class(const idclass_t *idc);
66
67 idnode_set_t *dvb_network_list_by_fe_type(dvb_fe_type_t type);
68
69 dvb_network_t *dvb_network_create0
70 ( const char *uuid, const idclass_t *idc, htsmsg_t *conf );
71
72 dvb_mux_t *dvb_network_find_mux
73 ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid, int check, int approx_match );
74
75 const idclass_t *dvb_network_mux_class(mpegts_network_t *mn);
76 int dvb_network_get_orbital_pos(mpegts_network_t *mn);
77
78 void dvb_network_scanfile_set ( dvb_network_t *ln, const char *id );
79
80 htsmsg_t * dvb_network_class_scanfile_list ( void *o, const char *lang );
81
82 /*
83 *
84 */
85 extern const idclass_t dvb_mux_dvbt_class;
86 extern const idclass_t dvb_mux_dvbc_class;
87 extern const idclass_t dvb_mux_dvbs_class;
88 extern const idclass_t dvb_mux_atsc_t_class;
89 extern const idclass_t dvb_mux_atsc_c_class;
90 extern const idclass_t dvb_mux_isdb_t_class;
91 extern const idclass_t dvb_mux_isdb_c_class;
92 extern const idclass_t dvb_mux_isdb_s_class;
93 extern const idclass_t dvb_mux_dab_class;
94
95 dvb_mux_t *dvb_mux_create0
96 (dvb_network_t *ln, uint16_t onid, uint16_t tsid,
97 const dvb_mux_conf_t *dmc, const char *uuid, htsmsg_t *conf);
98
99 #define dvb_mux_create1(n, u, c)\
100 dvb_mux_create0(n, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, NULL, u, c)
101
102 #endif /* __TVH_MPEGTS_DVB_H__ */
103