/*****************************************************************************
* bridge.c: bridge stream output module
*****************************************************************************
- * Copyright (C) 2005 VideoLAN
+ * Copyright (C) 2005 the VideoLAN team
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* 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 <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 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 " \
ID_OFFSET_LONGTEXT, VLC_FALSE );
set_callbacks( OpenIn, CloseIn );
- var_Create( p_module->p_libvlc, "bridge-lock", VLC_VAR_MUTEX );
vlc_module_end();
#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;
}
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;
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 ) );
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;
p_es->b_changed = VLC_TRUE;
vlc_mutex_unlock( p_sys->p_lock );
+ p_sys->b_inited = VLC_FALSE;
+
return VLC_SUCCESS;
}
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;
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 );