From: Jaroslav Kysela Date: Mon, 21 Oct 2019 08:36:41 +0000 (+0200) Subject: satip client: allow to set the rolloff to all possible combinations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb06654aea29c13d883314c03573ddcf6a77c954;p=thirdparty%2Ftvheadend.git satip client: allow to set the rolloff to all possible combinations --- diff --git a/src/input/mpegts/satip/satip.c b/src/input/mpegts/satip/satip.c index da5593379..cd6a8c074 100644 --- a/src/input/mpegts/satip/satip.c +++ b/src/input/mpegts/satip/satip.c @@ -226,6 +226,18 @@ satip_device_class_tunercfg_notify ( void *o, const char *lang ) satip_device_destroy_later(sd, 100); } +static htsmsg_t * +satip_device_class_default_rolloff_list ( void *o, const char *lang ) +{ + static const struct strtab tab[] = { + { N_("Auto"), SATIP_DEFAULT_ROLLOFF_AUTO }, + { N_("0.35"), SATIP_DEFAULT_ROLLOFF_35 }, + { N_("0.25"), SATIP_DEFAULT_ROLLOFF_25 }, + { N_("0.20"), SATIP_DEFAULT_ROLLOFF_20 } + }; + return strtab2htsmsg(tab, 1, lang); +} + CLASS_DOC(satip_client) const idclass_t satip_device_class = @@ -341,14 +353,15 @@ const idclass_t satip_device_class = .off = offsetof(satip_device_t, sd_pilot_on), }, { - .type = PT_BOOL, - .id = "rolloffon", - .name = N_("Force rolloff for DVB-S2"), - .desc = N_("Enable if the SAT>IP box requests ro=0.35 " + .type = PT_INT, + .id = "default_rolloff", + .name = N_("Send rolloff settings for DVB-S2"), + .desc = N_("Enable if the SAT>IP box requires ro= " "parameter in the SETUP RTSP command for DVB-S2 " "muxes."), .opts = PO_ADVANCED, - .off = offsetof(satip_device_t, sd_rolloff_on), + .list = satip_device_class_default_rolloff_list, + .off = offsetof(satip_device_t, sd_default_rolloff), }, { .type = PT_BOOL, @@ -593,7 +606,7 @@ satip_device_hack( satip_device_t *sd ) sd->sd_pids_max = 64; sd->sd_pids_len = 255; sd->sd_pilot_on = 1; - sd->sd_rolloff_on = 1; + sd->sd_default_rolloff = SATIP_DEFAULT_ROLLOFF_35; } else if (strstr(sd->sd_info.manufacturer, "KATHREIN") && (strstr(sd->sd_info.modelname, "EXIP-4124") || strstr(sd->sd_info.modelname, "EXIP-418") || @@ -602,7 +615,7 @@ satip_device_hack( satip_device_t *sd ) sd->sd_pids_max = 64; sd->sd_pids_len = 255; sd->sd_pilot_on = 1; - sd->sd_rolloff_on = 1; + sd->sd_default_rolloff = SATIP_DEFAULT_ROLLOFF_35; } else if (strcmp(sd->sd_info.modelname, "TVHeadend SAT>IP") == 0) { sd->sd_pids_max = 128; sd->sd_pids_len = 2048; diff --git a/src/input/mpegts/satip/satip_frontend.c b/src/input/mpegts/satip/satip_frontend.c index 4f1d5b107..c11a1c766 100644 --- a/src/input/mpegts/satip/satip_frontend.c +++ b/src/input/mpegts/satip/satip_frontend.c @@ -1859,8 +1859,19 @@ new_tune: position = lfe_master->sf_position; if (lfe->sf_device->sd_pilot_on) rtsp_flags |= SATIP_SETUP_PILOT_ON; - if (lfe->sf_device->sd_rolloff_on) - rtsp_flags |= SATIP_SETUP_ROLLOFF_ON; + switch (lfe->sf_device->sd_default_rolloff) { + case SATIP_DEFAULT_ROLLOFF_20: + rtsp_flags |= SATIP_SETUP_ROLLOFF_25; + break; + case SATIP_DEFAULT_ROLLOFF_25: + rtsp_flags |= SATIP_SETUP_ROLLOFF_25; + break; + case SATIP_DEFAULT_ROLLOFF_35: + rtsp_flags |= SATIP_SETUP_ROLLOFF_35; + break; + default: + break; + } if (lfe->sf_device->sd_pids21) rtsp_flags |= SATIP_SETUP_PIDS21; if (lfe->sf_specinv == 0) diff --git a/src/input/mpegts/satip/satip_private.h b/src/input/mpegts/satip/satip_private.h index a97cfa960..f150bb396 100644 --- a/src/input/mpegts/satip/satip_private.h +++ b/src/input/mpegts/satip/satip_private.h @@ -29,6 +29,11 @@ #define SATIP_BUF_SIZE (4000*188) +#define SATIP_DEFAULT_ROLLOFF_AUTO 0 +#define SATIP_DEFAULT_ROLLOFF_35 1 +#define SATIP_DEFAULT_ROLLOFF_25 2 +#define SATIP_DEFAULT_ROLLOFF_20 3 + typedef struct satip_device_info satip_device_info_t; typedef struct satip_device satip_device_t; typedef struct satip_tune_req satip_tune_req_t; @@ -92,7 +97,7 @@ struct satip_device char *sd_tunercfg; int sd_pids21; int sd_pilot_on; - int sd_rolloff_on; + int sd_default_rolloff; int sd_no_univ_lnb; int sd_can_weight; int sd_dbus_allow; @@ -287,11 +292,13 @@ satip_satconf_t *satip_satconf_get_position #define SATIP_SETUP_TCP (1<<0) #define SATIP_SETUP_PLAY (1<<1) #define SATIP_SETUP_PILOT_ON (1<<2) -#define SATIP_SETUP_ROLLOFF_ON (1<<3) -#define SATIP_SETUP_PIDS21 (1<<4) -#define SATIP_SETUP_FE (1<<5) -#define SATIP_SETUP_SPECINV0 (1<<6) -#define SATIP_SETUP_SPECINV1 (1<<7) +#define SATIP_SETUP_ROLLOFF_20 (1<<3) +#define SATIP_SETUP_ROLLOFF_25 (1<<4) +#define SATIP_SETUP_ROLLOFF_35 (1<<5) +#define SATIP_SETUP_PIDS21 (1<<6) +#define SATIP_SETUP_FE (1<<7) +#define SATIP_SETUP_SPECINV0 (1<<8) +#define SATIP_SETUP_SPECINV1 (1<<9) int satip_rtsp_setup( http_client_t *hc, diff --git a/src/input/mpegts/satip/satip_rtsp.c b/src/input/mpegts/satip/satip_rtsp.c index fe31ff6eb..d19aab94e 100644 --- a/src/input/mpegts/satip/satip_rtsp.c +++ b/src/input/mpegts/satip/satip_rtsp.c @@ -185,11 +185,18 @@ satip_rtsp_setup( http_client_t *hc, int src, int fe, if (dmc->u.dmc_fe_qpsk.fec_inner != DVB_FEC_NONE && dmc->u.dmc_fe_qpsk.fec_inner != DVB_FEC_AUTO) ADD(u.dmc_fe_qpsk.fec_inner, fec, "auto"); - if ((dmc->dmc_fe_rolloff != DVB_ROLLOFF_NONE && - dmc->dmc_fe_rolloff != DVB_ROLLOFF_AUTO) || - ((flags & SATIP_SETUP_ROLLOFF_ON) != 0 && - dmc->dmc_fe_delsys == DVB_SYS_DVBS2)) + if (dmc->dmc_fe_rolloff != DVB_ROLLOFF_NONE && + dmc->dmc_fe_rolloff != DVB_ROLLOFF_AUTO) { ADD(dmc_fe_rolloff, ro, "0.35"); + } if (dmc->dmc_fe_delsys == DVB_SYS_DVBS2) { + if (flags & SATIP_SETUP_ROLLOFF_20) { + satip_rtsp_add_val("ro", buf, 200); + } else if (flags & SATIP_SETUP_ROLLOFF_25) { + satip_rtsp_add_val("ro", buf, 250); + } else if (flags & SATIP_SETUP_ROLLOFF_35) { + satip_rtsp_add_val("ro", buf, 350); + } + } if (dmc->dmc_fe_pilot != DVB_PILOT_NONE && dmc->dmc_fe_pilot != DVB_PILOT_AUTO) { ADD(dmc_fe_pilot, plts, "auto");