[vlc-commits] [Git][videolan/vlc][master] 9 commits: access: rtp: split as static rtp library
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Jun 29 08:36:51 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
49bdbee1 by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: rtp: split as static rtp library
- - - - -
fa875d5c by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: rtp: use only dedicated sys for session params
- - - - -
3bb87301 by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: rtp: use only dedicated sys for rtp input thread vars
- - - - -
f9bafd1b by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: rtp: add define for session defaults
- - - - -
16137cdd by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: move session params into session
- - - - -
0a546c08 by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: rtp: remove rtp_dequeue sys dependency
- - - - -
86d3d8d5 by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: rtp: remove unused session scoped chained demux
- - - - -
8278642c by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: input: header split input and thread only contexts
- - - - -
e133197b by Francois Cartegnie at 2023-06-29T07:59:39+00:00
access: rtp: allow control of packet timing for rtp_dequeue
- - - - -
6 changed files:
- modules/access/rtp/Makefile.am
- modules/access/rtp/input.c
- + modules/access/rtp/input.h
- modules/access/rtp/rtp.c
- modules/access/rtp/rtp.h
- modules/access/rtp/session.c
Changes:
=====================================
modules/access/rtp/Makefile.am
=====================================
@@ -1,15 +1,20 @@
# RTP plugin
access_LTLIBRARIES += librtp_plugin.la
librtp_plugin_la_SOURCES = \
- access/rtp/input.c \
- access/rtp/session.c \
+ access/rtp/input.c access/rtp/input.h \
access/rtp/sdp.c access/rtp/sdp.h \
- access/rtp/rtpfmt.c \
access/rtp/datagram.c access/rtp/vlc_dtls.h \
access/rtp/rtp.c access/rtp/rtp.h
librtp_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/access/rtp
librtp_plugin_la_CFLAGS = $(AM_CFLAGS)
-librtp_plugin_la_LIBADD = $(SOCKET_LIBS)
+librtp_plugin_la_LIBADD = libvlc_rtp.la $(SOCKET_LIBS)
+
+# RTP library
+libvlc_rtp_la_SOURCES = access/rtp/rtpfmt.c access/rtp/rtp.h \
+ access/rtp/session.c
+libvlc_rtp_la_CPPFLAGS = -I$(srcdir)/access/rtp
+libvlc_rtp_la_LDFLAGS = -no-undefined
+noinst_LTLIBRARIES += libvlc_rtp.la
# Secure RTP library
libvlc_srtp_la_SOURCES = access/rtp/srtp.c access/rtp/srtp.h
@@ -18,14 +23,13 @@ libvlc_srtp_la_CFLAGS = $(GCRYPT_CFLAGS)
libvlc_srtp_la_LDFLAGS = -static
libvlc_srtp_la_LIBADD = $(GCRYPT_LIBS)
-librtp_plugin_la_DEPENDENCIES =
if HAVE_GCRYPT
noinst_LTLIBRARIES += libvlc_srtp.la
librtp_plugin_la_CPPFLAGS += -DHAVE_SRTP
librtp_plugin_la_CFLAGS += $(GCRYPT_CFLAGS)
librtp_plugin_la_LIBADD += libvlc_srtp.la $(GCRYPT_LIBS)
-librtp_plugin_la_DEPENDENCIES += libvlc_srtp.la
+librtp_plugin_la_DEPENDENCIES = libvlc_srtp.la
endif
noinst_HEADERS += access/rtp/fmtp.h
=====================================
modules/access/rtp/input.c
=====================================
@@ -46,13 +46,15 @@
#ifdef HAVE_SRTP
# include "srtp.h"
#endif
+#include "input.h"
#define DEFAULT_MRU (1500u - (20 + 8))
/**
* Processes a packet received from the RTP socket.
*/
-static void rtp_process (rtp_sys_t *sys, block_t *block)
+static void rtp_process (struct vlc_logger *logger, rtp_input_sys_t *sys,
+ rtp_session_t *session, block_t *block)
{
if (block->i_buffer < 2)
goto drop;
@@ -66,14 +68,14 @@ static void rtp_process (rtp_sys_t *sys, block_t *block)
size_t len = block->i_buffer;
if (srtp_recv (sys->srtp, block->p_buffer, &len))
{
- vlc_debug (sys->logger, "SRTP authentication/decryption failed");
+ vlc_debug (logger, "SRTP authentication/decryption failed");
goto drop;
}
block->i_buffer = len;
}
#endif
- rtp_queue (sys, sys->session, block);
+ rtp_queue (logger, session, block);
return;
drop:
block_Release (block);
@@ -101,7 +103,7 @@ void *rtp_dgram_thread (void *opaque)
{
rtp_sys_t *sys = opaque;
vlc_tick_t deadline = VLC_TICK_INVALID;
- struct vlc_dtls *rtp_sock = sys->rtp_sock;
+ struct vlc_dtls *rtp_sock = sys->input_sys.rtp_sock;
vlc_thread_set_name("vlc-rtp");
@@ -138,7 +140,7 @@ void *rtp_dgram_thread (void *opaque)
else
block->i_buffer = len;
- rtp_process (sys, block);
+ rtp_process (sys->logger, &sys->input_sys, sys->session, block);
}
else
{
@@ -153,7 +155,7 @@ void *rtp_dgram_thread (void *opaque)
}
dequeue:
- if (!rtp_dequeue (sys, sys->session, &deadline))
+ if (!rtp_dequeue (sys->logger, sys->session, vlc_tick_now(), &deadline))
deadline = VLC_TICK_INVALID;
vlc_restorecancel (canc);
}
=====================================
modules/access/rtp/input.h
=====================================
@@ -0,0 +1,40 @@
+/**
+ * @file input.h
+ * @brief RTP demux input shared declarations
+ */
+/*****************************************************************************
+ * Copyright © 2008 Rémi Denis-Courmont
+ * 2023 VideoLabs, VideoLAN and VLC Authors
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ ****************************************************************************/
+
+typedef struct
+{
+#ifdef HAVE_SRTP
+ struct srtp_session_t *srtp;
+#endif
+ struct vlc_dtls *rtp_sock;
+ struct vlc_dtls *rtcp_sock;
+} rtp_input_sys_t;
+
+/* Global data */
+typedef struct
+{
+ struct vlc_logger *logger;
+ rtp_session_t *session;
+ vlc_thread_t thread;
+ rtp_input_sys_t input_sys;
+} rtp_sys_t;
=====================================
modules/access/rtp/rtp.c
=====================================
@@ -41,6 +41,7 @@
# include <vlc_gcrypt.h>
#endif
#include "sdp.h"
+#include "input.h"
/*
* TODO: so much stuff
@@ -218,8 +219,6 @@ static int extract_port (char **phost)
*/
static int Control (demux_t *demux, int query, va_list args)
{
- rtp_sys_t *sys = demux->p_sys;
-
switch (query)
{
case DEMUX_GET_PTS_DELAY:
@@ -239,9 +238,6 @@ static int Control (demux_t *demux, int query, va_list args)
}
}
- if (sys->chained_demux != NULL)
- return vlc_demux_chained_ControlVa (sys->chained_demux, query, args);
-
switch (query)
{
case DEMUX_GET_POSITION:
@@ -273,13 +269,13 @@ static void Close (vlc_object_t *obj)
vlc_cancel(p_sys->thread);
vlc_join(p_sys->thread, NULL);
#ifdef HAVE_SRTP
- if (p_sys->srtp)
- srtp_destroy (p_sys->srtp);
+ if (p_sys->input_sys.srtp)
+ srtp_destroy (p_sys->input_sys.srtp);
#endif
rtp_session_destroy (obj->logger, p_sys->session);
- if (p_sys->rtcp_sock != NULL)
- vlc_dtls_Close(p_sys->rtcp_sock);
- vlc_dtls_Close(p_sys->rtp_sock);
+ if (p_sys->input_sys.rtcp_sock != NULL)
+ vlc_dtls_Close(p_sys->input_sys.rtcp_sock);
+ vlc_dtls_Close(p_sys->input_sys.rtp_sock);
}
static int OpenSDP(vlc_object_t *obj)
@@ -309,11 +305,11 @@ static int OpenSDP(vlc_object_t *obj)
if (unlikely(sys == NULL))
return VLC_ENOMEM;
- sys->rtp_sock = NULL;
- sys->rtcp_sock = NULL;
+ sys->input_sys.rtp_sock = NULL;
+ sys->input_sys.rtcp_sock = NULL;
sys->session = NULL;
#ifdef HAVE_SRTP
- sys->srtp = NULL;
+ sys->input_sys.srtp = NULL;
#endif
struct vlc_sdp *sdp = vlc_sdp_parse((const char *)peek, sdplen);
@@ -398,8 +394,8 @@ static int OpenSDP(vlc_object_t *obj)
if (fd == -1)
goto error;
- sys->rtp_sock = vlc_datagram_CreateFD(fd);
- if (unlikely(sys->rtp_sock == NULL)) {
+ sys->input_sys.rtp_sock = vlc_datagram_CreateFD(fd);
+ if (unlikely(sys->input_sys.rtp_sock == NULL)) {
net_Close(fd);
goto error;
}
@@ -409,25 +405,23 @@ static int OpenSDP(vlc_object_t *obj)
if (fd == -1)
goto error;
- sys->rtcp_sock = vlc_datagram_CreateFD(fd);
- if (unlikely(sys->rtcp_sock == NULL)) {
+ sys->input_sys.rtcp_sock = vlc_datagram_CreateFD(fd);
+ if (unlikely(sys->input_sys.rtcp_sock == NULL)) {
net_Close(fd);
goto error;
}
}
sys->logger = obj->logger;
- sys->chained_demux = NULL;
- sys->max_src = var_InheritInteger(obj, "rtp-max-src");
- sys->timeout = vlc_tick_from_sec(var_InheritInteger(obj, "rtp-timeout"));
- sys->max_dropout = var_InheritInteger(obj, "rtp-max-dropout");
- sys->max_misorder = -var_InheritInteger(obj, "rtp-max-misorder");
demux->pf_demux = NULL;
demux->pf_control = Control;
demux->p_sys = sys;
- sys->session = rtp_session_create();
+ sys->session = rtp_session_create_custom(var_InheritInteger(obj, "rtp-max-dropout"),
+ var_InheritInteger(obj, "rtp-max-misorder"),
+ var_InheritInteger(obj, "rtp-max-src"),
+ vlc_tick_from_sec(var_InheritInteger(obj, "rtp-timeout")));
if (sys->session == NULL)
goto error;
@@ -450,10 +444,10 @@ static int OpenSDP(vlc_object_t *obj)
return VLC_SUCCESS;
error:
- if (sys->rtcp_sock != NULL)
- vlc_dtls_Close(sys->rtcp_sock);
- if (sys->rtp_sock != NULL)
- vlc_dtls_Close(sys->rtp_sock);
+ if (sys->input_sys.rtcp_sock != NULL)
+ vlc_dtls_Close(sys->input_sys.rtcp_sock);
+ if (sys->input_sys.rtp_sock != NULL)
+ vlc_dtls_Close(sys->input_sys.rtp_sock);
vlc_sdp_free(sdp);
return VLC_EGENERIC;
}
@@ -549,8 +543,8 @@ static int OpenURL(vlc_object_t *obj)
if(fd == -1)
return VLC_EGENERIC;
- p_sys->rtp_sock = (co ? vlc_dccp_CreateFD : vlc_datagram_CreateFD)(fd);
- if (p_sys->rtp_sock == NULL) {
+ p_sys->input_sys.rtp_sock = (co ? vlc_dccp_CreateFD : vlc_datagram_CreateFD)(fd);
+ if (p_sys->input_sys.rtp_sock == NULL) {
if (rtcp_fd != -1)
net_Close(rtcp_fd);
return VLC_EGENERIC;
@@ -558,28 +552,26 @@ static int OpenURL(vlc_object_t *obj)
net_SetCSCov (fd, -1, 12);
if (rtcp_fd != -1) {
- p_sys->rtcp_sock = vlc_datagram_CreateFD(rtcp_fd);
- if (p_sys->rtcp_sock == NULL)
+ p_sys->input_sys.rtcp_sock = vlc_datagram_CreateFD(rtcp_fd);
+ if (p_sys->input_sys.rtcp_sock == NULL)
net_Close (rtcp_fd);
} else
- p_sys->rtcp_sock = NULL;
+ p_sys->input_sys.rtcp_sock = NULL;
- /* Initializes demux */
- p_sys->chained_demux = NULL;
#ifdef HAVE_SRTP
- p_sys->srtp = NULL;
+ p_sys->input_sys.srtp = NULL;
#endif
p_sys->logger = obj->logger;
- p_sys->max_src = var_CreateGetInteger (obj, "rtp-max-src");
- p_sys->timeout = vlc_tick_from_sec( var_CreateGetInteger (obj, "rtp-timeout") );
- p_sys->max_dropout = var_CreateGetInteger (obj, "rtp-max-dropout");
- p_sys->max_misorder = -var_CreateGetInteger (obj, "rtp-max-misorder");
demux->pf_demux = NULL;
demux->pf_control = Control;
demux->p_sys = p_sys;
- p_sys->session = rtp_session_create();
+ p_sys->session = rtp_session_create_custom(
+ var_InheritInteger(obj, "rtp-max-dropout"),
+ var_InheritInteger(obj, "rtp-max-misorder"),
+ var_InheritInteger(obj, "rtp-max-src"),
+ vlc_tick_from_sec(var_InheritInteger(obj, "rtp-timeout")) );
if (p_sys->session == NULL)
goto error;
@@ -591,16 +583,16 @@ static int OpenURL(vlc_object_t *obj)
if (key)
{
vlc_gcrypt_init ();
- p_sys->srtp = srtp_create (SRTP_ENCR_AES_CM, SRTP_AUTH_HMAC_SHA1, 10,
+ p_sys->input_sys.srtp = srtp_create (SRTP_ENCR_AES_CM, SRTP_AUTH_HMAC_SHA1, 10,
SRTP_PRF_AES_CM, SRTP_RCC_MODE1);
- if (p_sys->srtp == NULL)
+ if (p_sys->input_sys.srtp == NULL)
{
free (key);
goto error;
}
char *salt = var_CreateGetNonEmptyString (demux, "srtp-salt");
- int val = srtp_setkeystring (p_sys->srtp, key, salt ? salt : "");
+ int val = srtp_setkeystring (p_sys->input_sys.srtp, key, salt ? salt : "");
free (salt);
free (key);
if (val)
@@ -618,14 +610,14 @@ static int OpenURL(vlc_object_t *obj)
error:
#ifdef HAVE_SRTP
- if (p_sys->srtp != NULL)
- srtp_destroy(p_sys->srtp);
+ if (p_sys->input_sys.srtp != NULL)
+ srtp_destroy(p_sys->input_sys.srtp);
#endif
if (p_sys->session != NULL)
rtp_session_destroy(obj->logger, p_sys->session);
- if (p_sys->rtcp_sock != NULL)
- vlc_dtls_Close(p_sys->rtcp_sock);
- vlc_dtls_Close(p_sys->rtp_sock);
+ if (p_sys->input_sys.rtcp_sock != NULL)
+ vlc_dtls_Close(p_sys->input_sys.rtcp_sock);
+ vlc_dtls_Close(p_sys->input_sys.rtp_sock);
return VLC_EGENERIC;
}
@@ -689,15 +681,15 @@ vlc_module_begin()
SRTP_SALT_TEXT, SRTP_SALT_LONGTEXT)
change_safe()
#endif
- add_integer("rtp-max-src", 1, RTP_MAX_SRC_TEXT,
+ add_integer("rtp-max-src", RTP_MAX_SRC_DEFAULT, RTP_MAX_SRC_TEXT,
RTP_MAX_SRC_LONGTEXT)
change_integer_range (1, 255)
- add_integer("rtp-timeout", 5, RTP_TIMEOUT_TEXT,
+ add_integer("rtp-timeout", RTP_MAX_TIMEOUT_DEFAULT, RTP_TIMEOUT_TEXT,
RTP_TIMEOUT_LONGTEXT)
- add_integer("rtp-max-dropout", 3000, RTP_MAX_DROPOUT_TEXT,
+ add_integer("rtp-max-dropout", RTP_MAX_DROPOUT_DEFAULT, RTP_MAX_DROPOUT_TEXT,
RTP_MAX_DROPOUT_LONGTEXT)
change_integer_range (0, 32767)
- add_integer("rtp-max-misorder", 100, RTP_MAX_MISORDER_TEXT,
+ add_integer("rtp-max-misorder", RTP_MAX_MISORDER_DEFAULT, RTP_MAX_MISORDER_TEXT,
RTP_MAX_MISORDER_LONGTEXT)
change_integer_range (0, 32767)
add_obsolete_string("rtp-dynamic-pt") /* since 4.0.0 */
=====================================
modules/access/rtp/rtp.h
=====================================
@@ -355,34 +355,21 @@ static inline uint8_t rtp_ptype (const block_t *block)
/** @} */
-/* Global data */
-typedef struct
-{
- struct vlc_logger *logger;
-
- rtp_session_t *session;
- struct vlc_demux_chained_t *chained_demux;
-#ifdef HAVE_SRTP
- struct srtp_session_t *srtp;
-#endif
- struct vlc_dtls *rtp_sock;
- struct vlc_dtls *rtcp_sock;
- vlc_thread_t thread;
-
- vlc_tick_t timeout;
- uint16_t max_dropout; /**< Max packet forward misordering */
- uint16_t max_misorder; /**< Max packet backward misordering */
- uint8_t max_src; /**< Max simultaneous RTP sources */
-} rtp_sys_t;
-
/**
* \defgroup rtp_session RTP session
* @{
*/
+#define RTP_MAX_SRC_DEFAULT 1
+#define RTP_MAX_DROPOUT_DEFAULT 3000
+#define RTP_MAX_TIMEOUT_DEFAULT 5
+#define RTP_MAX_MISORDER_DEFAULT 100
+
rtp_session_t *rtp_session_create (void);
+rtp_session_t *rtp_session_create_custom (uint16_t max_dropout, uint16_t max_misorder,
+ uint8_t max_src, vlc_tick_t timeout);
void rtp_session_destroy (struct vlc_logger *, rtp_session_t *);
-void rtp_queue (rtp_sys_t *, rtp_session_t *, block_t *);
-bool rtp_dequeue (rtp_sys_t *, const rtp_session_t *, vlc_tick_t *);
+void rtp_queue (struct vlc_logger *, rtp_session_t *, block_t *);
+bool rtp_dequeue (struct vlc_logger *, const rtp_session_t *, vlc_tick_t, vlc_tick_t *);
int rtp_add_type(rtp_session_t *ses, rtp_pt_t *pt);
int vlc_rtp_add_media_types(vlc_object_t *obj, rtp_session_t *ses,
const struct vlc_sdp_media *media,
=====================================
modules/access/rtp/session.c
=====================================
@@ -42,6 +42,11 @@ struct rtp_session_t
unsigned srcc;
uint8_t ptc;
rtp_pt_t **ptv;
+ /* params */
+ vlc_tick_t timeout;
+ uint16_t max_dropout; /**< Max packet forward misordering */
+ uint16_t max_misorder; /**< Max packet backward misordering */
+ uint8_t max_src; /**< Max simultaneous RTP sources */
};
static rtp_source_t *
@@ -50,16 +55,26 @@ static void rtp_source_destroy(struct vlc_logger *, rtp_source_t *);
static void rtp_decode (struct vlc_logger *, const rtp_session_t *, rtp_source_t *);
+/** @} */
+
/**
* Creates a new RTP session.
*/
rtp_session_t *
-rtp_session_create (void)
+rtp_session_create_custom (uint16_t max_dropout, uint16_t max_misorder,
+ uint8_t max_src, vlc_tick_t timeout)
{
rtp_session_t *session = malloc (sizeof (*session));
if (session == NULL)
return NULL;
+ /* fixed parameters */
+ session->max_dropout = max_dropout;
+ session->max_misorder = -1 * max_misorder;
+ session->max_src = max_src;
+ session->timeout = timeout;
+
+ /* state variables */
session->srcv = NULL;
session->srcc = 0;
session->ptc = 0;
@@ -68,6 +83,14 @@ rtp_session_create (void)
return session;
}
+rtp_session_t *
+rtp_session_create (void)
+{
+ return rtp_session_create_custom(RTP_MAX_DROPOUT_DEFAULT,
+ RTP_MAX_MISORDER_DEFAULT,
+ RTP_MAX_SRC_DEFAULT,
+ RTP_MAX_TIMEOUT_DEFAULT);
+}
/**
* Destroys an RTP session.
@@ -194,12 +217,12 @@ static struct vlc_rtp_pt *rtp_find_ptype(const rtp_session_t *session,
/**
* Receives an RTP packet and queues it. Not a cancellation point.
*
- * @param demux VLC demux object
+ * @param logger VLC logger handle
* @param session RTP session receiving the packet
* @param block RTP packet including the RTP header
*/
void
-rtp_queue (rtp_sys_t *p_sys, rtp_session_t *session, block_t *block)
+rtp_queue (struct vlc_logger *logger, rtp_session_t *session, block_t *block)
{
/* RTP header sanity checks (see RFC 3550) */
if (block->i_buffer < 12)
@@ -233,9 +256,9 @@ rtp_queue (rtp_sys_t *p_sys, rtp_session_t *session, block_t *block)
}
/* RTP source garbage collection */
- if ((tmp->last_rx + p_sys->timeout) < now)
+ if ((tmp->last_rx + session->timeout) < now)
{
- rtp_source_destroy(p_sys->logger, tmp);
+ rtp_source_destroy(logger, tmp);
if (--session->srcc > 0)
session->srcv[i] = session->srcv[session->srcc - 1];
}
@@ -244,9 +267,9 @@ rtp_queue (rtp_sys_t *p_sys, rtp_session_t *session, block_t *block)
if (src == NULL)
{
/* New source */
- if (session->srcc >= p_sys->max_src)
+ if (session->srcc >= session->max_src)
{
- vlc_warning (p_sys->logger, "too many RTP sessions");
+ vlc_warning (logger, "too many RTP sessions");
goto drop;
}
@@ -256,7 +279,7 @@ rtp_queue (rtp_sys_t *p_sys, rtp_session_t *session, block_t *block)
goto drop;
session->srcv = tab;
- src = rtp_source_create (p_sys->logger, session, ssrc, seq);
+ src = rtp_source_create (logger, session, ssrc, seq);
if (src == NULL)
goto drop;
@@ -292,16 +315,16 @@ rtp_queue (rtp_sys_t *p_sys, rtp_session_t *session, block_t *block)
int16_t s;
} delta_seq = { .u = seq - src->max_seq };
- if ((delta_seq.s >= 0) ? (delta_seq.u > p_sys->max_dropout)
- : (delta_seq.u < p_sys->max_misorder))
+ if ((delta_seq.s >= 0) ? (delta_seq.u > session->max_dropout)
+ : (delta_seq.u < session->max_misorder))
{
- vlc_debug (p_sys->logger, "sequence discontinuity"
+ vlc_debug (logger, "sequence discontinuity"
" (got: %"PRIu16", expected: %"PRIu16")", seq, src->max_seq);
if (seq == src->bad_seq)
{
src->max_seq = src->bad_seq = seq + 1;
src->last_seq = seq - 0x7fffe; /* hack for rtp_decode() */
- vlc_warning (p_sys->logger, "sequence resynchronized");
+ vlc_warning (logger, "sequence resynchronized");
block_ChainRelease (src->blocks);
src->blocks = NULL;
}
@@ -325,7 +348,7 @@ rtp_queue (rtp_sys_t *p_sys, rtp_session_t *session, block_t *block)
break;
if (delta_seq.s == 0)
{
- vlc_debug (p_sys->logger, "duplicate packet (sequence: %"PRIu16")", seq);
+ vlc_debug (logger, "duplicate packet (sequence: %"PRIu16")", seq);
goto drop; /* duplicate */
}
pp = &prev->p_next;
@@ -347,16 +370,16 @@ drop:
* given up waiting on the missing packets (time out) from the last one
* already decoded.
*
- * @param demux VLC demux object
+ * @param logger pointer to VLC logger
* @param session RTP session receiving the packet
+ * @param now monotonic clock reference for packets timing (ex: vlc_tick_now())
* @param deadlinep pointer to deadline to call rtp_dequeue() again
* @return true if the buffer is not empty, false otherwise.
* In the later case, *deadlinep is undefined.
*/
-bool rtp_dequeue (rtp_sys_t *sys, const rtp_session_t *session,
- vlc_tick_t *restrict deadlinep)
+bool rtp_dequeue (struct vlc_logger *logger, const rtp_session_t *session,
+ vlc_tick_t now, vlc_tick_t *restrict deadlinep)
{
- vlc_tick_t now = vlc_tick_now ();
bool pending = false;
*deadlinep = VLC_TICK_MAX;
@@ -386,7 +409,7 @@ bool rtp_dequeue (rtp_sys_t *sys, const rtp_session_t *session,
{
if ((int16_t)(rtp_seq (block) - (src->last_seq + 1)) <= 0)
{ /* Next (or earlier) block ready, no need to wait */
- rtp_decode (sys->logger, session, src);
+ rtp_decode (logger, session, src);
continue;
}
@@ -412,7 +435,7 @@ bool rtp_dequeue (rtp_sys_t *sys, const rtp_session_t *session,
deadline += block->i_pts;
if (now >= deadline)
{
- rtp_decode (sys->logger, session, src);
+ rtp_decode (logger, session, src);
continue;
}
if (*deadlinep > deadline)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/66117b3b3e25026100476bfa82fc13d7f79c2800...e133197b64d2fd91553f2ba9252f2b11239ccfab
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/66117b3b3e25026100476bfa82fc13d7f79c2800...e133197b64d2fd91553f2ba9252f2b11239ccfab
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list