]> 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 13:18:41 +0000 (15:18 +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 eadbe613325d8958d43b5b5a59d501bf617df93d..254b916121f47263d64088a253d4b66ddec61f4a 100644 (file)
@@ -244,6 +244,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 c13bf9052fbddaac28f2357c922b3dac30dc22af..2b82735d2b8a1a9ebe4a88268f79620325f24f15 100644 (file)
@@ -141,6 +141,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 8828284498a01a52fdcccaf8b5b82e0730fb1ac1..b49bf7eac64f56e1414e2b4595aa7830d4aaefae 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 4a5fb54bc9716404f85569a8a88d944f5be5dfeb..6ed6636e02b05b746312cd19389dc37df3bb5b40 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) {