-if HAVE_GCRYPT
# RTP plugin
libvlc_LTLIBRARIES += \
librtp_plugin.la
rtp.h \
input.c \
session.c
-librtp_plugin_la_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/libs/srtp
-librtp_plugin_la_LIBADD = $(AM_LIBADD) \
- $(top_builddir)/libs/srtp/libvlc_srtp.la
-librtp_plugin_la_DEPENDENCIES = \
- $(top_builddir)/libs/srtp/libvlc_srtp.la
+librtp_plugin_la_CFLAGS = $(AM_CFLAGS)
+librtp_plugin_la_LIBADD = $(AM_LIBADD)
+librtp_plugin_la_DEPENDENCIES =
+
+if HAVE_GCRYPT
+librtp_plugin_la_CFLAGS += -DHAVE_SRTP -I$(top_srcdir)/libs/srtp
+librtp_plugin_la_LIBADD += $(top_builddir)/libs/srtp/libvlc_srtp.la
+librtp_plugin_la_DEPENDENCIES += $(top_builddir)/libs/srtp/libvlc_srtp.la
endif
#endif
#include "rtp.h"
-#include <srtp.h>
+#ifdef HAVE_SRTP
+# include <srtp.h>
+#endif
static bool fd_dead (int fd)
{
const uint8_t ptype = rtp_ptype (block);
if (ptype >= 72 && ptype <= 76)
continue; /* Muxed RTCP, ignore for now */
-
+#ifdef HAVE_SRTP
if (p_sys->srtp)
{
size_t len = block->i_buffer;
}
block->i_buffer = len;
}
+#endif
return block; /* success! */
}
return NULL;
#include <vlc_codecs.h>
#include "rtp.h"
-#include <srtp.h>
+#ifdef HAVE_SRTP
+# include <srtp.h>
+#endif
#define RTP_CACHING_TEXT N_("RTP de-jitter buffer length (msec)")
#define RTP_CACHING_LONGTEXT N_( \
RTCP_PORT_LONGTEXT, false)
change_integer_range (0, 65535)
change_safe ()
+#ifdef HAVE_SRTP
add_string ("srtp-key", "", NULL,
SRTP_KEY_TEXT, SRTP_KEY_LONGTEXT, false)
add_string ("srtp-salt", "", NULL,
SRTP_SALT_TEXT, SRTP_SALT_LONGTEXT, false)
+#endif
add_integer ("rtp-max-src", 1, NULL, RTP_MAX_SRC_TEXT,
RTP_MAX_SRC_LONGTEXT, true)
change_integer_range (1, 255)
}
vlc_mutex_init (&p_sys->lock);
+#ifdef HAVE_SRTP
p_sys->srtp = NULL;
+#endif
p_sys->fd = fd;
p_sys->rtcp_fd = rtcp_fd;
p_sys->caching = var_CreateGetInteger (obj, "rtp-caching");
if (p_sys->session == NULL)
goto error;
+#ifdef HAVE_SRTP
char *key = var_CreateGetNonEmptyString (demux, "srtp-key");
if (key)
{
goto error;
}
}
+#endif
if (vlc_clone (&p_sys->thread, rtp_thread, demux,
VLC_THREAD_PRIORITY_INPUT))
}
vlc_mutex_destroy (&p_sys->lock);
+#ifdef HAVE_SRTP
if (p_sys->srtp)
srtp_destroy (p_sys->srtp);
+#endif
if (p_sys->session)
rtp_session_destroy (demux, p_sys->session);
if (p_sys->rtcp_fd != -1)