X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fstream_out%2Fbridge.c;h=618ab28dd864c446f7319cefb039b03d24610da6;hb=cc10207a6de5466bf6bfedcd8a3073c7a0f1224a;hp=b5f9d45f0ed635730fe286ecf9d9011fc799b924;hpb=bad37ffdc914e25ee5fd15827a947940c31b7e6b;p=vlc diff --git a/modules/stream_out/bridge.c b/modules/stream_out/bridge.c index b5f9d45f0e..618ab28dd8 100644 --- a/modules/stream_out/bridge.c +++ b/modules/stream_out/bridge.c @@ -1,7 +1,7 @@ /***************************************************************************** * bridge.c: bridge stream output module ***************************************************************************** - * Copyright (C) 2005 VideoLAN + * Copyright (C) 2005 the VideoLAN team * $Id$ * * Authors: Christophe Massiot @@ -18,29 +18,33 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ -#include -#include + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include -#include +#include +#include /***************************************************************************** * Module descriptor *****************************************************************************/ #define ID_TEXT N_("ID") #define ID_LONGTEXT N_( \ - "Specify an identifier integer 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,18 +128,17 @@ 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; } else { p_bridge = val.p_address; - } + } return p_bridge; } @@ -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; @@ -286,6 +290,8 @@ static int DelOut( sout_stream_t *p_stream, sout_stream_id_t *id ) p_es->b_changed = VLC_TRUE; vlc_mutex_unlock( p_sys->p_lock ); + p_sys->b_inited = VLC_FALSE; + return VLC_SUCCESS; } @@ -348,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; @@ -515,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 );