#include <vlc_charset.h>
#include <vlc_strings.h>
#include <vlc_rand.h>
-#include <srtp.h>
+#ifdef HAVE_SRTP
+# include <srtp.h>
+#endif
#include "rtp.h"
add_bool( SOUT_CFG_PREFIX "rtcp-mux", false, NULL,
RTCP_MUX_TEXT, RTCP_MUX_LONGTEXT, false )
+#ifdef HAVE_SRTP
add_string( SOUT_CFG_PREFIX "key", "", NULL,
SRTP_KEY_TEXT, SRTP_KEY_LONGTEXT, false )
add_string( SOUT_CFG_PREFIX "salt", "", NULL,
SRTP_SALT_TEXT, SRTP_SALT_LONGTEXT, false )
+#endif
add_bool( SOUT_CFG_PREFIX "mp4a-latm", false, NULL, RFC3016_TEXT,
RFC3016_LONGTEXT, false )
/* Packetizer specific fields */
int i_mtu;
+#ifdef HAVE_SRTP
srtp_session_t *srtp;
+#endif
pf_rtp_packetizer_t pf_packetize;
/* Packets sinks */
id->i_mtu = 576 - 20 - 8; /* pessimistic */
msg_Dbg( p_stream, "maximum RTP packet size: %d bytes", id->i_mtu );
- id->srtp = NULL;
id->pf_packetize = NULL;
+#ifdef HAVE_SRTP
+ id->srtp = NULL;
+
char *key = var_CreateGetNonEmptyString (p_stream, SOUT_CFG_PREFIX"key");
if (key)
{
}
id->i_sequence = 0; /* FIXME: awful hack for libvlc_srtp */
}
+#endif
vlc_mutex_init( &id->lock_sink );
id->sinkc = 0;
rtp_set_ptime (id, 20, 1);
break;
case VLC_CODEC_S16B:
+ case VLC_CODEC_S16L:
if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 44100 )
{
id->i_payload_type = 11;
id->i_payload_type = 10;
}
id->psz_enc = "L16";
- id->pf_packetize = rtp_packetize_split;
+ if( p_fmt->i_codec == VLC_CODEC_S16B )
+ id->pf_packetize = rtp_packetize_split;
+ else
+ id->pf_packetize = rtp_packetize_swab;
rtp_set_ptime (id, 20, 2);
break;
case VLC_CODEC_U8:
vlc_join( id->listen.thread, NULL );
net_ListenClose( id->listen.fd );
}
+#ifdef HAVE_SRTP
if( id->srtp != NULL )
srtp_destroy( id->srtp );
+#endif
vlc_mutex_destroy( &id->lock_sink );
block_t *out = block_FifoGet( id->p_fifo );
block_cleanup_push (out);
+#ifdef HAVE_SRTP
if( id->srtp )
{ /* FIXME: this is awfully inefficient */
size_t len = out->i_buffer;
else
out->i_buffer = len;
}
-
if (out)
+#endif
mwait (out->i_dts + i_caching);
vlc_cleanup_pop ();
if (out == NULL)
for( int i = 0; i < id->sinkc; i++ )
{
+#ifdef HAVE_SRTP
if( !id->srtp ) /* FIXME: SRTCP support */
+#endif
SendRTCP( id->sinkv[i].rtcp, out );
if( send( id->sinkv[i].rtp_fd, out->p_buffer, len, 0 ) >= 0 )