/*****************************************************************************
* Preamble
*****************************************************************************/
+#include "config.h"
+#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <errno.h>
#include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/sout.h>
+#include <vlc_sout.h>
+#include <vlc_block.h>
-#include "vlc_httpd.h"
-#include "vlc_url.h"
-#include "network.h"
-#include "charset.h"
+#include <vlc_httpd.h>
+#include <vlc_url.h>
+#include <vlc_network.h>
+#include <vlc_charset.h>
/*****************************************************************************
* Module descriptor
#define PORT_VIDEO_LONGTEXT N_( \
"This allows you to specify the default video port for the RTP streaming." )
-#define TTL_TEXT N_("Time-To-Live (TTL)")
+#define TTL_TEXT N_("Hop limit (TTL)")
#define TTL_LONGTEXT N_( \
- "This allows you to specify the Time-To-Live for the output stream." )
+ "This is the hop limit (also known as \"Time-To-Live\" or TTL) of " \
+ "the multicast packets sent by the stream output (0 = use operating " \
+ "system built-in default).")
#define RFC3016_TEXT N_("MP4A LATM")
#define RFC3016_LONGTEXT N_( \
sout_stream_t *p_stream = (sout_stream_t*)p_this;
sout_instance_t *p_sout = p_stream->p_sout;
sout_stream_sys_t *p_sys = NULL;
- sout_cfg_t *p_cfg = NULL;
+ config_chain_t *p_cfg = NULL;
vlc_value_t val;
vlc_bool_t b_rtsp = VLC_FALSE;
- sout_CfgParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options, p_stream->p_cfg );
+ config_ChainParse( p_stream, SOUT_CFG_PREFIX,
+ ppsz_sout_options, p_stream->p_cfg );
p_sys = malloc( sizeof( sout_stream_sys_t ) );
}
/* create the SDP for a muxed stream (only once) */
- /* FIXME http://www.faqs.org/rfcs/rfc2327.html
- All text fields should be UTF-8 encoded. Use global a:charset to announce this.
+ /* FIXME http://www.faqs.org/rfcs/rfc4566.html
o= - should be local username (no spaces allowed)
- o= time should be hashed with some other value to garantue uniqueness
- o= we need IP6 support?
+ o= time should be hashed with some other value to garantee uniqueness
o= don't use the localhost address. use fully qualified domain name or IP4 address
- p= international phone number (pass via vars?)
- c= IP6 support
- a= recvonly (missing)
- a= type:broadcast (missing)
- a= charset: (normally charset should be UTF-8, this can be used to override s= and i=)
+ a= source-filter: we need our source address
a= x-plgroup: (missing)
RTP packets need to get the correct src IP address */
if( net_AddressIsMulticast( (vlc_object_t *)p_stream, p_sys->psz_destination ) )
"i=%s\r\n"
"u=%s\r\n"
"e=%s\r\n"
+ "c=IN IP%c %s%s\r\n"
"t=0 0\r\n" /* permanent stream */ /* when scheduled from vlm, we should set this info correctly */
"a=tool:"PACKAGE_STRING"\r\n"
- "c=IN IP%c %s%s\r\n"
+ "a=recvonly\r\n"
+ "a=type:broadcast\r\n"
"m=video %d RTP/AVP %d\r\n"
"a=rtpmap:%d %s\r\n",
p_sys->i_sdp_id, p_sys->i_sdp_version,
var_Get( p_stream, SOUT_CFG_PREFIX "sdp", &val );
if( *val.psz_string )
{
- sout_cfg_t *p_cfg;
+ config_chain_t *p_cfg;
SDPHandleUrl( p_stream, val.psz_string );
free( p_sys->psz_sdp );
p_sys->psz_sdp = NULL;
}
+ if( p_sys->b_export_sdp_file )
+ {
+#ifdef HAVE_UNISTD_H
+ unlink( p_sys->psz_sdp_file );
+#endif
+ free( p_sys->psz_sdp_file );
+ }
free( p_sys );
}
{
uint8_t *p_buffer = p_fmt->p_extra;
int i_buffer = p_fmt->i_extra;
- char *p_64_sps;
- char *p_64_pps;
+ char *p_64_sps = NULL;
+ char *p_64_pps = NULL;
char hexa[6];
while( i_buffer > 4 &&
}
else
id->psz_fmtp = strdup( "packetization-mode=1" );
+if( p_fmt->i_extra > 0 )
+msg_Dbg( p_stream, "WE HAVE %d bytes extra data", p_fmt->i_extra );
break;
case VLC_FOURCC( 'm', 'p', '4', 'v' ):
{
int i;
- if( psz_session ) return NULL;
+ if( !psz_session ) return NULL;
for( i = 0; i < p_stream->p_sys->i_rtsp; i++ )
{
answer->i_status = 200;
answer->psz_status = strdup( "OK" );
httpd_MsgAdd( answer, "Content-type", "%s", "application/sdp" );
-
+ httpd_MsgAdd( answer, "Content-Base", "%s/", p_sys->psz_rtsp_control );
answer->p_body = (uint8_t *)psz_sdp;
answer->i_body = strlen( psz_sdp );
break;
p_data+=3;
i_data-=3;
i_nal_type = p_data[0]&0x1f;
+
+ /* Skip global headers */
+ if( i_nal_type == 7 || i_nal_type == 8 )
+ return VLC_SUCCESS;
if( i_data <= i_max ) /* The whole pack will fit in one rtp payload */
{