Project

General

Profile

Actions

Feature #4505

closed

SAT>IP: configurable RTP/AVP/TCP support

Added by Mono Polimorph over 7 years ago. Updated over 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
SAT>IP
Target version:
-
Start date:
2017-07-07
Due date:
% Done:

100%

Estimated time:
(Total: 0:00 h)

Description

Hi,

I improved my previous patch about the RTP/AVP/TCP support (#4476).

Now I added the configuration in the client side at TUNER level. This works like this:

  • By default TVH not use RTP_over_TCP with a SAT>IP server.
  • But, if you enable RTP_over_TCP for a specific SERVER then you (always) use TCP for connections to this server (if the server supports it).
  • Now you can disable the RTP_over_TCP at TUNER level. So, if you have configured the server for TCP, then you can select now which tuners from this server you want to transport using regular RTP over UDP.

Additionally, this patch includes my previous one for disabling at SAT>IP support for RTP_over_TCP at server level.

In which scenario you want to use some tuners with TCP and some others with UDP with the same server? One example:

  • Imagine that you want to use the position AA (src=1) for UDP, and position AB (src=2) for TCP (both for the same real position). The position value is very easy to configure (any modify) in any SAT>IP client. Then you can create two networks in your TVH. The first one for UDP and the second for TCP. Then in the SAT>IP client configuration you can duplicate the number of the tuners in your server. And you can copy the configuration of the previous tuners to the duplicates. Now, you only need to enable the RTP/AVP/TCP support for the entire server, and disable it for the original tuners. From this point only rests to configure the duplicated tuners with the new network (the one with position 2)... And magically when you request position AA you will use the original tuners with UDP, and when request with position AB you receive the same using TCP.

I found this very useful. So, I suggest to accept this new patch:

---
 src/input/mpegts/satip/satip_frontend.c |   12 +++++++++++-
 src/input/mpegts/satip/satip_private.h  |    1 +
 src/satip/rtsp.c                        |    2 +-
 src/satip/server.c                      |   10 ++++++++++
 src/satip/server.h                      |    1 +
 5 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/input/mpegts/satip/satip_frontend.c b/src/input/mpegts/satip/satip_frontend.c
index f9193c3..91582ca 100644
--- a/src/input/mpegts/satip/satip_frontend.c
+++ b/src/input/mpegts/satip/satip_frontend.c
@@ -165,6 +165,16 @@ const idclass_t satip_frontend_class =
       .opts     = PO_ADVANCED,
     },
     {
+      .type     = PT_BOOL,
+      .id       = "no_tcp_mode",
+      .name     = N_("Not use RTP/AVP/TCP"),
+      .desc     = N_("Not use the RTP/AVP/TCP transfer mode " 
+                     "for this tuner even if the server supports it " 
+                     "and the client is configured to do so."),
+      .off      = offsetof(satip_frontend_t, sf_no_tcp_mode),
+      .opts     = PO_ADVANCED,
+    },
+    {
       .type     = PT_INT,
       .id       = "tdelay",
       .name     = N_("Next tune delay in ms (0-2000)"),
@@ -1569,7 +1579,7 @@ 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 ? lfe->sf_no_tcp_mode ? 0 : SATIP_SETUP_TCP : 0;

   if ((rtsp_flags & SATIP_SETUP_TCP) == 0) {
     if (udp_bind_double(&rtp, &rtcp,
diff --git a/src/input/mpegts/satip/satip_private.h b/src/input/mpegts/satip/satip_private.h
index 7c49ea1..b263cb4 100644
--- a/src/input/mpegts/satip/satip_private.h
+++ b/src/input/mpegts/satip/satip_private.h
@@ -134,6 +134,7 @@ struct satip_frontend
   char                      *sf_type_override;
   int                        sf_master;
   int                        sf_udp_rtp_port;
+  int                        sf_no_tcp_mode;
   int                        sf_play2;
   int                        sf_tdelay;
   int                        sf_grace_period;
diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c
index aa40668..6e46871 100644
--- a/src/satip/rtsp.c
+++ b/src/satip/rtsp.c
@@ -861,7 +861,7 @@ parse_transport(http_connection_t *hc)
     if (a + 1 != b)
       return -1;
     return a;
-  } else if (strncmp(s, "RTP/AVP/TCP;interleaved=0-1", 27) == 0) {
+  } else if ((strncmp(s, "RTP/AVP/TCP;interleaved=0-1", 27) == 0) && !satip_server_conf.satip_notcp_mode) {
     return RTSP_TCP_DATA;
   }
   return -1;
diff --git a/src/satip/server.c b/src/satip/server.c
index c429056..feca0a8 100644
--- a/src/satip/server.c
+++ b/src/satip/server.c
@@ -717,6 +717,16 @@ const idclass_t satip_server_class = {
       .group  = 1,
     },
     {
+      .type   = PT_BOOL,
+      .id     = "satip_notcp_mode",
+      .name   = N_("Disable RTP/AVP/TCP support"),
+      .desc   = N_("Remove server support for RTP/AVP/TCP transfer mode " 
+                   "(embedded data in the RTSP session)."),
+      .off    = offsetof(struct satip_server_conf, satip_notcp_mode),
+      .opts   = PO_EXPERT,
+      .group  = 1,
+    },
+    {
       .type   = PT_U32,
       .id     = "satip_iptv_sig_level",
       .name   = N_("IPTV signal level"),
diff --git a/src/satip/server.h b/src/satip/server.h
index 471027f..f228f60 100644
--- a/src/satip/server.h
+++ b/src/satip/server.h
@@ -47,6 +47,7 @@ struct satip_server_conf {
   int satip_rewrite_pmt;
   int satip_muxcnf;
   int satip_nom3u;
+  int satip_notcp_mode;
   int satip_anonymize;
   int satip_iptv_sig_level;
   int satip_force_sig_level;
--
1.7.10.4


Files


Subtasks 1 (0 open1 closed)

Feature #4476: SAT>IP: Patch for disable RTP/AVP/TCPRejectedJaroslav Kysela2017-07-07

Actions
Actions

Also available in: Atom PDF