]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip server: add possibility to export DVB-C and DVB-S2 muxes for IPTV input, fixes...
authorJaroslav Kysela <perex@perex.cz>
Mon, 18 Sep 2017 12:31:52 +0000 (14:31 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 18 Sep 2017 12:46:12 +0000 (14:46 +0200)
From: Mono Polimorph

src/input/mpegts/iptv/iptv_mux.c
src/input/mpegts/iptv/iptv_private.h
src/satip/rtsp.c
src/satip/server.c

index fba69fee5df0ea2cdd6cdc6dcfc06eebf9f46fc6..d993e5d48dc8e49548e6f554cf189f65720c18aa 100644 (file)
@@ -255,6 +255,23 @@ const idclass_t iptv_mux_class =
       .id       = "iptv_satip_dvbt_freq",
       .name     = N_("SAT>IP DVB-T frequency (Hz)"),
       .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbt_freq),
+      .desc     = N_("For example: 658000000. This frequency is 658Mhz."),
+      .opts     = PO_ADVANCED
+    },
+    {
+      .type     = PT_U32,
+      .id       = "iptv_satip_dvbc_freq",
+      .name     = N_("SAT>IP DVB-C frequency (Hz)"),
+      .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbc_freq),
+      .desc     = N_("For example: 312000000. This frequency is 312Mhz."),
+      .opts     = PO_ADVANCED
+    },
+    {
+      .type     = PT_U32,
+      .id       = "iptv_satip_dvbs_freq",
+      .name     = N_("SAT>IP DVB-S frequency (kHz)"),
+      .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbs_freq),
+      .desc     = N_("For example: 12610500. This frequency is 12610.5Mhz or 12.6105Ghz."),
       .opts     = PO_ADVANCED
     },
     {
index 851eef7d7d667f0ab3f2a83e2588c5cf0d179b26..9fa60297e02aaf8db478f340548f5908c37d876c 100644 (file)
@@ -132,6 +132,8 @@ struct iptv_mux
   char                 *mm_iptv_hdr;
   char                 *mm_iptv_tags;
   uint32_t              mm_iptv_satip_dvbt_freq;
+  uint32_t              mm_iptv_satip_dvbc_freq;
+  uint32_t              mm_iptv_satip_dvbs_freq;
 
   uint32_t              mm_iptv_rtp_seq;
 
index 5550c849673d95db5ee37114e926f53b3131315c..b7c03883ae564b0b0e4ebd153f37cb588c56ceae 100644 (file)
@@ -556,9 +556,17 @@ rtsp_start
       }
 #if ENABLE_IPTV
       if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) {
-        LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link)
-          if (deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbt_freq) < 2000)
+        LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) {
+          if (rs->dmc.dmc_fe_type == DVB_TYPE_T &&
+              deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbt_freq) < 2000)
             break;
+          if (rs->dmc.dmc_fe_type == DVB_TYPE_C &&
+              deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbc_freq) < 2000)
+            break;
+          if (rs->dmc.dmc_fe_type == DVB_TYPE_S &&
+              deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbs_freq) < 2000)
+            break;
+          }
         if (mux) {
           dmc = rs->dmc;
           rs->perm_lock = 1;
index 89730947b3da6c38a07b7bc7bc22ea06a6bc1eaf..eeef9f1a8cd96ebb52dd02d69a7d21471f95dcca 100644 (file)
@@ -152,14 +152,25 @@ satip_server_http_xml(http_connection_t *hc)
 #if ENABLE_IPTV
     else if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) {
       mpegts_mux_t *mm;
-      LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link)
+      LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link) {
         if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbt_freq) {
           dvbt++;
-          break;
         }
+        if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbc_freq) {
+          dvbc++;
+        }
+        if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbs_freq) {
+          dvbs++;
+        }
+      }
     }
 #endif
   }
+  // The SAT>IP specification only supports 1-9 tuners (1 digit)!
+  if (dvbt > 9) dvbt = 9;
+  if (dvbc > 9) dvbc = 9;
+  if (dvbs > 9) dvbs = 9;
+  if (atsc > 9) atsc = 9;
   for (p = xtab; p->id; p++) {
     i = *p->cptr;
     if (i > 0) {