Move the linuxdvb mux code to the shared mpegts network code
... introduce $CFG/input/dvb/networks/... structure
This commit is contained in:
parent
23d330de12
commit
d1ad5631b5
11 changed files with 220 additions and 262 deletions
2
Makefile
2
Makefile
|
@ -180,6 +180,7 @@ SRCS-$(CONFIG_MPEGTS) += \
|
||||||
# MPEGTS DVB
|
# MPEGTS DVB
|
||||||
SRCS-${CONFIG_MPEGTS_DVB} += \
|
SRCS-${CONFIG_MPEGTS_DVB} += \
|
||||||
src/input/mpegts/mpegts_network_dvb.c \
|
src/input/mpegts/mpegts_network_dvb.c \
|
||||||
|
src/input/mpegts/mpegts_mux_dvb.c \
|
||||||
src/input/mpegts/scanfile.c
|
src/input/mpegts/scanfile.c
|
||||||
|
|
||||||
# MPEGTS EPG
|
# MPEGTS EPG
|
||||||
|
@ -194,7 +195,6 @@ SRCS-${CONFIG_LINUXDVB} += \
|
||||||
src/input/mpegts/linuxdvb/linuxdvb.c \
|
src/input/mpegts/linuxdvb/linuxdvb.c \
|
||||||
src/input/mpegts/linuxdvb/linuxdvb_adapter.c \
|
src/input/mpegts/linuxdvb/linuxdvb_adapter.c \
|
||||||
src/input/mpegts/linuxdvb/linuxdvb_frontend.c \
|
src/input/mpegts/linuxdvb/linuxdvb_frontend.c \
|
||||||
src/input/mpegts/linuxdvb/linuxdvb_mux.c \
|
|
||||||
src/input/mpegts/linuxdvb/linuxdvb_satconf.c \
|
src/input/mpegts/linuxdvb/linuxdvb_satconf.c \
|
||||||
src/input/mpegts/linuxdvb/linuxdvb_lnb.c \
|
src/input/mpegts/linuxdvb/linuxdvb_lnb.c \
|
||||||
src/input/mpegts/linuxdvb/linuxdvb_switch.c \
|
src/input/mpegts/linuxdvb/linuxdvb_switch.c \
|
||||||
|
|
|
@ -143,7 +143,7 @@ const idclass_t linuxdvb_en50494_class =
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_en50494_tune
|
linuxdvb_en50494_tune
|
||||||
( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd )
|
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd )
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -375,7 +375,7 @@ linuxdvb_frontend_network_list ( mpegts_input_t *mi )
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linuxdvb_frontend_default_tables
|
linuxdvb_frontend_default_tables
|
||||||
( linuxdvb_frontend_t *lfe, linuxdvb_mux_t *lm )
|
( linuxdvb_frontend_t *lfe, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
mpegts_mux_t *mm = (mpegts_mux_t*)lm;
|
mpegts_mux_t *mm = (mpegts_mux_t*)lm;
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ linuxdvb_frontend_monitor ( void *aux )
|
||||||
pthread_mutex_unlock(&lfe->lfe_dvr_lock);
|
pthread_mutex_unlock(&lfe->lfe_dvr_lock);
|
||||||
|
|
||||||
/* Table handlers */
|
/* Table handlers */
|
||||||
linuxdvb_frontend_default_tables(lfe, (linuxdvb_mux_t*)mm);
|
linuxdvb_frontend_default_tables(lfe, (dvb_mux_t*)mm);
|
||||||
|
|
||||||
/* Locked - ensure everything is open */
|
/* Locked - ensure everything is open */
|
||||||
pthread_mutex_lock(&lfe->mi_delivery_mutex);
|
pthread_mutex_lock(&lfe->mi_delivery_mutex);
|
||||||
|
@ -861,7 +861,7 @@ linuxdvb_frontend_tune0
|
||||||
struct dvb_frontend_event ev;
|
struct dvb_frontend_event ev;
|
||||||
char buf1[256];
|
char buf1[256];
|
||||||
mpegts_mux_instance_t *cur = LIST_FIRST(&lfe->mi_mux_active);
|
mpegts_mux_instance_t *cur = LIST_FIRST(&lfe->mi_mux_active);
|
||||||
linuxdvb_mux_t *lm = (linuxdvb_mux_t*)mmi->mmi_mux;
|
dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux;
|
||||||
dvb_mux_conf_t *dmc;
|
dvb_mux_conf_t *dmc;
|
||||||
struct dvb_frontend_parameters p;
|
struct dvb_frontend_parameters p;
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ const idclass_t linuxdvb_lnb_class =
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
linuxdvb_lnb_standard_freq
|
linuxdvb_lnb_standard_freq
|
||||||
( linuxdvb_lnb_t *l, linuxdvb_mux_t *lm )
|
( linuxdvb_lnb_t *l, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
linuxdvb_lnb_conf_t *lnb = (linuxdvb_lnb_conf_t*)l;
|
linuxdvb_lnb_conf_t *lnb = (linuxdvb_lnb_conf_t*)l;
|
||||||
int32_t f = (int32_t)lm->lm_tuning.dmc_fe_freq;
|
int32_t f = (int32_t)lm->lm_tuning.dmc_fe_freq;
|
||||||
|
@ -85,7 +85,7 @@ linuxdvb_lnb_standard_freq
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_lnb_standard_band
|
linuxdvb_lnb_standard_band
|
||||||
( linuxdvb_lnb_t *l, linuxdvb_mux_t *lm )
|
( linuxdvb_lnb_t *l, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
linuxdvb_lnb_conf_t *lnb = (linuxdvb_lnb_conf_t*)l;
|
linuxdvb_lnb_conf_t *lnb = (linuxdvb_lnb_conf_t*)l;
|
||||||
uint32_t f = lm->lm_tuning.dmc_fe_freq;
|
uint32_t f = lm->lm_tuning.dmc_fe_freq;
|
||||||
|
@ -94,7 +94,7 @@ linuxdvb_lnb_standard_band
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_lnb_standard_pol
|
linuxdvb_lnb_standard_pol
|
||||||
( linuxdvb_lnb_t *l, linuxdvb_mux_t *lm )
|
( linuxdvb_lnb_t *l, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
dvb_mux_conf_t *dmc = &lm->lm_tuning;
|
dvb_mux_conf_t *dmc = &lm->lm_tuning;
|
||||||
return dmc->u.dmc_fe_qpsk.polarisation == DVB_POLARISATION_HORIZONTAL ||
|
return dmc->u.dmc_fe_qpsk.polarisation == DVB_POLARISATION_HORIZONTAL ||
|
||||||
|
@ -103,7 +103,7 @@ linuxdvb_lnb_standard_pol
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_lnb_standard_tune
|
linuxdvb_lnb_standard_tune
|
||||||
( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
||||||
{
|
{
|
||||||
int pol = linuxdvb_lnb_standard_pol((linuxdvb_lnb_t*)ld, lm);
|
int pol = linuxdvb_lnb_standard_pol((linuxdvb_lnb_t*)ld, lm);
|
||||||
return linuxdvb_diseqc_set_volt(fd, pol);
|
return linuxdvb_diseqc_set_volt(fd, pol);
|
||||||
|
@ -115,7 +115,7 @@ linuxdvb_lnb_standard_tune
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
linuxdvb_lnb_bandstack_freq
|
linuxdvb_lnb_bandstack_freq
|
||||||
( linuxdvb_lnb_t *l, linuxdvb_mux_t *lm )
|
( linuxdvb_lnb_t *l, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
linuxdvb_lnb_conf_t *lnb = (linuxdvb_lnb_conf_t*)l;
|
linuxdvb_lnb_conf_t *lnb = (linuxdvb_lnb_conf_t*)l;
|
||||||
int32_t f = (int32_t)lm->lm_tuning.dmc_fe_freq;
|
int32_t f = (int32_t)lm->lm_tuning.dmc_fe_freq;
|
||||||
|
@ -131,7 +131,7 @@ linuxdvb_lnb_bandstack_freq
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_lnb_bandstack_band
|
linuxdvb_lnb_bandstack_band
|
||||||
( linuxdvb_lnb_t *l, linuxdvb_mux_t *lm )
|
( linuxdvb_lnb_t *l, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
dvb_mux_conf_t *dmc = &lm->lm_tuning;
|
dvb_mux_conf_t *dmc = &lm->lm_tuning;
|
||||||
int pol = dmc->u.dmc_fe_qpsk.polarisation == DVB_POLARISATION_HORIZONTAL ||
|
int pol = dmc->u.dmc_fe_qpsk.polarisation == DVB_POLARISATION_HORIZONTAL ||
|
||||||
|
@ -141,14 +141,14 @@ linuxdvb_lnb_bandstack_band
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_lnb_bandstack_pol
|
linuxdvb_lnb_bandstack_pol
|
||||||
( linuxdvb_lnb_t *l, linuxdvb_mux_t *lm )
|
( linuxdvb_lnb_t *l, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_lnb_bandstack_tune
|
linuxdvb_lnb_bandstack_tune
|
||||||
( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
||||||
{
|
{
|
||||||
int pol = linuxdvb_lnb_bandstack_pol((linuxdvb_lnb_t*)ld, lm);
|
int pol = linuxdvb_lnb_bandstack_pol((linuxdvb_lnb_t*)ld, lm);
|
||||||
return linuxdvb_diseqc_set_volt(fd, pol);
|
return linuxdvb_diseqc_set_volt(fd, pol);
|
||||||
|
|
|
@ -40,7 +40,6 @@ typedef struct linuxdvb_satconf_ele linuxdvb_satconf_ele_t;
|
||||||
typedef struct linuxdvb_diseqc linuxdvb_diseqc_t;
|
typedef struct linuxdvb_diseqc linuxdvb_diseqc_t;
|
||||||
typedef struct linuxdvb_lnb linuxdvb_lnb_t;
|
typedef struct linuxdvb_lnb linuxdvb_lnb_t;
|
||||||
typedef struct linuxdvb_network linuxdvb_network_t;
|
typedef struct linuxdvb_network linuxdvb_network_t;
|
||||||
typedef struct linuxdvb_mux linuxdvb_mux_t;
|
|
||||||
typedef struct linuxdvb_en50494 linuxdvb_en50494_t;
|
typedef struct linuxdvb_en50494 linuxdvb_en50494_t;
|
||||||
|
|
||||||
typedef LIST_HEAD(,linuxdvb_hardware) linuxdvb_hardware_list_t;
|
typedef LIST_HEAD(,linuxdvb_hardware) linuxdvb_hardware_list_t;
|
||||||
|
@ -184,17 +183,17 @@ struct linuxdvb_diseqc
|
||||||
idnode_t ld_id;
|
idnode_t ld_id;
|
||||||
const char *ld_type;
|
const char *ld_type;
|
||||||
linuxdvb_satconf_ele_t *ld_satconf;
|
linuxdvb_satconf_ele_t *ld_satconf;
|
||||||
int (*ld_grace) (linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm);
|
int (*ld_grace) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm);
|
||||||
int (*ld_tune) (linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm,
|
int (*ld_tune) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm,
|
||||||
linuxdvb_satconf_ele_t *ls, int fd);
|
linuxdvb_satconf_ele_t *ls, int fd);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct linuxdvb_lnb
|
struct linuxdvb_lnb
|
||||||
{
|
{
|
||||||
linuxdvb_diseqc_t;
|
linuxdvb_diseqc_t;
|
||||||
uint32_t (*lnb_freq)(linuxdvb_lnb_t*, linuxdvb_mux_t*);
|
uint32_t (*lnb_freq)(linuxdvb_lnb_t*, dvb_mux_t*);
|
||||||
int (*lnb_band)(linuxdvb_lnb_t*, linuxdvb_mux_t*);
|
int (*lnb_band)(linuxdvb_lnb_t*, dvb_mux_t*);
|
||||||
int (*lnb_pol) (linuxdvb_lnb_t*, linuxdvb_mux_t*);
|
int (*lnb_pol) (linuxdvb_lnb_t*, dvb_mux_t*);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct linuxdvb_en50494
|
struct linuxdvb_en50494
|
||||||
|
@ -245,27 +244,6 @@ int linuxdvb_frontend_tune0
|
||||||
int linuxdvb_frontend_tune1
|
int linuxdvb_frontend_tune1
|
||||||
( linuxdvb_frontend_t *lfe, mpegts_mux_instance_t *mmi, uint32_t freq );
|
( linuxdvb_frontend_t *lfe, mpegts_mux_instance_t *mmi, uint32_t freq );
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct linuxdvb_mux
|
|
||||||
{
|
|
||||||
mpegts_mux_t;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Tuning information
|
|
||||||
*/
|
|
||||||
dvb_mux_conf_t lm_tuning;
|
|
||||||
};
|
|
||||||
|
|
||||||
linuxdvb_mux_t *linuxdvb_mux_create0
|
|
||||||
(dvb_network_t *ln, uint16_t onid, uint16_t tsid,
|
|
||||||
const dvb_mux_conf_t *dmc, const char *uuid, htsmsg_t *conf);
|
|
||||||
|
|
||||||
#define linuxdvb_mux_create1(n, u, c)\
|
|
||||||
linuxdvb_mux_create0(n, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE,\
|
|
||||||
NULL, u, c)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Diseqc gear
|
* Diseqc gear
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -132,7 +132,7 @@ const idclass_t linuxdvb_rotor_usals_class =
|
||||||
/* GotoX */
|
/* GotoX */
|
||||||
static int
|
static int
|
||||||
linuxdvb_rotor_gotox_tune
|
linuxdvb_rotor_gotox_tune
|
||||||
( linuxdvb_rotor_t *lr, linuxdvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i <= ls->lse_parent->ls_diseqc_repeats; i++) {
|
for (i = 0; i <= ls->lse_parent->ls_diseqc_repeats; i++) {
|
||||||
|
@ -150,7 +150,7 @@ linuxdvb_rotor_gotox_tune
|
||||||
/* USALS */
|
/* USALS */
|
||||||
static int
|
static int
|
||||||
linuxdvb_rotor_usals_tune
|
linuxdvb_rotor_usals_tune
|
||||||
( linuxdvb_rotor_t *lr, linuxdvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Code originally written in PR #238 by Jason Millard jsm174
|
* Code originally written in PR #238 by Jason Millard jsm174
|
||||||
|
@ -219,7 +219,7 @@ linuxdvb_rotor_usals_tune
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_rotor_tune
|
linuxdvb_rotor_tune
|
||||||
( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
|
||||||
{
|
{
|
||||||
linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld;
|
linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld;
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ linuxdvb_rotor_tune
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_rotor_grace
|
linuxdvb_rotor_grace
|
||||||
( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm )
|
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm )
|
||||||
{
|
{
|
||||||
return 120; // TODO: calculate approx period
|
return 120; // TODO: calculate approx period
|
||||||
}
|
}
|
||||||
|
|
|
@ -596,7 +596,7 @@ linuxdvb_satconf_get_grace
|
||||||
/* Add diseqc delay */
|
/* Add diseqc delay */
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (lds[i] && lds[i]->ld_grace)
|
if (lds[i] && lds[i]->ld_grace)
|
||||||
r += lds[i]->ld_grace(lds[i], (linuxdvb_mux_t*)mm);
|
r += lds[i]->ld_grace(lds[i], (dvb_mux_t*)mm);
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
@ -614,7 +614,7 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
|
||||||
/* Get beans in a row */
|
/* Get beans in a row */
|
||||||
mpegts_mux_instance_t *mmi = ls->ls_mmi;
|
mpegts_mux_instance_t *mmi = ls->ls_mmi;
|
||||||
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)ls->ls_frontend;
|
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)ls->ls_frontend;
|
||||||
linuxdvb_mux_t *lm = (linuxdvb_mux_t*)mmi->mmi_mux;
|
dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux;
|
||||||
linuxdvb_diseqc_t *lds[] = {
|
linuxdvb_diseqc_t *lds[] = {
|
||||||
lse->lse_rotor ? (linuxdvb_diseqc_t*)lse->lse_switch : NULL,
|
lse->lse_rotor ? (linuxdvb_diseqc_t*)lse->lse_switch : NULL,
|
||||||
(linuxdvb_diseqc_t*)lse->lse_rotor,
|
(linuxdvb_diseqc_t*)lse->lse_rotor,
|
||||||
|
@ -680,7 +680,7 @@ linuxdvb_satconf_start_mux
|
||||||
uint32_t f;
|
uint32_t f;
|
||||||
linuxdvb_satconf_ele_t *lse = linuxdvb_satconf_find_ele(ls, mmi->mmi_mux);
|
linuxdvb_satconf_ele_t *lse = linuxdvb_satconf_find_ele(ls, mmi->mmi_mux);
|
||||||
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)ls->ls_frontend;
|
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)ls->ls_frontend;
|
||||||
linuxdvb_mux_t *lm = (linuxdvb_mux_t*)mmi->mmi_mux;
|
dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux;
|
||||||
|
|
||||||
/* Test run */
|
/* Test run */
|
||||||
// Note: basically this ensures the tuning params are acceptable
|
// Note: basically this ensures the tuning params are acceptable
|
||||||
|
|
|
@ -113,7 +113,7 @@ const idclass_t linuxdvb_switch_class =
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_switch_tune
|
linuxdvb_switch_tune
|
||||||
( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd )
|
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd )
|
||||||
{
|
{
|
||||||
int i, com, r1 = 0, r2 = 0;
|
int i, com, r1 = 0, r2 = 0;
|
||||||
int pol, band;
|
int pol, band;
|
||||||
|
|
|
@ -46,4 +46,29 @@ dvb_network_t *dvb_network_find_by_uuid(const char *uuid);
|
||||||
dvb_network_t *dvb_network_create0
|
dvb_network_t *dvb_network_create0
|
||||||
( const char *uuid, const idclass_t *idc, htsmsg_t *conf );
|
( const char *uuid, const idclass_t *idc, htsmsg_t *conf );
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
typedef struct dvb_mux
|
||||||
|
{
|
||||||
|
mpegts_mux_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tuning information
|
||||||
|
*/
|
||||||
|
dvb_mux_conf_t lm_tuning;
|
||||||
|
} dvb_mux_t;
|
||||||
|
|
||||||
|
extern const idclass_t dvb_mux_dvbt_class;
|
||||||
|
extern const idclass_t dvb_mux_dvbc_class;
|
||||||
|
extern const idclass_t dvb_mux_dvbs_class;
|
||||||
|
extern const idclass_t dvb_mux_atsc_class;
|
||||||
|
|
||||||
|
dvb_mux_t *dvb_mux_create0
|
||||||
|
(dvb_network_t *ln, uint16_t onid, uint16_t tsid,
|
||||||
|
const dvb_mux_conf_t *dmc, const char *uuid, htsmsg_t *conf);
|
||||||
|
|
||||||
|
#define dvb_mux_create1(n, u, c)\
|
||||||
|
dvb_mux_create0(n, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, NULL, u, c)
|
||||||
|
|
||||||
#endif /* __TVH_MPEGTS_DVB_H__ */
|
#endif /* __TVH_MPEGTS_DVB_H__ */
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "tvheadend.h"
|
#include "tvheadend.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "linuxdvb_private.h"
|
#include "mpegts_dvb.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
* *************************************************************************/
|
* *************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linuxdvb_mux_delete ( mpegts_mux_t *mm, int delconf );
|
dvb_mux_delete ( mpegts_mux_t *mm, int delconf );
|
||||||
|
|
||||||
extern const idclass_t mpegts_mux_class;
|
extern const idclass_t mpegts_mux_class;
|
||||||
|
|
||||||
|
@ -45,24 +45,24 @@ extern const idclass_t mpegts_mux_class;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Macro to define mux class str get/set */
|
/* Macro to define mux class str get/set */
|
||||||
#define linuxdvb_mux_class_R(c, f, l, ...)\
|
#define dvb_mux_class_R(c, f, l, ...)\
|
||||||
static const void * \
|
static const void * \
|
||||||
linuxdvb_mux_##c##_class_##l##_get (void *o)\
|
dvb_mux_##c##_class_##l##_get (void *o)\
|
||||||
{\
|
{\
|
||||||
static const char *s;\
|
static const char *s;\
|
||||||
linuxdvb_mux_t *lm = o;\
|
dvb_mux_t *lm = o;\
|
||||||
s = dvb_##l##2str(lm->lm_tuning.dmc_fe_##f);\
|
s = dvb_##l##2str(lm->lm_tuning.dmc_fe_##f);\
|
||||||
return &s;\
|
return &s;\
|
||||||
}\
|
}\
|
||||||
static int \
|
static int \
|
||||||
linuxdvb_mux_##c##_class_##l##_set (void *o, const void *v)\
|
dvb_mux_##c##_class_##l##_set (void *o, const void *v)\
|
||||||
{\
|
{\
|
||||||
linuxdvb_mux_t *lm = o;\
|
dvb_mux_t *lm = o;\
|
||||||
lm->lm_tuning.dmc_fe_##f = dvb_str2##l ((const char*)v);\
|
lm->lm_tuning.dmc_fe_##f = dvb_str2##l ((const char*)v);\
|
||||||
return 1;\
|
return 1;\
|
||||||
}\
|
}\
|
||||||
static htsmsg_t *\
|
static htsmsg_t *\
|
||||||
linuxdvb_mux_##c##_class_##l##_enum (void *o)\
|
dvb_mux_##c##_class_##l##_enum (void *o)\
|
||||||
{\
|
{\
|
||||||
static const int t[] = { __VA_ARGS__ };\
|
static const int t[] = { __VA_ARGS__ };\
|
||||||
int i;\
|
int i;\
|
||||||
|
@ -71,24 +71,24 @@ linuxdvb_mux_##c##_class_##l##_enum (void *o)\
|
||||||
htsmsg_add_str(m, NULL, dvb_##l##2str(t[i]));\
|
htsmsg_add_str(m, NULL, dvb_##l##2str(t[i]));\
|
||||||
return m;\
|
return m;\
|
||||||
}
|
}
|
||||||
#define linuxdvb_mux_class_X(c, f, p, l, ...)\
|
#define dvb_mux_class_X(c, f, p, l, ...)\
|
||||||
static const void * \
|
static const void * \
|
||||||
linuxdvb_mux_##c##_class_##l##_get (void *o)\
|
dvb_mux_##c##_class_##l##_get (void *o)\
|
||||||
{\
|
{\
|
||||||
static const char *s;\
|
static const char *s;\
|
||||||
linuxdvb_mux_t *lm = o;\
|
dvb_mux_t *lm = o;\
|
||||||
s = dvb_##l##2str(lm->lm_tuning.u.dmc_fe_##f.p);\
|
s = dvb_##l##2str(lm->lm_tuning.u.dmc_fe_##f.p);\
|
||||||
return &s;\
|
return &s;\
|
||||||
}\
|
}\
|
||||||
static int \
|
static int \
|
||||||
linuxdvb_mux_##c##_class_##l##_set (void *o, const void *v)\
|
dvb_mux_##c##_class_##l##_set (void *o, const void *v)\
|
||||||
{\
|
{\
|
||||||
linuxdvb_mux_t *lm = o;\
|
dvb_mux_t *lm = o;\
|
||||||
lm->lm_tuning.u.dmc_fe_##f.p = dvb_str2##l ((const char*)v);\
|
lm->lm_tuning.u.dmc_fe_##f.p = dvb_str2##l ((const char*)v);\
|
||||||
return 1;\
|
return 1;\
|
||||||
}\
|
}\
|
||||||
static htsmsg_t *\
|
static htsmsg_t *\
|
||||||
linuxdvb_mux_##c##_class_##l##_enum (void *o)\
|
dvb_mux_##c##_class_##l##_enum (void *o)\
|
||||||
{\
|
{\
|
||||||
static const int t[] = { __VA_ARGS__ };\
|
static const int t[] = { __VA_ARGS__ };\
|
||||||
int i;\
|
int i;\
|
||||||
|
@ -101,38 +101,37 @@ linuxdvb_mux_##c##_class_##l##_enum (void *o)\
|
||||||
.type = PT_STR,\
|
.type = PT_STR,\
|
||||||
.id = _id,\
|
.id = _id,\
|
||||||
.name = _name,\
|
.name = _name,\
|
||||||
.get = linuxdvb_mux_##t##_class_##l##_get,\
|
.get = dvb_mux_##t##_class_##l##_get,\
|
||||||
.set = linuxdvb_mux_##t##_class_##l##_set,\
|
.set = dvb_mux_##t##_class_##l##_set,\
|
||||||
.list = linuxdvb_mux_##t##_class_##l##_enum,\
|
.list = dvb_mux_##t##_class_##l##_enum,\
|
||||||
.def.s = d
|
.def.s = d
|
||||||
|
|
||||||
static const void *
|
static const void *
|
||||||
linuxdvb_mux_class_delsys_get (void *o)
|
dvb_mux_class_delsys_get (void *o)
|
||||||
{
|
{
|
||||||
static const char *s;
|
static const char *s;
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
s = dvb_delsys2str(lm->lm_tuning.dmc_fe_delsys);
|
s = dvb_delsys2str(lm->lm_tuning.dmc_fe_delsys);
|
||||||
return &s;
|
return &s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_mux_class_delsys_set (void *o, const void *v)
|
dvb_mux_class_delsys_set (void *o, const void *v)
|
||||||
{
|
{
|
||||||
#if DVB_VER_ATLEAST(5,0)
|
|
||||||
const char *s = v;
|
const char *s = v;
|
||||||
int delsys = dvb_str2delsys(s);
|
int delsys = dvb_str2delsys(s);
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
if (delsys != lm->lm_tuning.dmc_fe_delsys) {
|
if (delsys != lm->lm_tuning.dmc_fe_delsys) {
|
||||||
lm->lm_tuning.dmc_fe_delsys = dvb_str2delsys(s);
|
lm->lm_tuning.dmc_fe_delsys = dvb_str2delsys(s);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idclass_t linuxdvb_mux_class =
|
const idclass_t dvb_mux_class =
|
||||||
{
|
{
|
||||||
.ic_super = &mpegts_mux_class,
|
.ic_super = &mpegts_mux_class,
|
||||||
.ic_class = "linuxdvb_mux",
|
.ic_class = "dvb_mux",
|
||||||
.ic_caption = "Linux DVB Multiplex",
|
.ic_caption = "Linux DVB Multiplex",
|
||||||
.ic_properties = (const property_t[]){
|
.ic_properties = (const property_t[]){
|
||||||
{}
|
{}
|
||||||
|
@ -143,78 +142,50 @@ const idclass_t linuxdvb_mux_class =
|
||||||
* DVB-T
|
* DVB-T
|
||||||
*/
|
*/
|
||||||
|
|
||||||
linuxdvb_mux_class_X(dvbt, ofdm, bandwidth, bw,
|
dvb_mux_class_X(dvbt, ofdm, bandwidth, bw,
|
||||||
DVB_BANDWIDTH_AUTO
|
DVB_BANDWIDTH_AUTO, DVB_BANDWIDTH_10_MHZ,
|
||||||
, DVB_BANDWIDTH_8_MHZ, DVB_BANDWIDTH_7_MHZ
|
DVB_BANDWIDTH_8_MHZ, DVB_BANDWIDTH_7_MHZ,
|
||||||
, DVB_BANDWIDTH_6_MHZ
|
DVB_BANDWIDTH_6_MHZ, DVB_BANDWIDTH_5_MHZ,
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
DVB_BANDWIDTH_1_712_MHZ);
|
||||||
, DVB_BANDWIDTH_5_MHZ
|
dvb_mux_class_R(dvbt, modulation, qam,
|
||||||
, DVB_BANDWIDTH_10_MHZ
|
|
||||||
, DVB_BANDWIDTH_1_712_MHZ
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
linuxdvb_mux_class_R(dvbt, modulation, qam,
|
|
||||||
DVB_MOD_QAM_AUTO, DVB_MOD_QPSK, DVB_MOD_QAM_16,
|
DVB_MOD_QAM_AUTO, DVB_MOD_QPSK, DVB_MOD_QAM_16,
|
||||||
DVB_MOD_QAM_64, DVB_MOD_QAM_256
|
DVB_MOD_QAM_64, DVB_MOD_QAM_256);
|
||||||
);
|
dvb_mux_class_X(dvbt, ofdm, transmission_mode, mode,
|
||||||
linuxdvb_mux_class_X(dvbt, ofdm, transmission_mode, mode,
|
DVB_TRANSMISSION_MODE_AUTO, DVB_TRANSMISSION_MODE_32K,
|
||||||
DVB_TRANSMISSION_MODE_AUTO,
|
DVB_TRANSMISSION_MODE_16K, DVB_TRANSMISSION_MODE_8K,
|
||||||
DVB_TRANSMISSION_MODE_2K, DVB_TRANSMISSION_MODE_8K
|
DVB_TRANSMISSION_MODE_2K, DVB_TRANSMISSION_MODE_1K);
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
dvb_mux_class_X(dvbt, ofdm, guard_interval, guard,
|
||||||
, DVB_TRANSMISSION_MODE_1K, DVB_TRANSMISSION_MODE_16K
|
DVB_GUARD_INTERVAL_AUTO, DVB_GUARD_INTERVAL_1_32,
|
||||||
, DVB_TRANSMISSION_MODE_32K
|
DVB_GUARD_INTERVAL_1_16, DVB_GUARD_INTERVAL_1_8,
|
||||||
#endif
|
DVB_GUARD_INTERVAL_1_4, DVB_GUARD_INTERVAL_1_128,
|
||||||
);
|
DVB_GUARD_INTERVAL_19_128, DVB_GUARD_INTERVAL_19_256);
|
||||||
linuxdvb_mux_class_X(dvbt, ofdm, guard_interval, guard,
|
dvb_mux_class_X(dvbt, ofdm, hierarchy_information, hier,
|
||||||
DVB_GUARD_INTERVAL_AUTO, DVB_GUARD_INTERVAL_1_4,
|
|
||||||
DVB_GUARD_INTERVAL_1_8, DVB_GUARD_INTERVAL_1_16,
|
|
||||||
DVB_GUARD_INTERVAL_1_32
|
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
|
||||||
, DVB_GUARD_INTERVAL_1_128, DVB_GUARD_INTERVAL_19_128
|
|
||||||
, DVB_GUARD_INTERVAL_19_256
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
linuxdvb_mux_class_X(dvbt, ofdm, hierarchy_information, hier,
|
|
||||||
DVB_HIERARCHY_AUTO, DVB_HIERARCHY_NONE,
|
DVB_HIERARCHY_AUTO, DVB_HIERARCHY_NONE,
|
||||||
DVB_HIERARCHY_1, DVB_HIERARCHY_2, DVB_HIERARCHY_4
|
DVB_HIERARCHY_1, DVB_HIERARCHY_2, DVB_HIERARCHY_4);
|
||||||
);
|
dvb_mux_class_X(dvbt, ofdm, code_rate_HP, fechi,
|
||||||
linuxdvb_mux_class_X(dvbt, ofdm, code_rate_HP, fechi,
|
DVB_FEC_AUTO, DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4,
|
||||||
DVB_FEC_AUTO,
|
DVB_FEC_3_5, DVB_FEC_4_5, DVB_FEC_5_6, DVB_FEC_7_8);
|
||||||
DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4, DVB_FEC_4_5,
|
dvb_mux_class_X(dvbt, ofdm, code_rate_LP, feclo,
|
||||||
DVB_FEC_5_6, DVB_FEC_7_8
|
DVB_FEC_AUTO, DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4,
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
DVB_FEC_3_5, DVB_FEC_4_5, DVB_FEC_5_6, DVB_FEC_7_8);
|
||||||
, DVB_FEC_3_5
|
|
||||||
#endif
|
#define dvb_mux_dvbt_class_delsys_get dvb_mux_class_delsys_get
|
||||||
);
|
#define dvb_mux_dvbt_class_delsys_set dvb_mux_class_delsys_set
|
||||||
linuxdvb_mux_class_X(dvbt, ofdm, code_rate_LP, feclo,
|
|
||||||
DVB_FEC_AUTO,
|
|
||||||
DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4,
|
|
||||||
DVB_FEC_4_5, DVB_FEC_5_6, DVB_FEC_7_8
|
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
|
||||||
, DVB_FEC_3_5
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
#define linuxdvb_mux_dvbt_class_delsys_get linuxdvb_mux_class_delsys_get
|
|
||||||
#define linuxdvb_mux_dvbt_class_delsys_set linuxdvb_mux_class_delsys_set
|
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_dvbt_class_delsys_enum (void *o)
|
dvb_mux_dvbt_class_delsys_enum (void *o)
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
#if DVB_VER_ATLEAST(5,0)
|
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBT));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBT));
|
||||||
#endif
|
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBT2));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBT2));
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_TURBO));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_TURBO));
|
||||||
#endif
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idclass_t linuxdvb_mux_dvbt_class =
|
const idclass_t dvb_mux_dvbt_class =
|
||||||
{
|
{
|
||||||
.ic_super = &linuxdvb_mux_class,
|
.ic_super = &dvb_mux_class,
|
||||||
.ic_class = "linuxdvb_mux_dvbt",
|
.ic_class = "dvb_mux_dvbt",
|
||||||
.ic_caption = "Linux DVB-T Multiplex",
|
.ic_caption = "Linux DVB-T Multiplex",
|
||||||
.ic_properties = (const property_t[]){
|
.ic_properties = (const property_t[]){
|
||||||
{
|
{
|
||||||
|
@ -225,7 +196,7 @@ const idclass_t linuxdvb_mux_dvbt_class =
|
||||||
.id = "frequency",
|
.id = "frequency",
|
||||||
.name = "Frequency (Hz)",
|
.name = "Frequency (Hz)",
|
||||||
.opts = PO_WRONCE,
|
.opts = PO_WRONCE,
|
||||||
.off = offsetof(linuxdvb_mux_t, lm_tuning.dmc_fe_freq),
|
.off = offsetof(dvb_mux_t, lm_tuning.dmc_fe_freq),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MUX_PROP_STR("bandwidth", "Bandwidth", dvbt, bw, "AUTO")
|
MUX_PROP_STR("bandwidth", "Bandwidth", dvbt, bw, "AUTO")
|
||||||
|
@ -256,39 +227,30 @@ const idclass_t linuxdvb_mux_dvbt_class =
|
||||||
* DVB-C
|
* DVB-C
|
||||||
*/
|
*/
|
||||||
|
|
||||||
linuxdvb_mux_class_R(dvbc, modulation, qam,
|
dvb_mux_class_R(dvbc, modulation, qam,
|
||||||
DVB_MOD_QAM_AUTO, DVB_MOD_QAM_16, DVB_MOD_QAM_32,
|
DVB_MOD_QAM_AUTO, DVB_MOD_QAM_16, DVB_MOD_QAM_32,
|
||||||
DVB_MOD_QAM_64, DVB_MOD_QAM_128, DVB_MOD_QAM_256
|
DVB_MOD_QAM_64, DVB_MOD_QAM_128, DVB_MOD_QAM_256);
|
||||||
);
|
dvb_mux_class_X(dvbc, qam, fec_inner, fec,
|
||||||
linuxdvb_mux_class_X(dvbc, qam, fec_inner, fec,
|
|
||||||
DVB_FEC_AUTO, DVB_FEC_NONE,
|
DVB_FEC_AUTO, DVB_FEC_NONE,
|
||||||
DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4, DVB_FEC_4_5,
|
DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4, DVB_FEC_4_5,
|
||||||
DVB_FEC_5_6, DVB_FEC_8_9
|
DVB_FEC_5_6, DVB_FEC_8_9, DVB_FEC_9_10);
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
|
||||||
, DVB_FEC_9_10
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
#define linuxdvb_mux_dvbc_class_delsys_get linuxdvb_mux_class_delsys_get
|
#define dvb_mux_dvbc_class_delsys_get dvb_mux_class_delsys_get
|
||||||
#define linuxdvb_mux_dvbc_class_delsys_set linuxdvb_mux_class_delsys_set
|
#define dvb_mux_dvbc_class_delsys_set dvb_mux_class_delsys_set
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_dvbc_class_delsys_enum (void *o)
|
dvb_mux_dvbc_class_delsys_enum (void *o)
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
#if DVB_VER_ATLEAST(5,0)
|
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBC_ANNEX_A));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBC_ANNEX_A));
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBC_ANNEX_B));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBC_ANNEX_B));
|
||||||
#if DVB_VER_ATLEAST(5,3)
|
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBC_ANNEX_C));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBC_ANNEX_C));
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idclass_t linuxdvb_mux_dvbc_class =
|
const idclass_t dvb_mux_dvbc_class =
|
||||||
{
|
{
|
||||||
.ic_super = &linuxdvb_mux_class,
|
.ic_super = &dvb_mux_class,
|
||||||
.ic_class = "linuxdvb_mux_dvbc",
|
.ic_class = "dvb_mux_dvbc",
|
||||||
.ic_caption = "Linux DVB-C Multiplex",
|
.ic_caption = "Linux DVB-C Multiplex",
|
||||||
.ic_properties = (const property_t[]){
|
.ic_properties = (const property_t[]){
|
||||||
{
|
{
|
||||||
|
@ -299,14 +261,14 @@ const idclass_t linuxdvb_mux_dvbc_class =
|
||||||
.id = "frequency",
|
.id = "frequency",
|
||||||
.name = "Frequency (Hz)",
|
.name = "Frequency (Hz)",
|
||||||
.opts = PO_WRONCE,
|
.opts = PO_WRONCE,
|
||||||
.off = offsetof(linuxdvb_mux_t, lm_tuning.dmc_fe_freq),
|
.off = offsetof(dvb_mux_t, lm_tuning.dmc_fe_freq),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.type = PT_U32,
|
.type = PT_U32,
|
||||||
.id = "symbolrate",
|
.id = "symbolrate",
|
||||||
.name = "Symbol Rate (Sym/s)",
|
.name = "Symbol Rate (Sym/s)",
|
||||||
.opts = PO_WRONCE,
|
.opts = PO_WRONCE,
|
||||||
.off = offsetof(linuxdvb_mux_t, lm_tuning.u.dmc_fe_qam.symbol_rate),
|
.off = offsetof(dvb_mux_t, lm_tuning.u.dmc_fe_qam.symbol_rate),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MUX_PROP_STR("constellation", "Constellation", dvbc, qam, "AUTO")
|
MUX_PROP_STR("constellation", "Constellation", dvbc, qam, "AUTO")
|
||||||
|
@ -318,31 +280,31 @@ const idclass_t linuxdvb_mux_dvbc_class =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
linuxdvb_mux_class_X(dvbs, qpsk, fec_inner, fec,
|
dvb_mux_class_X(dvbs, qpsk, fec_inner, fec,
|
||||||
DVB_FEC_AUTO, DVB_FEC_NONE,
|
DVB_FEC_AUTO, DVB_FEC_NONE,
|
||||||
DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4, DVB_FEC_4_5,
|
DVB_FEC_1_2, DVB_FEC_2_3, DVB_FEC_3_4, DVB_FEC_3_5,
|
||||||
DVB_FEC_5_6, DVB_FEC_7_8, DVB_FEC_8_9
|
DVB_FEC_4_5, DVB_FEC_5_6, DVB_FEC_7_8, DVB_FEC_8_9,
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
DVB_FEC_9_10);
|
||||||
, DVB_FEC_3_5, DVB_FEC_9_10
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
static const void *
|
static const void *
|
||||||
linuxdvb_mux_dvbs_class_polarity_get (void *o)
|
dvb_mux_dvbs_class_polarity_get (void *o)
|
||||||
{
|
{
|
||||||
static const char *s;
|
static const char *s;
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
s = dvb_pol2str(lm->lm_tuning.u.dmc_fe_qpsk.polarisation);
|
s = dvb_pol2str(lm->lm_tuning.u.dmc_fe_qpsk.polarisation);
|
||||||
return &s;
|
return &s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_mux_dvbs_class_polarity_set (void *o, const void *s)
|
dvb_mux_dvbs_class_polarity_set (void *o, const void *s)
|
||||||
{
|
{
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
lm->lm_tuning.u.dmc_fe_qpsk.polarisation = dvb_str2pol((const char*)s);
|
lm->lm_tuning.u.dmc_fe_qpsk.polarisation = dvb_str2pol((const char*)s);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_dvbs_class_polarity_enum (void *o)
|
dvb_mux_dvbs_class_polarity_enum (void *o)
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
htsmsg_add_str(list, NULL, dvb_pol2str(DVB_POLARISATION_VERTICAL));
|
htsmsg_add_str(list, NULL, dvb_pol2str(DVB_POLARISATION_VERTICAL));
|
||||||
|
@ -353,57 +315,58 @@ linuxdvb_mux_dvbs_class_polarity_enum (void *o)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const void *
|
static const void *
|
||||||
linuxdvb_mux_dvbs_class_modulation_get ( void *o )
|
dvb_mux_dvbs_class_modulation_get ( void *o )
|
||||||
{
|
{
|
||||||
static const char *s;
|
static const char *s;
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
s = dvb_qam2str(lm->lm_tuning.dmc_fe_modulation);
|
s = dvb_qam2str(lm->lm_tuning.dmc_fe_modulation);
|
||||||
return &s;
|
return &s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_mux_dvbs_class_modulation_set (void *o, const void *s)
|
dvb_mux_dvbs_class_modulation_set (void *o, const void *s)
|
||||||
{
|
{
|
||||||
int mod = dvb_str2qam(s);
|
int mod = dvb_str2qam(s);
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
if (mod != lm->lm_tuning.dmc_fe_modulation) {
|
if (mod != lm->lm_tuning.dmc_fe_modulation) {
|
||||||
lm->lm_tuning.dmc_fe_modulation = mod;
|
lm->lm_tuning.dmc_fe_modulation = mod;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_dvbs_class_modulation_list ( void *o )
|
dvb_mux_dvbs_class_modulation_list ( void *o )
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_QAM_AUTO));
|
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_AUTO));
|
||||||
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_QPSK));
|
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_QPSK));
|
||||||
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_QAM_16));
|
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_QAM_16));
|
||||||
#if DVB_VER_ATLEAST(5,4)
|
|
||||||
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_PSK_8));
|
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_PSK_8));
|
||||||
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_APSK_16));
|
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_APSK_16));
|
||||||
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_APSK_32));
|
htsmsg_add_str(list, NULL, dvb_qam2str(DVB_MOD_APSK_32));
|
||||||
#endif
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DVB_VER_ATLEAST(5,0)
|
|
||||||
static const void *
|
static const void *
|
||||||
linuxdvb_mux_dvbs_class_rolloff_get ( void *o )
|
dvb_mux_dvbs_class_rolloff_get ( void *o )
|
||||||
{
|
{
|
||||||
static const char *s;
|
static const char *s;
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
s = dvb_rolloff2str(lm->lm_tuning.dmc_fe_rolloff);
|
s = dvb_rolloff2str(lm->lm_tuning.dmc_fe_rolloff);
|
||||||
return &s;
|
return &s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_mux_dvbs_class_rolloff_set ( void *o, const void *s )
|
dvb_mux_dvbs_class_rolloff_set ( void *o, const void *s )
|
||||||
{
|
{
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
lm->lm_tuning.dmc_fe_rolloff = dvb_str2rolloff(s);
|
lm->lm_tuning.dmc_fe_rolloff = dvb_str2rolloff(s);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_dvbs_class_rolloff_list ( void *o )
|
dvb_mux_dvbs_class_rolloff_list ( void *o )
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
htsmsg_add_str(list, NULL, dvb_rolloff2str(DVB_ROLLOFF_35));
|
htsmsg_add_str(list, NULL, dvb_rolloff2str(DVB_ROLLOFF_35));
|
||||||
|
@ -416,22 +379,23 @@ linuxdvb_mux_dvbs_class_rolloff_list ( void *o )
|
||||||
}
|
}
|
||||||
|
|
||||||
static const void *
|
static const void *
|
||||||
linuxdvb_mux_dvbs_class_pilot_get ( void *o )
|
dvb_mux_dvbs_class_pilot_get ( void *o )
|
||||||
{
|
{
|
||||||
static const char *s;
|
static const char *s;
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
s = dvb_pilot2str(lm->lm_tuning.dmc_fe_pilot);
|
s = dvb_pilot2str(lm->lm_tuning.dmc_fe_pilot);
|
||||||
return &s;
|
return &s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_mux_dvbs_class_pilot_set ( void *o, const void *s )
|
dvb_mux_dvbs_class_pilot_set ( void *o, const void *s )
|
||||||
{
|
{
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
lm->lm_tuning.dmc_fe_pilot = dvb_str2pilot(s);
|
lm->lm_tuning.dmc_fe_pilot = dvb_str2pilot(s);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_dvbs_class_pilot_list ( void *o )
|
dvb_mux_dvbs_class_pilot_list ( void *o )
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
htsmsg_add_str(list, NULL, dvb_pilot2str(DVB_PILOT_AUTO));
|
htsmsg_add_str(list, NULL, dvb_pilot2str(DVB_PILOT_AUTO));
|
||||||
|
@ -439,12 +403,12 @@ linuxdvb_mux_dvbs_class_pilot_list ( void *o )
|
||||||
htsmsg_add_str(list, NULL, dvb_pilot2str(DVB_PILOT_OFF));
|
htsmsg_add_str(list, NULL, dvb_pilot2str(DVB_PILOT_OFF));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#define linuxdvb_mux_dvbs_class_delsys_get linuxdvb_mux_class_delsys_get
|
#define dvb_mux_dvbs_class_delsys_get dvb_mux_class_delsys_get
|
||||||
#define linuxdvb_mux_dvbs_class_delsys_set linuxdvb_mux_class_delsys_set
|
#define dvb_mux_dvbs_class_delsys_set dvb_mux_class_delsys_set
|
||||||
|
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_dvbs_class_delsys_enum (void *o)
|
dvb_mux_dvbs_class_delsys_enum (void *o)
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBS));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_DVBS));
|
||||||
|
@ -453,10 +417,10 @@ linuxdvb_mux_dvbs_class_delsys_enum (void *o)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const void *
|
static const void *
|
||||||
linuxdvb_mux_dvbs_class_orbital_get ( void *o )
|
dvb_mux_dvbs_class_orbital_get ( void *o )
|
||||||
{
|
{
|
||||||
static char buf[256], *s = buf;
|
static char buf[256], *s = buf;
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
snprintf(buf, sizeof(buf), "%0.1f%c",
|
snprintf(buf, sizeof(buf), "%0.1f%c",
|
||||||
lm->lm_tuning.u.dmc_fe_qpsk.orbital_pos / 10.0,
|
lm->lm_tuning.u.dmc_fe_qpsk.orbital_pos / 10.0,
|
||||||
lm->lm_tuning.u.dmc_fe_qpsk.orbital_dir);
|
lm->lm_tuning.u.dmc_fe_qpsk.orbital_dir);
|
||||||
|
@ -464,12 +428,12 @@ linuxdvb_mux_dvbs_class_orbital_get ( void *o )
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linuxdvb_mux_dvbs_class_orbital_set ( void *o, const void *s )
|
dvb_mux_dvbs_class_orbital_set ( void *o, const void *s )
|
||||||
{
|
{
|
||||||
int pos, save = 0;
|
int pos, save = 0;
|
||||||
char dir;
|
char dir;
|
||||||
char *tmp = tvh_strdupa(s);
|
char *tmp = tvh_strdupa(s);
|
||||||
linuxdvb_mux_t *lm = o;
|
dvb_mux_t *lm = o;
|
||||||
|
|
||||||
dir = tmp[strlen(tmp)-1];
|
dir = tmp[strlen(tmp)-1];
|
||||||
tmp[strlen(tmp)-1] = '\0';
|
tmp[strlen(tmp)-1] = '\0';
|
||||||
|
@ -484,10 +448,10 @@ linuxdvb_mux_dvbs_class_orbital_set ( void *o, const void *s )
|
||||||
return save;
|
return save;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idclass_t linuxdvb_mux_dvbs_class =
|
const idclass_t dvb_mux_dvbs_class =
|
||||||
{
|
{
|
||||||
.ic_super = &linuxdvb_mux_class,
|
.ic_super = &dvb_mux_class,
|
||||||
.ic_class = "linuxdvb_mux_dvbs",
|
.ic_class = "dvb_mux_dvbs",
|
||||||
.ic_caption = "Linux DVB-S Multiplex",
|
.ic_caption = "Linux DVB-S Multiplex",
|
||||||
.ic_properties = (const property_t[]){
|
.ic_properties = (const property_t[]){
|
||||||
{
|
{
|
||||||
|
@ -498,14 +462,14 @@ const idclass_t linuxdvb_mux_dvbs_class =
|
||||||
.id = "frequency",
|
.id = "frequency",
|
||||||
.name = "Frequency (kHz)",
|
.name = "Frequency (kHz)",
|
||||||
.opts = PO_WRONCE,
|
.opts = PO_WRONCE,
|
||||||
.off = offsetof(linuxdvb_mux_t, lm_tuning.dmc_fe_freq),
|
.off = offsetof(dvb_mux_t, lm_tuning.dmc_fe_freq),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.type = PT_U32,
|
.type = PT_U32,
|
||||||
.id = "symbolrate",
|
.id = "symbolrate",
|
||||||
.name = "Symbol Rate (Sym/s)",
|
.name = "Symbol Rate (Sym/s)",
|
||||||
.opts = PO_WRONCE,
|
.opts = PO_WRONCE,
|
||||||
.off = offsetof(linuxdvb_mux_t, lm_tuning.u.dmc_fe_qpsk.symbol_rate),
|
.off = offsetof(dvb_mux_t, lm_tuning.u.dmc_fe_qpsk.symbol_rate),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MUX_PROP_STR("polarisation", "Polarisation", dvbs, polarity, NULL)
|
MUX_PROP_STR("polarisation", "Polarisation", dvbs, polarity, NULL)
|
||||||
|
@ -514,22 +478,21 @@ const idclass_t linuxdvb_mux_dvbs_class =
|
||||||
.type = PT_STR,
|
.type = PT_STR,
|
||||||
.id = "modulation",
|
.id = "modulation",
|
||||||
.name = "Modulation",
|
.name = "Modulation",
|
||||||
.set = linuxdvb_mux_dvbs_class_modulation_set,
|
.set = dvb_mux_dvbs_class_modulation_set,
|
||||||
.get = linuxdvb_mux_dvbs_class_modulation_get,
|
.get = dvb_mux_dvbs_class_modulation_get,
|
||||||
.list = linuxdvb_mux_dvbs_class_modulation_list,
|
.list = dvb_mux_dvbs_class_modulation_list,
|
||||||
.def.s = "AUTO",
|
.def.s = "AUTO",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MUX_PROP_STR("fec", "FEC", dvbs, fec, "AUTO")
|
MUX_PROP_STR("fec", "FEC", dvbs, fec, "AUTO")
|
||||||
},
|
},
|
||||||
#if DVB_VER_ATLEAST(5,0)
|
|
||||||
{
|
{
|
||||||
.type = PT_STR,
|
.type = PT_STR,
|
||||||
.id = "rolloff",
|
.id = "rolloff",
|
||||||
.name = "Rolloff",
|
.name = "Rolloff",
|
||||||
.set = linuxdvb_mux_dvbs_class_rolloff_set,
|
.set = dvb_mux_dvbs_class_rolloff_set,
|
||||||
.get = linuxdvb_mux_dvbs_class_rolloff_get,
|
.get = dvb_mux_dvbs_class_rolloff_get,
|
||||||
.list = linuxdvb_mux_dvbs_class_rolloff_list,
|
.list = dvb_mux_dvbs_class_rolloff_list,
|
||||||
.def.s = "AUTO"
|
.def.s = "AUTO"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -537,43 +500,41 @@ const idclass_t linuxdvb_mux_dvbs_class =
|
||||||
.id = "pilot",
|
.id = "pilot",
|
||||||
.name = "Pilot",
|
.name = "Pilot",
|
||||||
.opts = PO_ADVANCED,
|
.opts = PO_ADVANCED,
|
||||||
.set = linuxdvb_mux_dvbs_class_pilot_set,
|
.set = dvb_mux_dvbs_class_pilot_set,
|
||||||
.get = linuxdvb_mux_dvbs_class_pilot_get,
|
.get = dvb_mux_dvbs_class_pilot_get,
|
||||||
.list = linuxdvb_mux_dvbs_class_pilot_list,
|
.list = dvb_mux_dvbs_class_pilot_list,
|
||||||
},
|
},
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
.type = PT_STR,
|
.type = PT_STR,
|
||||||
.id = "orbital",
|
.id = "orbital",
|
||||||
.name = "Orbital Pos.",
|
.name = "Orbital Pos.",
|
||||||
.set = linuxdvb_mux_dvbs_class_orbital_set,
|
.set = dvb_mux_dvbs_class_orbital_set,
|
||||||
.get = linuxdvb_mux_dvbs_class_orbital_get,
|
.get = dvb_mux_dvbs_class_orbital_get,
|
||||||
.opts = PO_ADVANCED | PO_RDONLY
|
.opts = PO_ADVANCED | PO_RDONLY
|
||||||
},
|
},
|
||||||
{}
|
{}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define linuxdvb_mux_atsc_class_delsys_get linuxdvb_mux_class_delsys_get
|
#define dvb_mux_atsc_class_delsys_get dvb_mux_class_delsys_get
|
||||||
#define linuxdvb_mux_atsc_class_delsys_set linuxdvb_mux_class_delsys_set
|
#define dvb_mux_atsc_class_delsys_set dvb_mux_class_delsys_set
|
||||||
|
|
||||||
static htsmsg_t *
|
static htsmsg_t *
|
||||||
linuxdvb_mux_atsc_class_delsys_enum (void *o)
|
dvb_mux_atsc_class_delsys_enum (void *o)
|
||||||
{
|
{
|
||||||
htsmsg_t *list = htsmsg_create_list();
|
htsmsg_t *list = htsmsg_create_list();
|
||||||
#if DVB_VER_ATLEAST(5,0)
|
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_ATSC));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_ATSC));
|
||||||
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_ATSCMH));
|
htsmsg_add_str(list, NULL, dvb_delsys2str(DVB_SYS_ATSCMH));
|
||||||
#endif
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
linuxdvb_mux_class_R(atsc, modulation, qam,
|
dvb_mux_class_R(atsc, modulation, qam,
|
||||||
DVB_MOD_QAM_AUTO, DVB_MOD_QAM_256, DVB_MOD_VSB_8);
|
DVB_MOD_QAM_AUTO, DVB_MOD_QAM_256, DVB_MOD_VSB_8);
|
||||||
|
|
||||||
const idclass_t linuxdvb_mux_atsc_class =
|
const idclass_t dvb_mux_atsc_class =
|
||||||
{
|
{
|
||||||
.ic_super = &linuxdvb_mux_class,
|
.ic_super = &dvb_mux_class,
|
||||||
.ic_class = "linuxdvb_mux_atsc",
|
.ic_class = "dvb_mux_atsc",
|
||||||
.ic_caption = "Linux ATSC Multiplex",
|
.ic_caption = "Linux ATSC Multiplex",
|
||||||
.ic_properties = (const property_t[]){
|
.ic_properties = (const property_t[]){
|
||||||
{
|
{
|
||||||
|
@ -584,7 +545,7 @@ const idclass_t linuxdvb_mux_atsc_class =
|
||||||
.id = "frequency",
|
.id = "frequency",
|
||||||
.name = "Frequency (kHz)",
|
.name = "Frequency (kHz)",
|
||||||
.opts = PO_WRONCE,
|
.opts = PO_WRONCE,
|
||||||
.off = offsetof(linuxdvb_mux_t, lm_tuning.dmc_fe_freq),
|
.off = offsetof(dvb_mux_t, lm_tuning.dmc_fe_freq),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MUX_PROP_STR("modulation", "Modulation", atsc, qam, "AUTO")
|
MUX_PROP_STR("modulation", "Modulation", atsc, qam, "AUTO")
|
||||||
|
@ -598,20 +559,20 @@ const idclass_t linuxdvb_mux_atsc_class =
|
||||||
* *************************************************************************/
|
* *************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linuxdvb_mux_config_save ( mpegts_mux_t *mm )
|
dvb_mux_config_save ( mpegts_mux_t *mm )
|
||||||
{
|
{
|
||||||
htsmsg_t *c = htsmsg_create_map();
|
htsmsg_t *c = htsmsg_create_map();
|
||||||
mpegts_mux_save(mm, c);
|
mpegts_mux_save(mm, c);
|
||||||
hts_settings_save(c, "input/linuxdvb/networks/%s/muxes/%s/config",
|
hts_settings_save(c, "input/dvb/networks/%s/muxes/%s/config",
|
||||||
idnode_uuid_as_str(&mm->mm_network->mn_id),
|
idnode_uuid_as_str(&mm->mm_network->mn_id),
|
||||||
idnode_uuid_as_str(&mm->mm_id));
|
idnode_uuid_as_str(&mm->mm_id));
|
||||||
htsmsg_destroy(c);
|
htsmsg_destroy(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linuxdvb_mux_display_name ( mpegts_mux_t *mm, char *buf, size_t len )
|
dvb_mux_display_name ( mpegts_mux_t *mm, char *buf, size_t len )
|
||||||
{
|
{
|
||||||
linuxdvb_mux_t *lm = (linuxdvb_mux_t*)mm;
|
dvb_mux_t *lm = (dvb_mux_t*)mm;
|
||||||
dvb_network_t *ln = (dvb_network_t*)mm->mm_network;
|
dvb_network_t *ln = (dvb_network_t*)mm->mm_network;
|
||||||
uint32_t freq = lm->lm_tuning.dmc_fe_freq;
|
uint32_t freq = lm->lm_tuning.dmc_fe_freq;
|
||||||
char pol[2] = { 0 };
|
char pol[2] = { 0 };
|
||||||
|
@ -626,7 +587,7 @@ linuxdvb_mux_display_name ( mpegts_mux_t *mm, char *buf, size_t len )
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linuxdvb_mux_create_instances ( mpegts_mux_t *mm )
|
dvb_mux_create_instances ( mpegts_mux_t *mm )
|
||||||
{
|
{
|
||||||
mpegts_network_link_t *mnl;
|
mpegts_network_link_t *mnl;
|
||||||
LIST_FOREACH(mnl, &mm->mm_network->mn_inputs, mnl_mn_link) {
|
LIST_FOREACH(mnl, &mm->mm_network->mn_inputs, mnl_mn_link) {
|
||||||
|
@ -637,11 +598,11 @@ linuxdvb_mux_create_instances ( mpegts_mux_t *mm )
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linuxdvb_mux_delete ( mpegts_mux_t *mm, int delconf )
|
dvb_mux_delete ( mpegts_mux_t *mm, int delconf )
|
||||||
{
|
{
|
||||||
/* Remove config */
|
/* Remove config */
|
||||||
if (delconf)
|
if (delconf)
|
||||||
hts_settings_remove("input/linuxdvb/networks/%s/muxes/%s",
|
hts_settings_remove("input/dvb/networks/%s/muxes/%s",
|
||||||
idnode_uuid_as_str(&mm->mm_network->mn_id),
|
idnode_uuid_as_str(&mm->mm_network->mn_id),
|
||||||
idnode_uuid_as_str(&mm->mm_id));
|
idnode_uuid_as_str(&mm->mm_id));
|
||||||
|
|
||||||
|
@ -653,15 +614,15 @@ linuxdvb_mux_delete ( mpegts_mux_t *mm, int delconf )
|
||||||
* Creation/Config
|
* Creation/Config
|
||||||
* *************************************************************************/
|
* *************************************************************************/
|
||||||
|
|
||||||
linuxdvb_mux_t *
|
dvb_mux_t *
|
||||||
linuxdvb_mux_create0
|
dvb_mux_create0
|
||||||
( dvb_network_t *ln,
|
( dvb_network_t *ln,
|
||||||
uint16_t onid, uint16_t tsid, const dvb_mux_conf_t *dmc,
|
uint16_t onid, uint16_t tsid, const dvb_mux_conf_t *dmc,
|
||||||
const char *uuid, htsmsg_t *conf )
|
const char *uuid, htsmsg_t *conf )
|
||||||
{
|
{
|
||||||
const idclass_t *idc;
|
const idclass_t *idc;
|
||||||
mpegts_mux_t *mm;
|
mpegts_mux_t *mm;
|
||||||
linuxdvb_mux_t *lm;
|
dvb_mux_t *lm;
|
||||||
htsmsg_t *c, *e;
|
htsmsg_t *c, *e;
|
||||||
htsmsg_field_t *f;
|
htsmsg_field_t *f;
|
||||||
mpegts_service_t *ts;
|
mpegts_service_t *ts;
|
||||||
|
@ -669,23 +630,23 @@ linuxdvb_mux_create0
|
||||||
|
|
||||||
/* Class */
|
/* Class */
|
||||||
if (ln->ln_type == DVB_TYPE_S)
|
if (ln->ln_type == DVB_TYPE_S)
|
||||||
idc = &linuxdvb_mux_dvbs_class;
|
idc = &dvb_mux_dvbs_class;
|
||||||
else if (ln->ln_type == DVB_TYPE_C)
|
else if (ln->ln_type == DVB_TYPE_C)
|
||||||
idc = &linuxdvb_mux_dvbc_class;
|
idc = &dvb_mux_dvbc_class;
|
||||||
else if (ln->ln_type == DVB_TYPE_T)
|
else if (ln->ln_type == DVB_TYPE_T)
|
||||||
idc = &linuxdvb_mux_dvbt_class;
|
idc = &dvb_mux_dvbt_class;
|
||||||
else if (ln->ln_type == DVB_TYPE_ATSC)
|
else if (ln->ln_type == DVB_TYPE_ATSC)
|
||||||
idc = &linuxdvb_mux_atsc_class;
|
idc = &dvb_mux_atsc_class;
|
||||||
else {
|
else {
|
||||||
tvherror("linuxdvb", "unknown FE type %d", ln->ln_type);
|
tvherror("dvb", "unknown FE type %d", ln->ln_type);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create */
|
/* Create */
|
||||||
if (!(mm = mpegts_mux_create0(calloc(1, sizeof(linuxdvb_mux_t)), idc, uuid,
|
if (!(mm = mpegts_mux_create0(calloc(1, sizeof(dvb_mux_t)), idc, uuid,
|
||||||
(mpegts_network_t*)ln, onid, tsid, conf)))
|
(mpegts_network_t*)ln, onid, tsid, conf)))
|
||||||
return NULL;
|
return NULL;
|
||||||
lm = (linuxdvb_mux_t*)mm;
|
lm = (dvb_mux_t*)mm;
|
||||||
lm->lm_tuning.dmc_fe_type = ln->ln_type;
|
lm->lm_tuning.dmc_fe_type = ln->ln_type;
|
||||||
|
|
||||||
/* Tuning */
|
/* Tuning */
|
||||||
|
@ -695,17 +656,15 @@ linuxdvb_mux_create0
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
lm->mm_delete = linuxdvb_mux_delete;
|
lm->mm_delete = dvb_mux_delete;
|
||||||
lm->mm_display_name = linuxdvb_mux_display_name;
|
lm->mm_display_name = dvb_mux_display_name;
|
||||||
lm->mm_config_save = linuxdvb_mux_config_save;
|
lm->mm_config_save = dvb_mux_config_save;
|
||||||
lm->mm_create_instances = linuxdvb_mux_create_instances;
|
lm->mm_create_instances = dvb_mux_create_instances;
|
||||||
|
|
||||||
/* Defaults */
|
/* Defaults */
|
||||||
if (dmc == NULL) {
|
if (dmc == NULL) {
|
||||||
lm->lm_tuning.dmc_fe_inversion = DVB_INVERSION_AUTO;
|
lm->lm_tuning.dmc_fe_inversion = DVB_INVERSION_AUTO;
|
||||||
#if DVB_VER_ATLEAST(5,0)
|
|
||||||
lm->lm_tuning.dmc_fe_pilot = DVB_PILOT_AUTO;
|
lm->lm_tuning.dmc_fe_pilot = DVB_PILOT_AUTO;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No config */
|
/* No config */
|
|
@ -78,10 +78,10 @@ dvb_network_class_scanfile_set ( void *o, const void *s )
|
||||||
/* Create */
|
/* Create */
|
||||||
LIST_FOREACH(dmc, &sfn->sfn_muxes, dmc_link) {
|
LIST_FOREACH(dmc, &sfn->sfn_muxes, dmc_link) {
|
||||||
if (!(mm = dvb_network_find_mux(o, dmc))) {
|
if (!(mm = dvb_network_find_mux(o, dmc))) {
|
||||||
mm = (mpegts_mux_t*)linuxdvb_mux_create0(o,
|
mm = (mpegts_mux_t*)dvb_mux_create0(o,
|
||||||
MPEGTS_ONID_NONE,
|
MPEGTS_ONID_NONE,
|
||||||
MPEGTS_TSID_NONE,
|
MPEGTS_TSID_NONE,
|
||||||
dmc, NULL, NULL);
|
dmc, NULL, NULL);
|
||||||
if (mm)
|
if (mm)
|
||||||
mm->mm_config_save(mm);
|
mm->mm_config_save(mm);
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ dvb_network_find_mux
|
||||||
{
|
{
|
||||||
mpegts_mux_t *mm;
|
mpegts_mux_t *mm;
|
||||||
LIST_FOREACH(mm, &ln->mn_muxes, mm_network_link) {
|
LIST_FOREACH(mm, &ln->mn_muxes, mm_network_link) {
|
||||||
linuxdvb_mux_t *lm = (linuxdvb_mux_t*)mm;
|
dvb_mux_t *lm = (dvb_mux_t*)mm;
|
||||||
if (abs(lm->lm_tuning.dmc_fe_freq
|
if (abs(lm->lm_tuning.dmc_fe_freq
|
||||||
- dmc->dmc_fe_freq) > LINUXDVB_FREQ_TOL) continue;
|
- dmc->dmc_fe_freq) > LINUXDVB_FREQ_TOL) continue;
|
||||||
if (lm->lm_tuning.u.dmc_fe_qpsk.polarisation != dmc->u.dmc_fe_qpsk.polarisation) continue;
|
if (lm->lm_tuning.u.dmc_fe_qpsk.polarisation != dmc->u.dmc_fe_qpsk.polarisation) continue;
|
||||||
|
@ -245,10 +245,10 @@ dvb_network_create_mux
|
||||||
dvb_network_t *ln = (dvb_network_t*)mm->mm_network;
|
dvb_network_t *ln = (dvb_network_t*)mm->mm_network;
|
||||||
mm = dvb_network_find_mux(ln, dmc);
|
mm = dvb_network_find_mux(ln, dmc);
|
||||||
if (!mm && ln->mn_autodiscovery) {
|
if (!mm && ln->mn_autodiscovery) {
|
||||||
mm = (mpegts_mux_t*)linuxdvb_mux_create0(ln, onid, tsid, dmc, NULL, NULL);
|
mm = (mpegts_mux_t*)dvb_mux_create0(ln, onid, tsid, dmc, NULL, NULL);
|
||||||
save = 1;
|
save = 1;
|
||||||
} else if (mm) {
|
} else if (mm) {
|
||||||
linuxdvb_mux_t *lm = (linuxdvb_mux_t*)mm;
|
dvb_mux_t *lm = (dvb_mux_t*)mm;
|
||||||
dmc->dmc_fe_freq = lm->lm_tuning.dmc_fe_freq;
|
dmc->dmc_fe_freq = lm->lm_tuning.dmc_fe_freq;
|
||||||
// Note: keep original freq, else it can bounce around if diff transponders
|
// Note: keep original freq, else it can bounce around if diff transponders
|
||||||
// report it slightly differently.
|
// report it slightly differently.
|
||||||
|
@ -274,18 +274,14 @@ static const idclass_t *
|
||||||
dvb_network_mux_class
|
dvb_network_mux_class
|
||||||
( mpegts_network_t *mn )
|
( mpegts_network_t *mn )
|
||||||
{
|
{
|
||||||
extern const idclass_t linuxdvb_mux_dvbt_class;
|
|
||||||
extern const idclass_t linuxdvb_mux_dvbc_class;
|
|
||||||
extern const idclass_t linuxdvb_mux_dvbs_class;
|
|
||||||
extern const idclass_t linuxdvb_mux_atsc_class;
|
|
||||||
if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbt_class))
|
if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbt_class))
|
||||||
return &linuxdvb_mux_dvbt_class;
|
return &dvb_mux_dvbt_class;
|
||||||
if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbc_class))
|
if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbc_class))
|
||||||
return &linuxdvb_mux_dvbc_class;
|
return &dvb_mux_dvbc_class;
|
||||||
if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbs_class))
|
if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbs_class))
|
||||||
return &linuxdvb_mux_dvbs_class;
|
return &dvb_mux_dvbs_class;
|
||||||
if (idnode_is_instance(&mn->mn_id, &dvb_network_atsc_class))
|
if (idnode_is_instance(&mn->mn_id, &dvb_network_atsc_class))
|
||||||
return &linuxdvb_mux_atsc_class;
|
return &dvb_mux_atsc_class;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,8 +291,8 @@ dvb_network_mux_create2
|
||||||
{
|
{
|
||||||
dvb_network_t *ln = (dvb_network_t*)mn;
|
dvb_network_t *ln = (dvb_network_t*)mn;
|
||||||
return (mpegts_mux_t*)
|
return (mpegts_mux_t*)
|
||||||
linuxdvb_mux_create0(ln, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE,
|
dvb_mux_create0(ln, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE,
|
||||||
NULL, NULL, conf);
|
NULL, NULL, conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************************************************************************
|
/* ****************************************************************************
|
||||||
|
@ -349,7 +345,7 @@ dvb_network_create0
|
||||||
HTSMSG_FOREACH(f, c) {
|
HTSMSG_FOREACH(f, c) {
|
||||||
if (!(e = htsmsg_get_map_by_field(f))) continue;
|
if (!(e = htsmsg_get_map_by_field(f))) continue;
|
||||||
if (!(e = htsmsg_get_map(e, "config"))) continue;
|
if (!(e = htsmsg_get_map(e, "config"))) continue;
|
||||||
mm = (mpegts_mux_t *)linuxdvb_mux_create1(ln, f->hmf_name, e);
|
mm = (mpegts_mux_t *)dvb_mux_create1(ln, f->hmf_name, e);
|
||||||
if (mm && move)
|
if (mm && move)
|
||||||
mm->mm_config_save(mm);
|
mm->mm_config_save(mm);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue