Commit 2ba61dee authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Merge module_release and module_Put

parent fe41cd60
...@@ -39,11 +39,12 @@ VLC_EXPORT( bool, __module_Exists, ( vlc_object_t *, const char * ) ); ...@@ -39,11 +39,12 @@ VLC_EXPORT( bool, __module_Exists, ( vlc_object_t *, const char * ) );
#define module_Find(a,b) __module_Find(VLC_OBJECT(a),b) #define module_Find(a,b) __module_Find(VLC_OBJECT(a),b)
VLC_EXPORT( module_t *, __module_Find, ( vlc_object_t *, const char * ) ); VLC_EXPORT( module_t *, __module_Find, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, module_Put, ( module_t *module ) );
VLC_EXPORT( module_config_t *, module_GetConfig, ( const module_t *, unsigned * ) ); VLC_EXPORT( module_config_t *, module_GetConfig, ( const module_t *, unsigned * ) );
VLC_EXPORT( void, module_PutConfig, ( module_config_t * ) ); VLC_EXPORT( void, module_PutConfig, ( module_config_t * ) );
VLC_EXPORT( module_t *, module_hold, (module_t *module) );
VLC_EXPORT( void, module_release, (module_t *module) );
VLC_EXPORT( void, module_list_free, (module_t **) ); VLC_EXPORT( void, module_list_free, (module_t **) );
VLC_EXPORT( module_t **, module_list_get, (size_t *n) ); VLC_EXPORT( module_t **, module_list_get, (size_t *n) );
......
...@@ -496,7 +496,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -496,7 +496,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
layout->addWidget( box, i_line, 0, 1, -1 ); layout->addWidget( box, i_line, 0, 1, -1 );
} }
module_Put( p_module ); module_release (p_module);
scrolled_area->setSizePolicy( QSizePolicy::Preferred,QSizePolicy::Fixed ); scrolled_area->setSizePolicy( QSizePolicy::Preferred,QSizePolicy::Fixed );
scrolled_area->setLayout( layout ); scrolled_area->setLayout( layout );
......
...@@ -271,11 +271,11 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add ) ...@@ -271,11 +271,11 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
} }
else else
{ {
module_Put( p_obj ); module_release (p_obj);
msg_Err( p_intf, "Unknown video filter type." ); msg_Err( p_intf, "Unknown video filter type." );
return; return;
} }
module_Put( p_obj ); module_release (p_obj);
psz_string = config_GetPsz( p_intf, psz_filter_type ); psz_string = config_GetPsz( p_intf, psz_filter_type );
......
...@@ -1214,6 +1214,6 @@ void CaptureOpenPanel::advancedDialog() ...@@ -1214,6 +1214,6 @@ void CaptureOpenPanel::advancedDialog()
} }
delete adv; delete adv;
module_PutConfig( p_config ); module_PutConfig( p_config );
module_Put( p_module ); module_release (p_module);
} }
...@@ -1196,7 +1196,7 @@ void KeySelectorControl::finish() ...@@ -1196,7 +1196,7 @@ void KeySelectorControl::finish()
} }
} }
module_PutConfig (p_config); module_PutConfig (p_config);
module_Put (p_main); module_release (p_main);
table->resizeColumnToContents( 0 ); table->resizeColumnToContents( 0 );
......
...@@ -515,7 +515,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -515,7 +515,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_Put( p_module ); module_release (p_module);
} }
p_module = module_Find( VLC_OBJECT(p_intf), "pvr" ); p_module = module_Find( VLC_OBJECT(p_intf), "pvr" );
...@@ -526,7 +526,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -526,7 +526,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_Put( p_module ); module_release (p_module);
} }
p_module = module_Find( VLC_OBJECT(p_intf), "dvb" ); p_module = module_Find( VLC_OBJECT(p_intf), "dvb" );
...@@ -537,7 +537,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -537,7 +537,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_Put( p_module ); module_release (p_module);
} }
p_module = module_Find( VLC_OBJECT(p_intf), "dshow" ); p_module = module_Find( VLC_OBJECT(p_intf), "dshow" );
...@@ -548,7 +548,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -548,7 +548,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_Put( p_module ); module_release (p_module);
} }
/* Update Disc panel */ /* Update Disc panel */
......
...@@ -1033,7 +1033,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -1033,7 +1033,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
if( config_data->i_type == TYPE_MODULE ) if( config_data->i_type == TYPE_MODULE )
{ {
module_Put( p_module ); module_release (p_module);
} }
else else
{ {
......
...@@ -211,12 +211,13 @@ module_GetHelp ...@@ -211,12 +211,13 @@ module_GetHelp
__module_GetModulesNamesForCapability __module_GetModulesNamesForCapability
module_GetName module_GetName
module_GetObjName module_GetObjName
module_hold
module_IsCapable module_IsCapable
module_list_free module_list_free
module_list_get module_list_get
__module_Need __module_Need
module_Put
module_PutConfig module_PutConfig
module_release
__module_Unneed __module_Unneed
__msg_Dbg __msg_Dbg
__msg_DisableObjectPrinting __msg_DisableObjectPrinting
......
...@@ -325,6 +325,17 @@ const char *module_GetHelp( const module_t *m ) ...@@ -325,6 +325,17 @@ const char *module_GetHelp( const module_t *m )
return m->psz_help; return m->psz_help;
} }
module_t *module_hold (module_t *m)
{
vlc_hold (&m->vlc_gc_data);
return m;
}
void module_release (module_t *m)
{
vlc_release (&m->vlc_gc_data);
}
/** /**
* Frees the flat list of VLC modules. * Frees the flat list of VLC modules.
* @param list list obtained by module_list_get * @param list list obtained by module_list_get
...@@ -749,19 +760,6 @@ module_t *__module_Find( vlc_object_t *p_this, const char * psz_name ) ...@@ -749,19 +760,6 @@ module_t *__module_Find( vlc_object_t *p_this, const char * psz_name )
return module; return module;
} }
/**
* Release a module_t pointer from module_Find().
*
* \param module the module to release
* \return nothing
*/
void module_Put( module_t *module )
{
module_release( module );
}
/** /**
* Tell if a module exists and release it in thic case * Tell if a module exists and release it in thic case
* *
...@@ -773,14 +771,8 @@ bool __module_Exists( vlc_object_t *p_this, const char * psz_name ) ...@@ -773,14 +771,8 @@ bool __module_Exists( vlc_object_t *p_this, const char * psz_name )
{ {
module_t *p_module = __module_Find( p_this, psz_name ); module_t *p_module = __module_Find( p_this, psz_name );
if( p_module ) if( p_module )
{ module_release (p_module);
module_Put( p_module ); return true != NULL;
return true;
}
else
{
return false;
}
} }
/** /**
......
...@@ -149,17 +149,6 @@ struct module_t ...@@ -149,17 +149,6 @@ struct module_t
bool b_loaded; /* Set to true if the dll is loaded */ bool b_loaded; /* Set to true if the dll is loaded */
}; };
static inline module_t *module_hold (module_t *m)
{
vlc_hold (&m->vlc_gc_data);
return m;
}
static inline void module_release (module_t *m)
{
vlc_release (&m->vlc_gc_data);
}
#define module_InitBank(a) __module_InitBank(VLC_OBJECT(a)) #define module_InitBank(a) __module_InitBank(VLC_OBJECT(a))
void __module_InitBank ( vlc_object_t * ); void __module_InitBank ( vlc_object_t * );
#define module_LoadBuiltins(a) __module_LoadBuiltins(VLC_OBJECT(a)) #define module_LoadBuiltins(a) __module_LoadBuiltins(VLC_OBJECT(a))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment