X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fstream_out%2Frtp.c;h=5decb87f0a0da2627ff7e6b14b1b5c226626b553;hb=4bcb2f21a9d5c13992e2430bbe335695567fb7be;hp=579ddb3da081dca235ba6df1f87c31bb24cf2918;hpb=93020752782611894027dae8276b1a489ac5eea3;p=vlc diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c index 579ddb3da0..5decb87f0a 100644 --- a/modules/stream_out/rtp.c +++ b/modules/stream_out/rtp.c @@ -24,6 +24,8 @@ /***************************************************************************** * Preamble *****************************************************************************/ +#include "config.h" +#include #include #ifdef HAVE_UNISTD_H # include @@ -87,9 +89,11 @@ #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_( \ @@ -294,11 +298,12 @@ static int Open( vlc_object_t *p_this ) 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 ) ); @@ -525,14 +530,10 @@ static int Open( vlc_object_t *p_this ) /* create the SDP for a muxed stream (only once) */ /* FIXME http://www.faqs.org/rfcs/rfc4566.html - All text fields should be UTF-8 encoded. Use global a:charset to announce this. o= - should be local username (no spaces allowed) 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?) - 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 ) ) @@ -554,8 +555,10 @@ static int Open( vlc_object_t *p_this ) "u=%s\r\n" "e=%s\r\n" "c=IN IP%c %s%s\r\n" - "a=tool:"PACKAGE_STRING"\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" + "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, @@ -590,7 +593,7 @@ static int Open( vlc_object_t *p_this ) 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 ); @@ -1156,8 +1159,8 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) { 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 && @@ -1206,6 +1209,8 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) } 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' ): @@ -1731,7 +1736,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, 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; @@ -2501,6 +2506,10 @@ static int rtp_packetize_h264( sout_stream_t *p_stream, sout_stream_id_t *id, 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 */ {