[vlc-commits] rtp: remove support for RTP framing over TCP

Rémi Denis-Courmont git at videolan.org
Sat Apr 25 13:22:41 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr 25 14:14:28 2020 +0300| [472c70673b697add85b0dbae5b1f0b5e06611f9f] | committer: Rémi Denis-Courmont

rtp: remove support for RTP framing over TCP

This is specified in RFC 4571. However there are no standard ways to
negotiate it without COMEDIA (RFC 4572). Since COMEDIA implies
SDP Offer/Answer, it cannot be used with VLC so far.

Given that there is no and never was a way to send such stream with the
VLC streaming output, it is pretty safe to assume that this was never
used. To make matters worse, the receival code never worked on Windows.

Remove this at least for the time being.

Note: This was meant for transfering RTP/RTCP over dedicated TCP
streams. This was *not* meant to do "interleaved" TCP whereby RTP is
sent over the same TCP stream as RTSP controls.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=472c70673b697add85b0dbae5b1f0b5e06611f9f
---

 modules/access/rtp/input.c   | 44 --------------------------------------------
 modules/access/rtp/rtp.c     | 13 ++-----------
 modules/access/rtp/rtp.h     |  2 --
 modules/access/rtp/session.c | 16 ----------------
 4 files changed, 2 insertions(+), 73 deletions(-)

diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index b1fb708b13..1548609196 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -187,47 +187,3 @@ void *rtp_dgram_thread (void *opaque)
     }
     return NULL;
 }
-
-/**
- * RTP/RTCP session thread for stream sockets (framed RTP)
- */
-void *rtp_stream_thread (void *opaque)
-{
-#ifndef _WIN32
-    demux_t *demux = opaque;
-    demux_sys_t *sys = demux->p_sys;
-    int fd = sys->fd;
-
-    for (;;)
-    {
-        /* There is no reordering on stream sockets, so no timeout. */
-        ssize_t val;
-
-        uint16_t frame_len;
-        if (recv (fd, &frame_len, 2, MSG_WAITALL) != 2)
-            break;
-
-        block_t *block = block_Alloc (ntohs (frame_len));
-        if (unlikely(block == NULL))
-            break;
-
-        block_cleanup_push (block);
-        val = recv (fd, block->p_buffer, block->i_buffer, MSG_WAITALL);
-        vlc_cleanup_pop ();
-
-        if (val != (ssize_t)block->i_buffer)
-        {
-            block_Release (block);
-            break;
-        }
-
-        int canc = vlc_savecancel ();
-        rtp_process (demux, block);
-        rtp_dequeue_force (demux, sys->session);
-        vlc_restorecancel (canc);
-    }
-#else
-    (void) opaque;
-#endif
-    return NULL;
-}
diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 85aa754753..264de84415 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -335,9 +335,6 @@ static int OpenURL(vlc_object_t *obj)
     if (!strcasecmp(demux->psz_name, "dccp"))
         tp = IPPROTO_DCCP;
     else
-    if (!strcasecmp(demux->psz_name, "rtptcp"))
-        tp = IPPROTO_TCP;
-    else
     if (!strcasecmp(demux->psz_name, "rtp"))
         tp = IPPROTO_UDP;
     else
@@ -402,10 +399,6 @@ static int OpenURL(vlc_object_t *obj)
             msg_Err (obj, "DCCP support not included");
 #endif
             break;
-
-        case IPPROTO_TCP:
-            fd = net_Connect (obj, dhost, dport, SOCK_STREAM, tp);
-            break;
     }
 
     free (tmp);
@@ -470,8 +463,7 @@ static int OpenURL(vlc_object_t *obj)
     }
 #endif
 
-    if (vlc_clone (&p_sys->thread,
-                   (tp != IPPROTO_TCP) ? rtp_dgram_thread : rtp_stream_thread,
+    if (vlc_clone (&p_sys->thread, rtp_dgram_thread,
                    demux, VLC_THREAD_PRIORITY_INPUT))
         goto error;
     p_sys->thread_ready = true;
@@ -569,6 +561,5 @@ vlc_module_begin()
         change_string_list(dynamic_pt_list, dynamic_pt_list_text)
 
     /*add_shortcut ("sctp")*/
-    add_shortcut("dccp", "rtptcp", /* "tcp" is already taken :( */
-                 "rtp", "udplite")
+    add_shortcut("dccp", "rtp", "udplite")
 vlc_module_end()
diff --git a/modules/access/rtp/rtp.h b/modules/access/rtp/rtp.h
index fca75f58df..01a50c8427 100644
--- a/modules/access/rtp/rtp.h
+++ b/modules/access/rtp/rtp.h
@@ -55,11 +55,9 @@ rtp_session_t *rtp_session_create (demux_t *);
 void rtp_session_destroy (demux_t *, rtp_session_t *);
 void rtp_queue (demux_t *, rtp_session_t *, block_t *);
 bool rtp_dequeue (demux_t *, const rtp_session_t *, vlc_tick_t *);
-void rtp_dequeue_force (demux_t *, const rtp_session_t *);
 int rtp_add_type (demux_t *demux, rtp_session_t *ses, const rtp_pt_t *pt);
 
 void *rtp_dgram_thread (void *data);
-void *rtp_stream_thread (void *data);
 
 /* Global data */
 typedef struct
diff --git a/modules/access/rtp/session.c b/modules/access/rtp/session.c
index 708ea61edf..cfa17faee4 100644
--- a/modules/access/rtp/session.c
+++ b/modules/access/rtp/session.c
@@ -461,22 +461,6 @@ bool rtp_dequeue (demux_t *demux, const rtp_session_t *session,
     return pending;
 }
 
-/**
- * Dequeues all RTP packets and pass them to decoder. Not cancellation-safe(?).
- * This function can be used when the packet source is known not to reorder.
- */
-void rtp_dequeue_force (demux_t *demux, const rtp_session_t *session)
-{
-    for (unsigned i = 0, max = session->srcc; i < max; i++)
-    {
-        rtp_source_t *src = session->srcv[i];
-        block_t *block;
-
-        while (((block = src->blocks)) != NULL)
-            rtp_decode (demux, session, src);
-    }
-}
-
 /**
  * Decodes one RTP packet.
  */



More information about the vlc-commits mailing list