]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/rtp.c
* grah one more compile issue
[vlc] / modules / stream_out / rtp.c
index c3ab404df335d3d414fc90dced4f2bdde0efd63f..6f08d41f8a8ab851e86ce8f6ddeee34c7e6819ba 100644 (file)
@@ -24,6 +24,8 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#include "config.h"
+#include <stdio.h>
 #include <stdlib.h>
 #ifdef HAVE_UNISTD_H
 #   include <unistd.h>
 #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_( \
@@ -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 ) );
 
@@ -588,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 );
 
@@ -1154,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 && 
@@ -1204,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' ):
@@ -1641,7 +1648,7 @@ static rtsp_client_t *RtspClientGet( sout_stream_t *p_stream, char *psz_session
 {
     int i;
 
-    if( psz_session ) return NULL;
+    if( !psz_session ) return NULL;
 
     for( i = 0; i < p_stream->p_sys->i_rtsp; i++ )
     {
@@ -1729,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;
@@ -2499,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 */
     {