#ifdef HAVE_UNISTD_H
# include <sys/types.h>
# include <unistd.h>
-# include <fcntl.h>
-# include <sys/stat.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
if( p_sys->i_ttl == -1 )
{
/* Normally, we should let the default hop limit up to the core,
- * but we have to know it to build our SDP properly, which is why
- * we ask the core. FIXME: broken when neither sout-rtp-ttl nor
- * ttl are set. */
- p_sys->i_ttl = config_GetInt( p_stream, "ttl" );
+ * but we have to know it to write our RTSP headers properly,
+ * which is why we ask the core. FIXME: broken when neither
+ * sout-rtp-ttl nor ttl are set. */
+ p_sys->i_ttl = var_InheritInteger( p_stream, "ttl" );
}
p_sys->b_latm = var_GetBool( p_stream, SOUT_CFG_PREFIX "mp4a-latm" );
if( rtsp_url != NULL )
sdp_AddAttribute ( &psz_sdp, "control", "%s", rtsp_url );
+ const char *proto = "RTP/AVP"; /* protocol */
+ if( rtsp_url == NULL )
+ {
+ switch( p_sys->proto )
+ {
+ case IPPROTO_UDP:
+ break;
+ case IPPROTO_TCP:
+ proto = "TCP/RTP/AVP";
+ break;
+ case IPPROTO_DCCP:
+ proto = "DCCP/RTP/AVP";
+ break;
+ case IPPROTO_UDPLITE:
+ return psz_sdp;
+ }
+ }
+
/* FIXME: locking?! */
for( i = 0; i < p_sys->i_es; i++ )
{
sout_stream_id_t *id = p_sys->es[i];
const char *mime_major; /* major MIME type */
- const char *proto = "RTP/AVP"; /* protocol */
switch( id->i_cat )
{
continue;
}
- if( rtsp_url == NULL )
- {
- switch( p_sys->proto )
- {
- case IPPROTO_UDP:
- break;
- case IPPROTO_TCP:
- proto = "TCP/RTP/AVP";
- break;
- case IPPROTO_DCCP:
- proto = "DCCP/RTP/AVP";
- break;
- case IPPROTO_UDPLITE:
- continue;
- }
- }
-
sdp_AddMedia( &psz_sdp, mime_major, proto, inclport * id->i_port,
id->i_payload_type, false, id->i_bitrate,
id->psz_enc, id->i_clock_rate, id->i_channels,
if( rtsp_url != NULL )
{
- assert( strlen( rtsp_url ) > 0 );
- bool addslash = ( rtsp_url[strlen( rtsp_url ) - 1] != '/' );
- sdp_AddAttribute ( &psz_sdp, "control",
- addslash ? "%s/trackID=%u" : "%strackID=%u",
- rtsp_url, i );
+ char *track_url = RtspAppendTrackPath( id->rtsp_id, rtsp_url );
+ if( track_url != NULL )
+ {
+ sdp_AddAttribute ( &psz_sdp, "control", "%s", track_url );
+ free( track_url );
+ }
}
else
{
id->i_bitrate = 0;
}
- id->i_mtu = config_GetInt( p_stream, "mtu" );
+ id->i_mtu = var_InheritInteger( p_stream, "mtu" );
if( id->i_mtu <= 12 + 16 )
id->i_mtu = 576 - 20 - 8; /* pessimistic */
msg_Dbg( p_stream, "maximum RTP packet size: %d bytes", id->i_mtu );
case VLC_CODEC_MP4V:
{
- char hexa[2*p_fmt->i_extra +1];
-
id->psz_enc = "MP4V-ES";
id->pf_packetize = rtp_packetize_split;
if( p_fmt->i_extra > 0 )
{
+ char hexa[2*p_fmt->i_extra +1];
sprintf_hexa( hexa, p_fmt->p_extra, p_fmt->i_extra );
if( asprintf( &id->psz_fmtp,
"profile-level-id=3; config=%s;", hexa ) == -1 )