]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip client: add possibility to select the data transfer mode per tuner, fixes ...
authorJaroslav Kysela <perex@perex.cz>
Mon, 9 Oct 2017 12:26:54 +0000 (14:26 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 9 Oct 2017 12:26:57 +0000 (14:26 +0200)
From: Mono Polimorph

src/input/mpegts/satip/satip.c
src/input/mpegts/satip/satip_frontend.c
src/input/mpegts/satip/satip_private.h

index c3262338c794b1c3a4fc87475bf3a4f81cf9bf81..4b9b0f5e4abeb0f1c4dc4350e5c967784040bed2 100644 (file)
@@ -198,10 +198,14 @@ static const char *satip_tunercfg_tab[] = {
   "DVBS2-2,DVBT-2",
   "DVBT-1,DVBS2-1",
   "DVBT-2,DVBS2-2",
-  "DVBS2-1,DVB-C1",
-  "DVBS2-2,DVB-C2",
+  "DVBS2-1,DVBC-1",
+  "DVBS2-2,DVBC-2",
   "DVBC-1,DVBS2-1",
   "DVBC-2,DVBS2-2",
+  "DVBS2-4,DVBT-2",
+  "DVBS2-4,DVBC-2",
+  "DVBS2-4,DVBT-2,DVBC-2",
+  "DVBS2-8,DVBT-4,DVBC-4",
   NULL
 };
 
@@ -257,9 +261,10 @@ const idclass_t satip_device_class =
     {
       .type     = PT_BOOL,
       .id       = "tcp_mode",
-      .name     = N_("RTP/AVP/TCP (embedded data)"),
-      .desc     = N_("Enable or disable RTP/AVP/TCP transfer mode "
-                     "(embedded data in the RTSP session) support."),
+      .name     = N_("RTP/AVP/TCP transport supported"),
+      .desc     = N_("The server suports the Interlaved TCP transfer mode "
+                     "(embedded data in the RTSP session). And this option "
+                     "enables this mode in all tuners by default."),
       .opts     = PO_ADVANCED,
       .off      = offsetof(satip_device_t, sd_tcp_mode),
     },
index acca4a6ee31a8ea1f65e733a8a3561c45767f77b..a9b2ebebc74e2e22bcb4302cd03433bf03d4009d 100644 (file)
 #include <sys/socket.h>
 #endif
 
+
+typedef enum rtp_transport_mode
+{
+  RTP_SERVER_DEFAULT,     // Use server configuretion
+  RTP_UDP,                // Use regular RTP
+  RTP_INTERLEAVED,        // Use Interleaved RTP/AVP/TCP
+} rtp_transport_mode_t;
+
+
 /*
  *
  */
@@ -136,6 +145,17 @@ satip_frontend_class_override_enum( void * p, const char *lang )
   return m;
 }
 
+static htsmsg_t *
+satip_frontend_transport_mode_list ( void *o, const char *lang )
+{
+  static const struct strtab tab[] = {
+    { N_("Default server config"),    RTP_SERVER_DEFAULT },
+    { N_("RTP over UDP"),             RTP_UDP },
+    { N_("TCP Interleaved"),          RTP_INTERLEAVED },
+  };
+  return strtab2htsmsg(tab, 1, lang);
+}
+
 CLASS_DOC(satip_frontend)
 
 const idclass_t satip_frontend_class =
@@ -154,6 +174,15 @@ const idclass_t satip_frontend_class =
       .opts     = PO_RDONLY | PO_NOSAVE,
       .off      = offsetof(satip_frontend_t, sf_number),
     },
+    {
+      .type     = PT_INT,
+      .id       = "transport_mode",
+      .name     = N_("Transport mode"),
+      .desc     = N_("Select the transport used for this tuner."),
+      .list     = satip_frontend_transport_mode_list,
+      .off      = offsetof(satip_frontend_t, sf_transport_mode),
+      .opts     = PO_ADVANCED,
+    },
     {
       .type     = PT_INT,
       .id       = "udp_rtp_port",
@@ -1569,7 +1598,9 @@ new_tune:
   seq         = -1;
   lfe->sf_seq = -1;
   play2       = 1;
-  rtsp_flags  = lfe->sf_device->sd_tcp_mode ? SATIP_SETUP_TCP : 0;
+  rtsp_flags  = lfe->sf_device->sd_tcp_mode;
+  if (lfe->sf_transport_mode != RTP_SERVER_DEFAULT)
+    rtsp_flags = lfe->sf_transport_mode == RTP_INTERLEAVED ? SATIP_SETUP_TCP : 0;
 
   if ((rtsp_flags & SATIP_SETUP_TCP) == 0) {
     if (udp_bind_double(&rtp, &rtcp,
index 7c49ea1a601b70f39108759dcd704fb9fc68d229..64ffa90af472d8faa30388fe31a211c022d093ef 100644 (file)
@@ -134,6 +134,7 @@ struct satip_frontend
   char                      *sf_type_override;
   int                        sf_master;
   int                        sf_udp_rtp_port;
+  int                        sf_transport_mode;
   int                        sf_play2;
   int                        sf_tdelay;
   int                        sf_grace_period;