/*****************************************************************************
* Module descriptor
*****************************************************************************/
+
+#define MTU_REDUCE 50
+
#define DST_TEXT N_("Destination")
#define DST_LONGTEXT N_( \
"Allows you to specify the output URL used for the streaming output." )
#define PORT_VIDEO_LONGTEXT N_( \
"Allows you to specify the default video port used for the RTP streaming." )
-#define TTL_TEXT N_("Time To Live")
+#define TTL_TEXT N_("Time-To-Live (TTL)")
#define TTL_LONGTEXT N_( \
- "Allows you to specify the time to live for the output stream." )
+ "Allows you to specify the Time-To-Live for the output stream." )
static int Open ( vlc_object_t * );
static void Close( vlc_object_t * );
add_string( SOUT_CFG_PREFIX "email", "", NULL, EMAIL_TEXT,
EMAIL_LONGTEXT, VLC_TRUE );
- add_integer( SOUT_CFG_PREFIX "port-audio", 1234, NULL, PORT_AUDIO_TEXT,
- PORT_LONGTEXT, VLC_TRUE );
- add_integer( SOUT_CFG_PREFIX "port-video", 1236, NULL, PORT_VIDEO_TEXT,
- PORT_LONGTEXT, VLC_TRUE );
- add_integer( SOUT_CFG_PREFIX "port", 1238, NULL, PORT_TEXT,
+ add_integer( SOUT_CFG_PREFIX "port", 1234, NULL, PORT_TEXT,
PORT_LONGTEXT, VLC_TRUE );
+ add_integer( SOUT_CFG_PREFIX "port-audio", 1230, NULL, PORT_AUDIO_TEXT,
+ PORT_AUDIO_LONGTEXT, VLC_TRUE );
+ add_integer( SOUT_CFG_PREFIX "port-video", 1232, NULL, PORT_VIDEO_TEXT,
+ PORT_VIDEO_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "ttl", 0, NULL, TTL_TEXT,
TTL_LONGTEXT, VLC_TRUE );
return VLC_EGENERIC;
}
p_sys->i_mtu = config_GetInt( p_stream, "mtu" ); /* XXX beurk */
- if( p_sys->i_mtu <= 16 )
+ if( p_sys->i_mtu <= 16 + MTU_REDUCE )
{
/* better than nothing */
p_sys->i_mtu = 1500;
}
+ p_sys->i_mtu -= MTU_REDUCE;
/* the access out grabber TODO export it as sout_AccessOutGrabberNew */
p_grab = p_sys->p_grab =
RTP packets need to get the correct src IP address */
if( net_AddressIsMulticast( (vlc_object_t *)p_stream, p_sys->psz_destination ) )
{
- snprintf( psz_ttl, sizeof( psz_ttl ), "/%d", p_sys->i_ttl );
+ snprintf( psz_ttl, sizeof( psz_ttl ), "/%d", p_sys->i_ttl ?
+ p_sys->i_ttl : config_GetInt( p_sout, "ttl" ) );
psz_ttl[sizeof( psz_ttl ) - 1] = '\0';
}
else
{
block_Release( p_sys->packet );
}
+ if( p_sys->b_export_sap )
+ {
+ p_sys->p_mux = NULL;
+ SapSetup( p_stream );
+ }
}
while( p_sys->i_rtsp > 0 )
const char *psz_destination, vlc_bool_t b_rtsp )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
+ sout_instance_t *p_sout = p_stream->p_sout;
int i_size;
char *psz_sdp, *p, ipv;
int i;
if( net_AddressIsMulticast( (vlc_object_t *)p_stream, psz_destination ) )
{
/* Add the ttl if it is a multicast address */
- p += sprintf( p, "/%d\r\n", p_sys->i_ttl );
+ p += sprintf( p, "/%d\r\n", p_sys->i_ttl ? p_sys->i_ttl :
+ config_GetInt( p_sout, "ttl" ) );
}
else
{
id->i_timestamp_start = rand()&0xffffffff;
id->i_mtu = config_GetInt( p_stream, "mtu" ); /* XXX beuk */
- if( id->i_mtu <= 16 )
+ if( id->i_mtu <= 16 + MTU_REDUCE )
{
/* better than nothing */
id->i_mtu = 1500;
}
- msg_Dbg( p_stream, "using mtu=%d", id->i_mtu );
+ id->i_mtu -= MTU_REDUCE;
+ msg_Dbg( p_stream, "maximum RTP packet size: %d bytes", id->i_mtu );
if( p_sys->p_rtsp_url )
{
if( id->rtsp_access ) free( id->rtsp_access );
/* Update SDP (sap/file) */
- if( p_sys->b_export_sap ) SapSetup( p_stream );
+ if( p_sys->b_export_sap && !p_sys->p_mux ) SapSetup( p_stream );
if( p_sys->b_export_sdp_file ) FileSetup( p_stream );
free( id );
if( ( p_sys->i_es > 0 || p_sys->p_mux ) && p_sys->psz_sdp && *p_sys->psz_sdp )
{
p_sys->p_session = sout_AnnounceRegisterSDP( p_sout, p_sys->psz_sdp,
+ p_sys->psz_destination,
p_method );
}
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
- p_sys->p_httpd_host = httpd_HostNew( VLC_OBJECT(p_stream), url->psz_host, url->i_port );
+ p_sys->p_httpd_host = httpd_HostNew( VLC_OBJECT(p_stream), url->psz_host, url->i_port > 0 ? url->i_port : 80 );
if( p_sys->p_httpd_host )
{
p_sys->p_httpd_file = httpd_FileNew( p_sys->p_httpd_host,
{
sout_stream_id_t *id = (sout_stream_id_t*)p_args;
sout_stream_t *p_stream = id->p_stream;
+ sout_instance_t *p_sout = p_stream->p_sout;
sout_stream_sys_t *p_sys = p_stream->p_sys;
char *psz_session = NULL;
}
httpd_MsgAdd( answer, "Transport",
"RTP/AVP/UDP;destination=%s;port=%d-%d;ttl=%d",
- id->psz_destination, id->i_port,id->i_port+1, p_sys->i_ttl );
+ id->psz_destination, id->i_port,id->i_port+1,
+ p_sys->i_ttl ? p_sys->i_ttl :
+ config_GetInt( p_sout, "ttl" ) );
}
else if( strstr( psz_transport, "unicast" ) && strstr( psz_transport, "client_port=" ) )
{