]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip client: allow to set the rolloff to all possible combinations
authorJaroslav Kysela <perex@perex.cz>
Mon, 21 Oct 2019 08:36:41 +0000 (10:36 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 21 Oct 2019 08:38:52 +0000 (10:38 +0200)
src/input/mpegts/satip/satip.c
src/input/mpegts/satip/satip_frontend.c
src/input/mpegts/satip/satip_private.h
src/input/mpegts/satip/satip_rtsp.c

index da5593379d00ab57f920fd6bb67dee70e217a025..cd6a8c074abc8a9e9ac9e2daa367550420719d8b 100644 (file)
@@ -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;
index 4f1d5b1077aa7fd5e6b366afefcc97948652f926..c11a1c76609f4cd543a33c443620387f3b480b03 100644 (file)
@@ -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)
index a97cfa960e6d8335b23e68f0951da9183f545710..f150bb396938d64ba8a1b22680c58e2ea0822726 100644 (file)
 
 #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,
index fe31ff6eb8a941b54e82a2bb9ebe310dc96314c8..d19aab94e0ff8b7d8f625ed4058441f6ccfc974a 100644 (file)
@@ -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");