]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/bridge.c
Use pkg-config for freetype and fribidi. Please report if your distro don't have...
[vlc] / modules / stream_out / bridge.c
index 82ab34317c7070a243fd8bf649d6db596301de5c..618ab28dd864c446f7319cefb039b03d24610da6 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <vlc/vlc.h>
-#include <vlc/sout.h>
+#include <vlc_sout.h>
+#include <vlc_block.h>
 
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
 #define ID_TEXT N_("ID")
 #define ID_LONGTEXT N_( \
-    "Specify an identifier for this elementary stream." )
+    "Integer identifier for this elementary stream. This will be used to " \
+    "\"find\" this stream later." )
 
 #define DELAY_TEXT N_("Delay")
 #define DELAY_LONGTEXT N_("Pictures coming from the picture video outputs " \
-        "will be delayed accordingly (in milliseconds, >= 100 ms). For high " \
-        "values, you will need to raise file-caching and others.")
+        "will be delayed according to this value (in milliseconds, should be "\
+        ">= 100 ms). For high values, you will need to raise caching values." )
 
 #define ID_OFFSET_TEXT N_("ID Offset")
 #define ID_OFFSET_LONGTEXT N_("Offset to add to the stream IDs specified in " \
@@ -80,7 +84,6 @@ vlc_module_begin();
                  ID_OFFSET_LONGTEXT, VLC_FALSE );
     set_callbacks( OpenIn, CloseIn );
 
-    var_Create( p_module->p_libvlc, "bridge-lock", VLC_VAR_MUTEX );
 vlc_module_end();
 
 
@@ -125,11 +128,10 @@ typedef struct bridge_t
 #define GetBridge(a) __GetBridge( VLC_OBJECT(a) )
 static bridge_t *__GetBridge( vlc_object_t *p_object )
 {
-    libvlc_t *p_libvlc = p_object->p_libvlc;
     bridge_t *p_bridge;
     vlc_value_t val;
 
-    if( var_Get( p_libvlc, "bridge-struct", &val ) != VLC_SUCCESS )
+    if( var_Get( p_object->p_libvlc, "bridge-struct", &val ) )
     {
         p_bridge = NULL;
     }
@@ -163,12 +165,13 @@ static int OpenOut( vlc_object_t *p_this )
     out_sout_stream_sys_t *p_sys;
     vlc_value_t val;
 
-    sout_CfgParse( p_stream, SOUT_CFG_PREFIX_OUT, ppsz_sout_options_out,
+    config_ChainParse( p_stream, SOUT_CFG_PREFIX_OUT, ppsz_sout_options_out,
                    p_stream->p_cfg );
 
     p_sys          = malloc( sizeof( out_sout_stream_sys_t ) );
     p_sys->b_inited = VLC_FALSE;
 
+    var_Create( p_this->p_libvlc, "bridge-lock", VLC_VAR_MUTEX );
     var_Get( p_this->p_libvlc, "bridge-lock", &val );
     p_sys->p_lock = val.p_address;
 
@@ -217,7 +220,7 @@ static sout_stream_id_t * AddOut( sout_stream_t *p_stream, es_format_t *p_fmt )
     p_bridge = GetBridge( p_stream );
     if ( p_bridge == NULL )
     {
-        libvlc_t *p_libvlc = p_stream->p_libvlc;
+        vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
         vlc_value_t val;
 
         p_bridge = malloc( sizeof( bridge_t ) );
@@ -267,6 +270,7 @@ static sout_stream_id_t * AddOut( sout_stream_t *p_stream, es_format_t *p_fmt )
 
 static int DelOut( sout_stream_t *p_stream, sout_stream_id_t *id )
 {
+    VLC_UNUSED(id);
     out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys;
     bridged_es_t *p_es;
 
@@ -350,9 +354,10 @@ static int OpenIn( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    sout_CfgParse( p_stream, SOUT_CFG_PREFIX_IN, ppsz_sout_options_in,
+    config_ChainParse( p_stream, SOUT_CFG_PREFIX_IN, ppsz_sout_options_in,
                    p_stream->p_cfg );
 
+    var_Create( p_this->p_libvlc, "bridge-lock", VLC_VAR_MUTEX );
     var_Get( p_this->p_libvlc, "bridge-lock", &val );
     p_sys->p_lock = val.p_address;
 
@@ -517,7 +522,7 @@ static int SendIn( sout_stream_t *p_stream, sout_stream_id_t *id,
 
     if( b_no_es )
     {
-        libvlc_t *p_libvlc = p_stream->p_libvlc;
+        vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
         for ( i = 0; i < p_bridge->i_es_num; i++ )
             free( p_bridge->pp_es[i] );
         free( p_bridge->pp_es );