mpegts: added support for creating a network from an input
This won't actually link it, which might need to change.
This commit is contained in:
parent
38d4ffec95
commit
07a677ecba
6 changed files with 30 additions and 16 deletions
|
@ -391,6 +391,7 @@ struct mpegts_input
|
|||
void (*mi_open_service) (mpegts_input_t*,mpegts_service_t*);
|
||||
void (*mi_close_service) (mpegts_input_t*,mpegts_service_t*);
|
||||
const idclass_t *(*mi_network_class) (mpegts_input_t *mi);
|
||||
mpegts_network_t *(*mi_network_create) (mpegts_input_t *mi, htsmsg_t *c);
|
||||
};
|
||||
|
||||
#endif /* __TVH_MPEGTS_H__ */
|
||||
|
|
|
@ -130,20 +130,16 @@ const idclass_t linuxdvb_frontend_atsc_class =
|
|||
static const idclass_t *
|
||||
linuxdvb_frontend_network_class ( mpegts_input_t *mi )
|
||||
{
|
||||
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi;
|
||||
extern const idclass_t linuxdvb_network_class;
|
||||
return &linuxdvb_network_class;
|
||||
}
|
||||
|
||||
switch (lfe->lfe_info.type) {
|
||||
case FE_QPSK:
|
||||
return &linuxdvb_frontend_dvbs_class;
|
||||
case FE_QAM:
|
||||
return &linuxdvb_frontend_dvbc_class;
|
||||
case FE_OFDM:
|
||||
return &linuxdvb_frontend_dvbt_class;
|
||||
case FE_ATSC:
|
||||
return &linuxdvb_frontend_atsc_class;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
static mpegts_network_t *
|
||||
linuxdvb_frontend_network_create ( mpegts_input_t *mi, htsmsg_t *conf )
|
||||
{
|
||||
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi;
|
||||
return (mpegts_network_t*)
|
||||
linuxdvb_network_create0(NULL, lfe->lfe_info.type, conf);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -692,6 +688,7 @@ linuxdvb_frontend_create0
|
|||
lfe->mi_close_service = linuxdvb_frontend_close_service;
|
||||
lfe->lfe_open_pid = linuxdvb_frontend_open_pid;
|
||||
lfe->mi_network_class = linuxdvb_frontend_network_class;
|
||||
lfe->mi_network_create = linuxdvb_frontend_network_create;
|
||||
|
||||
/* Adapter link */
|
||||
lfe->lh_parent = (linuxdvb_hardware_t*)la;
|
||||
|
|
|
@ -52,6 +52,10 @@ const idclass_t linuxdvb_mux_dvbt_class =
|
|||
.ic_class = "linuxdvb_mux_dvbt",
|
||||
.ic_caption = "Linux DVB-T Multiplex",
|
||||
.ic_properties = (const property_t[]){
|
||||
{
|
||||
PROPDEF1("frequency", "Frequency (Hz)",
|
||||
PT_U32, linuxdvb_mux_t, lm_tuning.dmc_fe_params.frequency)
|
||||
},
|
||||
{}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -121,9 +121,9 @@ linuxdvb_network_create_service
|
|||
* Creation/Config
|
||||
* ***************************************************************************/
|
||||
|
||||
static linuxdvb_network_t *
|
||||
linuxdvb_network_t *
|
||||
linuxdvb_network_create0
|
||||
( const char *uuid, htsmsg_t *conf )
|
||||
( const char *uuid, fe_type_t type, htsmsg_t *conf )
|
||||
{
|
||||
linuxdvb_network_t *ln;
|
||||
htsmsg_t *c, *e;
|
||||
|
@ -132,6 +132,8 @@ linuxdvb_network_create0
|
|||
/* Create */
|
||||
if (!(ln = mpegts_network_create(linuxdvb_network, uuid, NULL, conf)))
|
||||
return NULL;
|
||||
if (type != -1)
|
||||
ln->ln_type = type;
|
||||
|
||||
/* Callbacks */
|
||||
ln->mn_create_mux = linuxdvb_network_create_mux;
|
||||
|
@ -165,7 +167,7 @@ void linuxdvb_network_init ( void )
|
|||
HTSMSG_FOREACH(f, c) {
|
||||
if (!(e = htsmsg_get_map_by_field(f))) continue;
|
||||
if (!(e = htsmsg_get_map(e, "config"))) continue;
|
||||
(void)linuxdvb_network_create0(f->hmf_name, e);
|
||||
(void)linuxdvb_network_create0(f->hmf_name, -1, e);
|
||||
}
|
||||
htsmsg_destroy(c);
|
||||
}
|
||||
|
|
|
@ -179,6 +179,9 @@ struct linuxdvb_network
|
|||
void linuxdvb_network_init ( void );
|
||||
linuxdvb_network_t *linuxdvb_network_find_by_uuid(const char *uuid);
|
||||
|
||||
linuxdvb_network_t *linuxdvb_network_create0
|
||||
( const char *uuid, fe_type_t type, htsmsg_t *conf );
|
||||
|
||||
struct linuxdvb_mux
|
||||
{
|
||||
mpegts_mux_t;
|
||||
|
|
|
@ -70,6 +70,12 @@ mpegts_input_network_class (mpegts_input_t *mi)
|
|||
return &mpegts_network_class;
|
||||
}
|
||||
|
||||
static mpegts_network_t *
|
||||
mpegts_input_network_create (mpegts_input_t *mi, htsmsg_t *conf)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
mpegts_input_is_enabled ( mpegts_input_t *mi )
|
||||
{
|
||||
|
@ -309,6 +315,7 @@ mpegts_input_create0
|
|||
mi->mi_open_service = mpegts_input_open_service;
|
||||
mi->mi_close_service = mpegts_input_close_service;
|
||||
mi->mi_network_class = mpegts_input_network_class;
|
||||
mi->mi_network_create = mpegts_input_network_create;
|
||||
|
||||
/* Init mutex */
|
||||
pthread_mutex_init(&mi->mi_delivery_mutex, NULL);
|
||||
|
|
Loading…
Add table
Reference in a new issue