* Prototypes
*****************************************************************************/
VLC_API void *vlc_object_create( vlc_object_t *, size_t ) VLC_MALLOC VLC_USED;
-VLC_API void vlc_object_attach( vlc_object_t *, vlc_object_t * );
VLC_API vlc_object_t *vlc_object_find_name( vlc_object_t *, const char *, int ) VLC_USED VLC_DEPRECATED;
VLC_API void * vlc_object_hold( vlc_object_t * );
VLC_API void vlc_object_release( vlc_object_t * );
#define vlc_object_create(a,b) vlc_object_create( VLC_OBJECT(a), b )
-#define vlc_object_attach(a,b) \
- vlc_object_attach( VLC_OBJECT(a), VLC_OBJECT(b) )
-
#define vlc_object_find_name(a,b,c) \
vlc_object_find_name( VLC_OBJECT(a),b,c)
vlc_object_create( p_access, sizeof( rtmp_control_thread_t ) );
if( !p_sys->p_thread )
return VLC_ENOMEM;
- vlc_object_attach( p_sys->p_thread, p_access );
/* Parse URI - remove spaces */
p = psz = strdup( p_access->psz_location );
free( p_sys );
return VLC_ENOMEM;
}
- vlc_object_attach( p_sys->p_thread, p_access );
/* Parse URI - remove spaces */
p = psz = strdup( p_access->psz_path );
p_intf->p_sys->p_blend =
vlc_object_create( p_intf, sizeof(filter_t) );
- vlc_object_attach( p_intf->p_sys->p_blend, p_intf );
p_intf->p_sys->p_blend->fmt_out.video.i_x_offset =
p_intf->p_sys->p_blend->fmt_out.video.i_y_offset = 0;
p_intf->p_sys->p_blend->fmt_out.video.i_sar_num =
p_intf->p_sys->p_text =
vlc_object_create( p_intf, sizeof(filter_t) );
- vlc_object_attach( p_intf->p_sys->p_text, p_intf );
p_intf->p_sys->p_text->fmt_out.video.i_width =
p_intf->p_sys->p_text->fmt_out.video.i_visible_width =
emit extensionsUpdated();
return false;
}
- vlc_object_attach( p_extensions_manager, p_intf );
p_extensions_manager->p_module =
module_need( p_extensions_manager, "extension", NULL, false );
if( m_pProvider == NULL )
return false;
- // Attach the dialogs provider to its parent interface
- vlc_object_attach( m_pProvider, getIntf() );
-
m_pModule = module_need( m_pProvider, "dialogs provider", NULL, false );
if( m_pModule == NULL )
{
p_sys->p_decoder = vlc_object_create( p_stream, sizeof( decoder_t ) );
if( !p_sys->p_decoder )
return NULL;
- vlc_object_attach( p_sys->p_decoder, p_stream );
p_sys->p_decoder->p_module = NULL;
p_sys->p_decoder->fmt_in = *p_fmt;
p_sys->p_decoder->b_pace_control = false;
p_grab->p_sys = (sout_access_out_sys_t *)p_stream;
p_grab->pf_seek = NULL;
p_grab->pf_write = AccessOutGrabberWrite;
- vlc_object_attach( p_grab, p_stream );
return p_grab;
}
id->p_decoder = vlc_object_create( p_stream, sizeof( decoder_t ) );
if( !id->p_decoder )
goto error;
- vlc_object_attach( id->p_decoder, p_stream );
id->p_decoder->p_module = NULL;
id->p_decoder->fmt_in = *p_fmt;
id->p_decoder->b_pace_control = true;
id->p_encoder = sout_EncoderCreate( p_stream );
if( !id->p_encoder )
goto error;
- vlc_object_attach( id->p_encoder, p_stream );
id->p_encoder->p_module = NULL;
/* Create destination format */
picture_Release( p_pic );
return NULL;
}
- vlc_object_attach( p_blend, p_filter );
p_blend->fmt_out.video = p_sys->p_base_image->format;
p_blend->fmt_in.video = p_sys->p_blend_image->format;
p_blend->p_module = module_need( p_blend, "video blending", NULL, false );
/* Load the internal opencv filter */
/* We don't need to set up video formats for this filter as it not actually using a picture_t */
p_sys->p_opencv = vlc_object_create( p_vout, sizeof(filter_t) );
- vlc_object_attach( p_sys->p_opencv, p_vout );
if (p_vout->p_sys->psz_inner_name)
p_sys->p_opencv->p_module =
if( !p_sys->p_vout )
goto error;
- vlc_object_attach( p_sys->p_vout, p_filter );
-
/* */
video_format_Init( &fmt, 0 );
video_format_Setup( &fmt, VLC_CODEC_RGB32,
vlc_object_release(libvlc);
return nil;
}
- vlc_object_attach(_instance, libvlc);
_instance->p_module = module_need(_instance, "extension", NULL, false);
NSAssert(_instance->p_module, @"Unable to load extensions module");
vlc_object_set_destructor( p_aout, aout_Destructor );
- vlc_object_attach( p_aout, p_parent );
-
return p_aout;
}
VLC_OBJECT_GENERIC, typename );
if ( p_filter == NULL ) return NULL;
- vlc_object_attach( p_filter, p_aout );
memcpy( &p_filter->fmt_in.audio, p_input_format,
sizeof(audio_sample_format_t) );
continue;
}
- vlc_object_attach( p_filter , p_aout );
-
p_filter->p_owner = malloc( sizeof(*p_filter->p_owner) );
p_filter->p_owner->p_aout = p_aout;
p_filter->p_owner->p_input = p_input;
p_mixer->mix = NULL;
p_mixer->sys = NULL;
- vlc_object_attach( p_mixer, p_aout );
-
p_mixer->module = module_need( p_mixer, "audio mixer", NULL, false );
if( !p_mixer->module )
{
libvlc_printerr("Not enough memory");
return NULL;
}
- vlc_object_attach (mp, mp->p_libvlc);
/* Input */
var_Create (mp, "rate", VLC_VAR_FLOAT|VLC_VAR_DOINHERIT);
access_InitFields( p_access );
- /* Before module_need (for var_Create...) */
- vlc_object_attach( p_access, p_obj );
-
p_access->p_module = module_need( p_access, "access", psz_access, true );
if( p_access->p_module == NULL )
goto error;
p_dec->pf_get_display_date = DecoderGetDisplayDate;
p_dec->pf_get_display_rate = DecoderGetDisplayRate;
- vlc_object_attach( p_dec, p_parent );
-
/* Find a suitable decoder/packetizer module */
if( !b_packetizer )
p_dec->p_module = module_need( p_dec, "decoder", "$codec", false );
es_format_Copy( &p_owner->p_packetizer->fmt_out,
&null_es_format );
- vlc_object_attach( p_owner->p_packetizer, p_parent );
-
p_owner->p_packetizer->p_module =
module_need( p_owner->p_packetizer,
"packetizer", "$packetizer", false );
}
}
- /* Before module_need (for var_Create...) */
- vlc_object_attach( p_demux, p_obj );
-
if( s )
{
/* ID3/APE tags will mess-up demuxer probing so we skip it here.
p_packetizer->fmt_in = *p_fmt;
es_format_Init( &p_packetizer->fmt_out, UNKNOWN_ES, 0 );
- vlc_object_attach( p_packetizer, p_demux );
p_packetizer->p_module = module_need( p_packetizer, "packetizer", NULL, false );
if( !p_packetizer->p_module )
{
if( p_input == NULL )
return NULL;
- vlc_object_attach( p_input, p_parent );
-
/* Construct a nice name for the input timer */
char psz_timer_name[255];
char * psz_name = input_item_GetName( p_item );
VLC_OBJECT_GENERIC, "demux meta" );
if( !p_demux_meta )
return;
- vlc_object_attach( p_demux_meta, p_demux );
p_demux_meta->p_demux = p_demux;
p_demux_meta->p_item = p_input->p->p_item;
"meta writer" );
if( p_export == NULL )
return VLC_ENOMEM;
- vlc_object_attach( p_export, obj );
p_export->p_item = p_item;
int type;
return NULL;
}
- /* Attach it now, needed for b_die */
- vlc_object_attach( s, p_access );
-
s->pf_read = NULL; /* Set up later */
s->pf_peek = NULL;
s->pf_control = AStreamControl;
return NULL;
}
- vlc_object_attach( s, p_obj );
-
if( vlc_clone( &p_sys->thread, DStreamThread, s, VLC_THREAD_PRIORITY_INPUT ) )
{
stream_CommonDelete( s );
s->p_source = p_source;
/* */
- vlc_object_attach( s, p_source );
-
s->p_module = module_need( s, "stream_filter", psz_stream_filter, true );
if( !s->p_module )
s->pf_destroy = Delete;
s->p_input = NULL;
- vlc_object_attach( s, p_this );
return s;
}
TAB_INIT( p_vlm->i_schedule, p_vlm->schedule );
p_vlm->p_vod = NULL;
var_Create( p_vlm, "intf-event", VLC_VAR_ADDRESS );
- vlc_object_attach( p_vlm, p_this->p_libvlc );
if( vlc_clone( &p_vlm->thread, Manage, p_vlm, VLC_THREAD_PRIORITY_LOW ) )
{
{
p_vlm->p_vod = vlc_custom_create( VLC_OBJECT(p_vlm), sizeof( vod_t ),
VLC_OBJECT_GENERIC, "vod server" );
- vlc_object_attach( p_vlm->p_vod, p_vlm );
p_vlm->p_vod->p_module = module_need( p_vlm->p_vod, "vod server", "$vod-server", false );
if( !p_vlm->p_vod->p_module )
{
p_instance->i_index = 0;
p_instance->b_sout_keep = false;
p_instance->p_parent = vlc_object_create( p_vlm, sizeof (vlc_object_t) );
- vlc_object_attach( p_instance->p_parent, p_vlm );
p_instance->p_input = NULL;
p_instance->p_input_resource = NULL;
var_AddCallback( p_intf, "intf-add", AddIntfCallback, NULL );
/* Attach interface to LibVLC */
- vlc_object_attach( p_intf, p_libvlc );
#if defined( __APPLE__ )
p_intf->b_should_run_on_first_thread = false;
#endif
vlc_mutex_trylock
vlc_mutex_unlock
vlc_global_mutex
-vlc_object_attach
vlc_object_create
vlc_object_find_name
vlc_object_hold
* input format */
p_blend->p_module = NULL;
- /* */
- vlc_object_attach( p_blend, p_this );
-
return p_blend;
}
video_format_Copy( &p_splitter->fmt, p_fmt );
/* */
- vlc_object_attach( p_splitter, p_this );
-
p_splitter->p_module = module_need( p_splitter, "video splitter", psz_name, true );
if( ! p_splitter->p_module )
{
filter_t *p_filter = &p_chained->filter;
if( !p_filter )
return NULL;
- vlc_object_attach( p_filter, p_chain->p_this );
if( !p_fmt_in )
{
p_dec->pf_picture_link = video_link_picture;
p_dec->pf_picture_unlink = video_unlink_picture;
- vlc_object_attach( p_dec, p_this );
-
/* Find a suitable decoder module */
p_dec->p_module = module_need( p_dec, "decoder", "$codec", false );
if( !p_dec->p_module )
p_enc->fmt_out.video.i_width = p_enc->fmt_in.video.i_width;
p_enc->fmt_out.video.i_height = p_enc->fmt_in.video.i_height;
- vlc_object_attach( p_enc, p_this );
-
/* Find a suitable decoder module */
p_enc->p_module = module_need( p_enc, "encoder", NULL, false );
if( !p_enc->p_module )
p_filter = vlc_custom_create( p_this, sizeof(filter_t),
VLC_OBJECT_GENERIC, typename );
- vlc_object_attach( p_filter, p_this );
-
p_filter->pf_video_buffer_new =
(picture_t *(*)(filter_t *))video_new_buffer;
p_filter->pf_video_buffer_del =
msg_Err( p_this, "unable to create media library object" );
return NULL;
}
- vlc_object_attach( p_ml, p_this );
p_ml->p_module = module_need( p_ml, "media-library", psz_name, false );
if( !p_ml->p_module )
}
}
-#undef vlc_object_attach
-/**
- * Exposes a VLC object in the hierarchy by attaching it to another object.
- * @note Before variables can be inherited, an object must be attached.
- * @param p_this object to expose
- * @param p_parent parent object in the hierarchy
- */
-void vlc_object_attach( vlc_object_t *p_this, vlc_object_t *p_parent )
-{
- if( !p_this ) return;
- if( likely(p_this->p_parent == p_parent) )
- return;
-
- msg_Err( p_this, "object hierarchy bug:" );
- msg_Err( p_this->p_parent, "created by this object but..." );
- msg_Err( p_parent, "...attached to this object" );
- abort();
-}
-
#undef vlc_list_children
/**
* Gets the list of children of an objects, and increment their reference
*pcount = 0;
return NULL;
}
- vlc_object_attach (probe, obj);
probe->list = NULL;
probe->count = 0;
msg_Err( p_this, "unable to create sql object" );
return NULL;
}
- vlc_object_attach( p_sql, p_this );
p_sql->psz_host = strdup( psz_host );
p_sql->psz_user = strdup( psz_user );
p_xml = vlc_custom_create( p_this, sizeof( *p_xml ), VLC_OBJECT_GENERIC,
"xml" );
- vlc_object_attach( p_xml, p_this );
p_xml->p_module = module_need( p_xml, "xml", NULL, false );
if( !p_xml->p_module )
reader = vlc_custom_create(obj, sizeof(*reader), VLC_OBJECT_GENERIC,
"xml reader");
- vlc_object_attach(reader, obj);
reader->p_stream = stream;
reader->p_module = module_need(reader, "xml reader", NULL, false);
httpd->host = NULL;
libvlc_priv (p_this->p_libvlc)->p_httpd = httpd;
- vlc_object_attach( httpd, p_this->p_libvlc );
}
/* verify if it already exist */
vlc_cond_init( &host->wait );
host->i_ref = 1;
- vlc_object_attach( host, p_this );
-
host->fds = net_ListenTCP( p_this, psz_host, i_port );
if( host->fds == NULL )
{
var_SetString (srv, "tls-x509-key", key_path);
}
- vlc_object_attach (srv, obj);
srv->p_module = module_need (srv, "tls server", NULL, false );
if (srv->p_module == NULL)
{
tls_session_t *tls_ServerSessionPrepare (tls_server_t *srv)
{
- tls_session_t *ses;
-
- ses = srv->pf_open (srv);
- if (ses == NULL)
- return NULL;
-
- vlc_object_attach (ses, srv);
- return ses;
+ return srv->pf_open (srv);
}
else
msg_Dbg (cl, "requested anonymous server");
- vlc_object_attach (cl, obj);
cl->p_module = module_need (cl, "tls client", NULL, false );
if (cl->p_module == NULL)
{
return NULL;
p_osd->p_parser = NULL;
- vlc_object_attach( p_osd, p_this->p_libvlc );
/* Parse configuration file */
if ( !osd_ParserLoad( p_osd, psz_file ) )
assert( offsetof( playlist_private_t, public_data ) == 0 );
p_playlist = &p->public_data;
- vlc_object_attach( p_playlist, p_parent );
TAB_INIT( pl_priv(p_playlist)->i_sds, pl_priv(p_playlist)->pp_sds );
libvlc_priv(p_parent->p_libvlc)->p_playlist = p_playlist;
{
module_t *p_module;
- vlc_object_attach( p_finder, p_parent );
p_finder->p_item = p_item;
p_module = module_need( p_finder, "art finder", NULL, false );
if( !p_demux_meta )
return;
- vlc_object_attach( p_demux_meta, p_fetcher->p_playlist );
p_demux_meta->p_demux = NULL;
p_demux_meta->p_item = p_item;
if( !p_export )
return VLC_ENOMEM;
- vlc_object_attach( p_export, p_playlist );
msg_Dbg( p_export, "saving %s to file %s",
p_export_root->p_input->psz_name, psz_filename );
vlc_event_manager_register_event_type(em, vlc_ServicesDiscoveryEnded);
vlc_object_set_destructor( p_sd, services_discovery_Destructor );
- vlc_object_attach( p_sd, p_super );
-
return p_sd;
}
if (p_sap == NULL)
return NULL;
- vlc_object_attach( p_sap, p_announce );
vlc_mutex_init (&p_sap->lock);
p_sap->first = NULL;
return p_sap;
vlc_mutex_init( &p_sout->lock );
p_sout->p_stream = NULL;
- /* attach it for inherit */
- vlc_object_attach( p_sout, p_parent );
-
var_Create( p_sout, "sout-mux-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
p_sout->p_stream = sout_StreamChainNew( p_sout, psz_chain, NULL, NULL );
p_access->i_writes = 0;
p_access->i_sent_bytes = 0;
- vlc_object_attach( p_access, p_sout );
-
p_access->p_module =
module_need( p_access, "sout access", p_access->psz_access, true );
p_mux->b_waiting_stream = true;
p_mux->i_add_stream_start = -1;
- vlc_object_attach( p_mux, p_sout );
-
p_mux->p_module =
module_need( p_mux, "sout mux", p_mux->psz_mux, true );
msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
- vlc_object_attach( p_stream, p_sout );
-
p_stream->p_module =
module_need( p_stream, "sout stream", p_stream->psz_name, true );
vd->owner = *owner;
- vlc_object_attach(vd, obj);
-
if (load_module) {
vd->module = module_need(vd, "vout display", module, module && *module != '\0');
if (!vd->module) {
ih->p_sys = NULL;
ih->inhibit = NULL;
- vlc_object_attach (ih, parent);
priv->module = module_need (ih, "inhibit", NULL, false);
if (priv->module == NULL)
{
gl = vlc_custom_create(parent, sizeof (*gl), VLC_OBJECT_GENERIC, "gl");
if (unlikely(gl == NULL))
return NULL;
- vlc_object_attach(gl, parent);
gl->surface = wnd;
gl->module = module_need(gl, type, name, true);
vlc_mutex_init(&vout->p->filter.lock);
vlc_mutex_init(&vout->p->spu_lock);
- /* Attach the new object now so we can use var inheritance below */
- vlc_object_attach(vout, object);
-
/* Initialize subpicture unit */
vout->p->spu = spu_Create(vout);
text->pf_get_attachments = spu_get_attachments;
- vlc_object_attach(text, spu);
text->p_module = module_need(text, "text renderer", "$text-renderer", false);
/* Create a few variables used for enhanced text rendering */
scale->pf_video_buffer_new = spu_new_video_buffer;
scale->pf_video_buffer_del = spu_del_video_buffer;
- vlc_object_attach(scale, object);
scale->p_module = module_need(scale, "video filter2", NULL, false);
return scale;
VLC_OBJECT_GENERIC, "subpicture");
if (!spu)
return NULL;
- vlc_object_attach(spu, object);
/* Initialize spu fields */
spu_private_t *sys = spu->p = (spu_private_t*)&spu[1];
window->control = NULL;
window->sys = NULL;
- vlc_object_attach(window, obj);
-
const char *type;
switch (cfg->type) {
#ifdef WIN32
vlc_object_release (p_helper);
p_helper = NULL;
}
- vlc_object_attach (p_helper, p_this);
CloseHandle( hIPCHelperReady );
/* Initialization done.