* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
-#include <stdlib.h> /* free() */
-#include <string.h> /* strerror() */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <vlc/vlc.h>
#include <vlc_sout.h>
}
else
{
- if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig );
- if( p_pic ) free( p_pic );
+ if( p_pic )
+ {
+ free( p_pic->p_data_orig );
+ free( p_pic );
+ }
}
}
}
inline static void video_del_buffer_decoder( decoder_t *, picture_t * );
inline static void video_del_buffer_filter( filter_t *, picture_t * );
-static void video_del_buffer( vlc_object_t *, picture_t * );
+static void video_del_buffer( picture_t * );
inline static picture_t *video_new_buffer_decoder( decoder_t * );
inline static picture_t *video_new_buffer_filter( filter_t * );
#define VFILTER_TEXT N_("Video filter")
#define VFILTER_LONGTEXT N_( \
- "Video filters will be applied to the video stream." );
+ "Video filters will be applied to the video stream." )
#define CHROMA_TEXT N_("Image chroma")
#define CHROMA_LONGTEXT N_( \
"Force the use of a specific chroma. Use YUVA if you're planning " \
- "to use the Alphamask or Bluescreen video filter." );
+ "to use the Alphamask or Bluescreen video filter." )
#define CFG_PREFIX "sout-mosaic-bridge-"
NULL, NULL, VFILTER_TEXT, VFILTER_LONGTEXT, VLC_FALSE );
set_callbacks( Open, Close );
-
- var_Create( p_module->p_libvlc_global, "mosaic-lock", VLC_VAR_MUTEX );
vlc_module_end();
static const char *ppsz_sout_options[] = {
{
sout_stream_t *p_stream = (sout_stream_t *)p_this;
sout_stream_sys_t *p_sys;
- vlc_object_t *p_libvlc_global = p_this->p_libvlc_global;
+ vlc_object_t *p_libvlc = VLC_OBJECT( p_this->p_libvlc );
vlc_value_t val;
config_ChainParse( p_stream, CFG_PREFIX, ppsz_sout_options,
p_stream->p_sys = p_sys;
p_sys->b_inited = VLC_FALSE;
- var_Get( p_libvlc_global, "mosaic-lock", &val );
+ var_Create( p_libvlc, "mosaic-lock", VLC_VAR_MUTEX );
+ var_Get( p_libvlc, "mosaic-lock", &val );
p_sys->p_lock = val.p_address;
var_Get( p_stream, CFG_PREFIX "id", &val );
p_stream->p_sout->i_out_pace_nocontrol--;
- if ( p_sys->psz_id )
- free( p_sys->psz_id );
+ free( p_sys->psz_id );
free( p_sys );
}
{
msg_Err( p_stream, "cannot find decoder" );
vlc_object_detach( p_sys->p_decoder );
- vlc_object_destroy( p_sys->p_decoder );
+ vlc_object_release( p_sys->p_decoder );
return NULL;
}
p_bridge = GetBridge( p_stream );
if ( p_bridge == NULL )
{
- vlc_object_t *p_libvlc_global = p_stream->p_libvlc_global;
+ vlc_object_t *p_libvlc = VLC_OBJECT( p_stream->p_libvlc );
vlc_value_t val;
p_bridge = malloc( sizeof( bridge_t ) );
- var_Create( p_libvlc_global, "mosaic-struct", VLC_VAR_ADDRESS );
+ var_Create( p_libvlc, "mosaic-struct", VLC_VAR_ADDRESS );
val.p_address = p_bridge;
- var_Set( p_libvlc_global, "mosaic-struct", val );
+ var_Set( p_libvlc, "mosaic-struct", val );
p_bridge->i_es_num = 0;
p_bridge->pp_es = NULL;
"no video filter matching name \"%s\" found",
psz_name );
vlc_object_detach( *pp_vfilter );
- vlc_object_destroy( *pp_vfilter );
+ vlc_object_release( *pp_vfilter );
p_sys->i_vfilters--;
}
}
static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
{
+ VLC_UNUSED(id);
sout_stream_sys_t *p_sys = p_stream->p_sys;
bridge_t *p_bridge;
bridged_es_t *p_es;
if( p_sys->p_decoder->p_module )
module_Unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
vlc_object_detach( p_sys->p_decoder );
- vlc_object_destroy( p_sys->p_decoder );
+ vlc_object_release( p_sys->p_decoder );
for( i = 0; i < PICTURE_RING_SIZE; i++ )
{
if ( pp_ring[i] != NULL )
{
- if ( pp_ring[i]->p_data_orig != NULL )
- free( pp_ring[i]->p_data_orig );
+ free( pp_ring[i]->p_data_orig );
free( pp_ring[i]->p_sys );
free( pp_ring[i] );
}
vlc_object_detach( *pp_vfilter );
if( (*pp_vfilter)->p_module )
module_Unneed( *pp_vfilter, (*pp_vfilter)->p_module );
- vlc_object_destroy( *pp_vfilter );
+ vlc_object_release( *pp_vfilter );
}
free( p_sys->pp_vfilters );
if ( b_last_es )
{
- vlc_object_t *p_libvlc_global = p_stream->p_libvlc_global;
+ 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 );
free( p_bridge );
- var_Destroy( p_libvlc_global, "mosaic-struct" );
+ var_Destroy( p_libvlc, "mosaic-struct" );
}
vlc_mutex_unlock( p_sys->p_lock );
{
if ( pp_ring[i]->i_status == DESTROYED_PICTURE )
{
- if ( pp_ring[i]->p_data_orig != NULL )
- free( pp_ring[i]->p_data_orig );
+ free( pp_ring[i]->p_data_orig );
free( pp_ring[i]->p_sys );
free( pp_ring[i] );
}
}
p_pic = malloc( sizeof(picture_t) );
+ if( !p_pic ) return NULL;
fmt_out->video.i_chroma = fmt_out->i_codec;
vout_AllocatePicture( p_this, p_pic,
fmt_out->video.i_chroma,
inline static void video_del_buffer_decoder( decoder_t *p_this,
picture_t *p_pic )
{
- video_del_buffer( VLC_OBJECT( p_this ), p_pic );
+ VLC_UNUSED(p_this);
+ video_del_buffer( p_pic );
}
inline static void video_del_buffer_filter( filter_t *p_this,
picture_t *p_pic )
{
- video_del_buffer( VLC_OBJECT( p_this ), p_pic );
+ VLC_UNUSED(p_this);
+ video_del_buffer( p_pic );
}
-static void video_del_buffer( vlc_object_t *p_this, picture_t *p_pic )
+static void video_del_buffer( picture_t *p_pic )
{
p_pic->i_refcount = 0;
p_pic->i_status = DESTROYED_PICTURE;
if ( p_pic->p_sys->b_dead )
{
- if ( p_pic->p_data_orig != NULL )
- free( p_pic->p_data_orig );
+ free( p_pic->p_data_orig );
free( p_pic->p_sys );
free( p_pic );
}
static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
{
+ VLC_UNUSED(p_dec);
p_pic->i_refcount++;
}
static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
{
+ VLC_UNUSED(p_dec);
video_release_buffer_decoder( p_pic );
}
vlc_value_t oldval, vlc_value_t newval,
void *p_data )
{
+ VLC_UNUSED(p_this); VLC_UNUSED(oldval);
sout_stream_t *p_stream = (sout_stream_t *)p_data;
sout_stream_sys_t *p_sys = p_stream->p_sys;
int i_ret = VLC_SUCCESS;