]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP: Added OctopusNet pids hack
authorJaroslav Kysela <perex@perex.cz>
Thu, 17 Apr 2014 20:12:04 +0000 (22:12 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 5 May 2014 20:00:37 +0000 (22:00 +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 0e3f3272fe2a8346af1a1c179a5078fbb319e7f3..9a238543314e80e1caa676bb478c639128689569 100644 (file)
@@ -105,6 +105,13 @@ const idclass_t satip_device_class =
       .opts     = PO_ADVANCED,
       .off      = offsetof(satip_device_t, sd_pids_deladd),
     },
+    {
+      .type     = PT_BOOL,
+      .id       = "pids0",
+      .name     = "PIDs in setup",
+      .opts     = PO_ADVANCED,
+      .off      = offsetof(satip_device_t, sd_pids0),
+    },
     {
       .type     = PT_STR,
       .id       = "addr",
@@ -263,6 +270,9 @@ satip_device_hack( satip_device_t *sd )
     sd->sd_pids_deladd = 0;
     tvhwarn("satip", "Detected old Inverto firmware V1.13.0.105 and less");
     tvhwarn("satip", "Upgrade to V1.16.0.120 - http://http://www.inverto.tv/support/ - IDL400s");
+  } else if (strstr(sd->sd_info.location, ":8888/octonet.xml")) {
+    /* OctopusNet requires pids in the SETUP RTSP command */
+    sd->sd_pids0       = 1;
   }
 }
 
index 80ebee2ea179c596be7857d386be261398660fd8..756908f783e46e00407735d1ba60e03c10160f73 100644 (file)
@@ -531,6 +531,11 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
    * DVB-T:
    * ver=1.1;tuner=<feID>,<level>,<lock>,<quality>,<freq>,<bw>,<msys>,<tmode>,\
    * <mtype>,<gi>,<fec>,<plp>,<t2id>,<sm>;pids=<pid0>,...,<pidn>
+   *
+   * DVB-C (OctopusNet):
+   * ver=0.9;tuner=<feID>,<0>,<lock>,<0>,<freq>,<bw>,<msys>,<mtype>;pids=<pid0>,...<pidn>
+   * example:
+   * ver=0.9;tuner=1,0,1,0,362.000,6900,dvbc,256qam;pids=0,1,16,17,18
    */
 
   /* level:
@@ -567,7 +572,25 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
         s = (char *)rtcp + 16;
         tvhtrace("satip", "Status string: '%s'", s);
         status = SIGNAL_NONE;
-        if (strncmp(s, "ver=1.0;", 8) == 0) {
+        if (strncmp(s, "ver=0.9;tuner=", 14) == 0) {
+          n = http_tokenize(s + 14, argv, 4, ',');
+          if (n < 4)
+            return;
+          if (atoi(argv[0]) != lfe->sf_number)
+            return;
+          mmi->mmi_stats.signal =
+            (atoi(argv[1]) * 100) / lfe->sf_device->sd_sig_scale;
+          if (atoi(argv[2]) > 0)
+            status = SIGNAL_GOOD;
+          mmi->mmi_stats.snr = atoi(argv[3]);
+          if (status == SIGNAL_GOOD &&
+              mmi->mmi_stats.signal == 0 && mmi->mmi_stats.snr == 0) {
+            /* some values that we're tuned */
+            mmi->mmi_stats.signal = 50;
+            mmi->mmi_stats.snr = 12;
+          }
+          goto ok;          
+        } else if (strncmp(s, "ver=1.0;", 8) == 0) {
           if ((s = strstr(s + 8, ";tuner=")) == NULL)
             return;
           s += 7;
@@ -825,7 +848,8 @@ satip_frontend_input_thread ( void *aux )
 
   r = satip_rtsp_setup(rtsp,
                        lfe->sf_position, lfe->sf_number,
-                       lfe->sf_rtp_port, &lm->lm_tuning);
+                       lfe->sf_rtp_port, &lm->lm_tuning,
+                       lfe->sf_device->sd_pids0);
   if (r < 0) {
     tvherror("satip", "%s - failed to tune", buf);
     return NULL;
index 5e35f985c57d0cbd95f124067cedecfdeec8875d..a1051c2b51cbe944cfd10be164f05c43f0e72943 100644 (file)
@@ -78,6 +78,7 @@ struct satip_device
   int                        sd_pids_len;
   int                        sd_pids_deladd;
   int                        sd_sig_scale;
+  int                        sd_pids0;
 };
 
 struct satip_frontend
@@ -202,7 +203,8 @@ int satip_satconf_get_position
 int
 satip_rtsp_setup( http_client_t *hc,
                   int src, int fe, int udp_port,
-                  const dvb_mux_conf_t *dmc );
+                  const dvb_mux_conf_t *dmc,
+                  int pids0 );
 
 int
 satip_rtsp_play( http_client_t *hc, const char *pids,
index 4d52a74d7f17e2188d6f88b4cd1f89d851020433..ed0bc8318a4eb0bd5889e9bebf12bbcd9a2d902b 100644 (file)
@@ -70,7 +70,7 @@ satip_rtsp_add_val(const char *name, char *buf, uint32_t val)
 
 int
 satip_rtsp_setup( http_client_t *hc, int src, int fe,
-                  int udp_port, const dvb_mux_conf_t *dmc )
+                  int udp_port, const dvb_mux_conf_t *dmc, int pids0 )
 {
   static tvh2satip_t msys[] = {
     { .t = DVB_SYS_DVBT,                      "dvbt"  },
@@ -175,7 +175,10 @@ satip_rtsp_setup( http_client_t *hc, int src, int fe,
     ADD(dmc_fe_delsys,              msys,  "dvbc");
     ADD(dmc_fe_modulation,          mtype, "64qam");
     /* missing plp */
-    ADD(u.dmc_fe_qpsk.fec_inner,    fec,   "auto");
+    if (dmc->u.dmc_fe_qam.fec_inner != DVB_FEC_NONE &&
+        dmc->u.dmc_fe_qam.fec_inner != DVB_FEC_AUTO)
+      /* note: OctopusNet device does not handle 'fec=auto' */
+      ADD(u.dmc_fe_qam.fec_inner,   fec,   "auto");
   } else {
     if (dmc->u.dmc_fe_ofdm.bandwidth != DVB_BANDWIDTH_AUTO &&
         dmc->u.dmc_fe_ofdm.bandwidth != DVB_BANDWIDTH_NONE)
@@ -192,6 +195,8 @@ satip_rtsp_setup( http_client_t *hc, int src, int fe,
         dmc->u.dmc_fe_ofdm.guard_interval != DVB_GUARD_INTERVAL_NONE)
       ADD(u.dmc_fe_ofdm.guard_interval, gi, "18");
   }
+  if (pids0)
+    strcat(buf, "&pids=0");
   tvhtrace("satip", "setup params - %s", buf);
   if (hc->hc_rtsp_stream_id >= 0)
     snprintf(stream = _stream, sizeof(_stream), "/stream=%li",