Commit 4b531b44 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

module_find, module_exists, module_get_main: remove useless paramter

parent 4bf40479
...@@ -34,11 +34,8 @@ ...@@ -34,11 +34,8 @@
VLC_EXPORT( module_t *, __module_need, ( vlc_object_t *, const char *, const char *, bool ) ); VLC_EXPORT( module_t *, __module_need, ( vlc_object_t *, const char *, const char *, bool ) );
#define module_unneed(a,b) __module_unneed(VLC_OBJECT(a),b) #define module_unneed(a,b) __module_unneed(VLC_OBJECT(a),b)
VLC_EXPORT( void, __module_unneed, ( vlc_object_t *, module_t * ) ); VLC_EXPORT( void, __module_unneed, ( vlc_object_t *, module_t * ) );
#define module_exists(a,b) __module_exists(VLC_OBJECT(a),b) VLC_EXPORT( bool, module_exists, (const char *) );
VLC_EXPORT( bool, __module_exists, ( vlc_object_t *, const char * ) ); VLC_EXPORT( module_t *, module_find, (const char *) );
#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_config_t *, module_config_get, ( const module_t *, unsigned * ) ); VLC_EXPORT( module_config_t *, module_config_get, ( const module_t *, unsigned * ) );
VLC_EXPORT( void, module_config_free, ( module_config_t * ) ); VLC_EXPORT( void, module_config_free, ( module_config_t * ) );
...@@ -63,12 +60,11 @@ VLC_EXPORT( const char *, module_get_name, ( const module_t *m, bool long_name ) ...@@ -63,12 +60,11 @@ VLC_EXPORT( const char *, module_get_name, ( const module_t *m, bool long_name )
#define module_GetLongName( m ) module_get_name( m, true ) #define module_GetLongName( m ) module_get_name( m, true )
VLC_EXPORT( const char *, module_get_help, ( const module_t *m ) ); VLC_EXPORT( const char *, module_get_help, ( const module_t *m ) );
static inline module_t *module_get_main (void)
#define module_get_main(a) __module_get_main(VLC_OBJECT(a))
static inline module_t * __module_get_main( vlc_object_t * p_this )
{ {
return module_find( p_this, "main" ); return module_find ("main");
} }
#define module_get_main(a) module_get_main()
static inline bool module_is_main( const module_t * p_module ) static inline bool module_is_main( const module_t * p_module )
{ {
......
...@@ -141,7 +141,7 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -141,7 +141,7 @@ static int OpenDecoder( vlc_object_t *p_this )
/* HACK: Don't use this codec if we don't have an mpga audio filter */ /* HACK: Don't use this codec if we don't have an mpga audio filter */
if( p_dec->i_object_type == VLC_OBJECT_DECODER && if( p_dec->i_object_type == VLC_OBJECT_DECODER &&
!module_exists( p_this, "mpgatofixed32" ) ) !module_exists( "mpgatofixed32" ) )
{ {
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
...@@ -517,7 +517,7 @@ static int ParseImageAttachments( decoder_t *p_dec ) ...@@ -517,7 +517,7 @@ static int ParseImageAttachments( decoder_t *p_dec )
fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A'); fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
/* Find a suitable decoder module */ /* Find a suitable decoder module */
if( module_exists( p_dec, "sdl_image" ) ) if( module_exists( "sdl_image" ) )
{ {
/* ffmpeg thinks it can handle bmp properly but it can't (at least /* ffmpeg thinks it can handle bmp properly but it can't (at least
* not all of them), so use sdl_image if it is available */ * not all of them), so use sdl_image if it is available */
......
...@@ -437,7 +437,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des ...@@ -437,7 +437,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[self setupButton: o_audio_visual_pop forModuleList: "audio-visual"]; [self setupButton: o_audio_visual_pop forModuleList: "audio-visual"];
/* Last.FM is optional */ /* Last.FM is optional */
if( module_exists( p_intf, "audioscrobbler" ) ) if( module_exists( "audioscrobbler" ) )
{ {
[o_audio_lastuser_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-username" ) ?: ""]]; [o_audio_lastuser_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-username" ) ?: ""]];
[o_audio_lastpwd_sfld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-password" ) ?: ""]]; [o_audio_lastpwd_sfld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-password" ) ?: ""]];
...@@ -538,9 +538,9 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des ...@@ -538,9 +538,9 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
int i_cache = config_GetInt( p_intf, "file-caching"); int i_cache = config_GetInt( p_intf, "file-caching");
TestCaC( "udp-caching" ); TestCaC( "udp-caching" );
if( module_exists (p_intf, "dvdread") ) if( module_exists ("dvdread") )
TestCaC( "dvdread-caching" ); TestCaC( "dvdread-caching" );
if( module_exists (p_intf, "dvdnav") ) if( module_exists ("dvdnav") )
TestCaC( "dvdnav-caching" ); TestCaC( "dvdnav-caching" );
TestCaC( "tcp-caching" ); TestCaC( "tcp-caching" );
TestCaC( "fake-caching" ); TestCaC( "fake-caching" );
...@@ -550,7 +550,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des ...@@ -550,7 +550,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
TestCaCi( "rtsp-caching", 4 ); TestCaCi( "rtsp-caching", 4 );
TestCaCi( "ftp-caching", 2 ); TestCaCi( "ftp-caching", 2 );
TestCaCi( "http-caching", 4 ); TestCaCi( "http-caching", 4 );
if(module_exists (p_intf, "access_realrtsp")) if(module_exists ("access_realrtsp"))
TestCaCi( "realrtsp-caching", 10 ); TestCaCi( "realrtsp-caching", 10 );
TestCaCi( "mms-caching", 19 ); TestCaCi( "mms-caching", 19 );
if( b_cache_equal ) if( b_cache_equal )
...@@ -781,7 +781,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -781,7 +781,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
SaveModuleList( o_audio_visual_pop, "audio-visual" ); SaveModuleList( o_audio_visual_pop, "audio-visual" );
/* Last.FM is optional */ /* Last.FM is optional */
if( module_exists( p_intf, "audioscrobbler" ) ) if( module_exists( "audioscrobbler" ) )
{ {
[o_audio_last_ckb setEnabled: YES]; [o_audio_last_ckb setEnabled: YES];
if( [o_audio_last_ckb state] == NSOnState ) if( [o_audio_last_ckb state] == NSOnState )
...@@ -861,12 +861,12 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -861,12 +861,12 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
#define CaC( name ) CaCi( name, 1 ) #define CaC( name ) CaCi( name, 1 )
msg_Dbg( p_intf, "Adjusting all cache values to: %i", [[o_input_cachelevel_pop selectedItem] tag] ); msg_Dbg( p_intf, "Adjusting all cache values to: %i", [[o_input_cachelevel_pop selectedItem] tag] );
CaC( "udp-caching" ); CaC( "udp-caching" );
if( module_exists (p_intf, "dvdread" ) ) if( module_exists ( "dvdread" ) )
{ {
CaC( "dvdread-caching" ); CaC( "dvdread-caching" );
i = i + config_SaveConfigFile( p_intf, "dvdread" ); i = i + config_SaveConfigFile( p_intf, "dvdread" );
} }
if( module_exists (p_intf, "dvdnav" ) ) if( module_exists ( "dvdnav" ) )
{ {
CaC( "dvdnav-caching" ); CaC( "dvdnav-caching" );
i = i + config_SaveConfigFile( p_intf, "dvdnav" ); i = i + config_SaveConfigFile( p_intf, "dvdnav" );
...@@ -876,7 +876,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -876,7 +876,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
CaC( "screen-caching" ); CaC( "screen-caching" );
CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 ); CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 );
CaCi( "http-caching", 4 ); CaCi( "http-caching", 4 );
if( module_exists (p_intf, "access_realrtsp" ) ) if( module_exists ( "access_realrtsp" ) )
{ {
CaCi( "realrtsp-caching", 10 ); CaCi( "realrtsp-caching", 10 );
i = i + config_SaveConfigFile( p_intf, "access_realrtsp" ); i = i + config_SaveConfigFile( p_intf, "access_realrtsp" );
......
...@@ -75,7 +75,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -75,7 +75,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
#undef BI #undef BI
/* Build the tree for the main module */ /* Build the tree for the main module */
module_t *p_module = module_get_main( p_intf ); module_t *p_module = module_get_main();
/* Initialisation and get the confsize */ /* Initialisation and get the confsize */
PrefsItemData *data = NULL; PrefsItemData *data = NULL;
...@@ -354,10 +354,10 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -354,10 +354,10 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
if( data->i_type == TYPE_CATEGORY ) if( data->i_type == TYPE_CATEGORY )
return; return;
else if( data->i_type == TYPE_MODULE ) else if( data->i_type == TYPE_MODULE )
p_module = module_find( p_intf, data->psz_name ); p_module = module_find( data->psz_name );
else else
{ {
p_module = module_get_main( p_intf ); p_module = module_get_main();
assert( p_module ); assert( p_module );
} }
......
...@@ -251,7 +251,7 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add ) ...@@ -251,7 +251,7 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
char *psz_parser, *psz_string; char *psz_parser, *psz_string;
const char *psz_filter_type; const char *psz_filter_type;
module_t *p_obj = module_find( p_intf, psz_name ); module_t *p_obj = module_find( psz_name );
if( !p_obj ) if( !p_obj )
{ {
msg_Err( p_intf, "Unable to find filter module \"%s\n.", psz_name ); msg_Err( p_intf, "Unable to find filter module \"%s\n.", psz_name );
......
...@@ -596,7 +596,7 @@ void CaptureOpenPanel::initialize() ...@@ -596,7 +596,7 @@ void CaptureOpenPanel::initialize()
/********************* /*********************
* DirectShow Stuffs * * DirectShow Stuffs *
*********************/ *********************/
if( module_exists( p_intf, "dshow" ) ){ if( module_exists( "dshow" ) ){
addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" ); addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
/* dshow Main */ /* dshow Main */
...@@ -630,7 +630,7 @@ void CaptureOpenPanel::initialize() ...@@ -630,7 +630,7 @@ void CaptureOpenPanel::initialize()
/************** /**************
* BDA Stuffs * * BDA Stuffs *
**************/ **************/
if( module_exists( p_intf, "bda" ) ){ if( module_exists( "bda" ) ){
addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" ); addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" );
/* bda Main */ /* bda Main */
...@@ -695,7 +695,7 @@ void CaptureOpenPanel::initialize() ...@@ -695,7 +695,7 @@ void CaptureOpenPanel::initialize()
/******* /*******
* V4L2* * V4L2*
*******/ *******/
if( module_exists( p_intf, "v4l2" ) ){ if( module_exists( "v4l2" ) ){
addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" ); addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" );
/* V4l Main panel */ /* V4l Main panel */
...@@ -730,7 +730,7 @@ void CaptureOpenPanel::initialize() ...@@ -730,7 +730,7 @@ void CaptureOpenPanel::initialize()
/******* /*******
* V4L * * V4L *
*******/ *******/
if( module_exists( p_intf, "v4l" ) ){ if( module_exists( "v4l" ) ){
addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" ); addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
/* V4l Main panel */ /* V4l Main panel */
...@@ -775,7 +775,7 @@ void CaptureOpenPanel::initialize() ...@@ -775,7 +775,7 @@ void CaptureOpenPanel::initialize()
/******* /*******
* JACK * * JACK *
*******/ *******/
if( module_exists( p_intf, "jack" ) ){ if( module_exists( "jack" ) ){
addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" ); addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" );
/* Jack Main panel */ /* Jack Main panel */
...@@ -829,7 +829,7 @@ void CaptureOpenPanel::initialize() ...@@ -829,7 +829,7 @@ void CaptureOpenPanel::initialize()
/************ /************
* PVR * * PVR *
************/ ************/
if( module_exists( p_intf, "pvr" ) ){ if( module_exists( "pvr" ) ){
addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" ); addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
/* PVR Main panel */ /* PVR Main panel */
...@@ -885,7 +885,7 @@ void CaptureOpenPanel::initialize() ...@@ -885,7 +885,7 @@ void CaptureOpenPanel::initialize()
/************** /**************
* DVB Stuffs * * DVB Stuffs *
**************/ **************/
if( module_exists( p_intf, "dvb" ) ){ if( module_exists( "dvb" ) ){
addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" ); addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
/* DVB Main */ /* DVB Main */
...@@ -1122,7 +1122,7 @@ void CaptureOpenPanel::advancedDialog() ...@@ -1122,7 +1122,7 @@ void CaptureOpenPanel::advancedDialog()
/* Get the corresponding module */ /* Get the corresponding module */
module_t *p_module = module_t *p_module =
module_find( VLC_OBJECT(p_intf), psz_devModule[i_devicetype] ); module_find( psz_devModule[i_devicetype] );
if( NULL == p_module ) return; if( NULL == p_module ) return;
/* Init */ /* Init */
......
...@@ -1155,7 +1155,7 @@ void KeySelectorControl::finish() ...@@ -1155,7 +1155,7 @@ void KeySelectorControl::finish()
table->setAlternatingRowColors( true ); table->setAlternatingRowColors( true );
/* Get the main Module */ /* Get the main Module */
module_t *p_main = module_find( p_this, "main" ); module_t *p_main = module_get_main();
assert( p_main ); assert( p_main );
/* Access to the module_config_t */ /* Access to the module_config_t */
......
...@@ -254,7 +254,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -254,7 +254,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC2( "directx-audio-device", IntegerList, CONFIG_GENERIC2( "directx-audio-device", IntegerList,
DirectXLabel, DirectXDevice ); DirectXLabel, DirectXDevice );
#else #else
if( module_exists( p_intf, "alsa" ) ) if( module_exists( "alsa" ) )
{ {
audioControl( alsa ); audioControl( alsa );
optionWidgets.append( alsaControl ); optionWidgets.append( alsaControl );
...@@ -264,7 +264,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -264,7 +264,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
} }
else else
optionWidgets.append( NULL ); optionWidgets.append( NULL );
if( module_exists( p_intf, "oss" ) ) if( module_exists( "oss" ) )
{ {
audioControl2( OSS ); audioControl2( OSS );
optionWidgets.append( OSSControl ); optionWidgets.append( OSSControl );
...@@ -316,7 +316,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -316,7 +316,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
updateAudioOptions( ui.outputModule->currentIndex() ); updateAudioOptions( ui.outputModule->currentIndex() );
/* LastFM */ /* LastFM */
if( module_exists( p_intf, "audioscrobbler" ) ) if( module_exists( "audioscrobbler" ) )
{ {
CONFIG_GENERIC( "lastfm-username", String, ui.lastfm_user_label, CONFIG_GENERIC( "lastfm-username", String, ui.lastfm_user_label,
lastfm_user_edit ); lastfm_user_edit );
...@@ -422,9 +422,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -422,9 +422,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
int i_cache = config_GetInt( p_intf, "file-caching"); int i_cache = config_GetInt( p_intf, "file-caching");
TestCaC( "udp-caching" ); TestCaC( "udp-caching" );
if (module_exists (p_intf, "dvdread")) if (module_exists ("dvdread"))
TestCaC( "dvdread-caching" ); TestCaC( "dvdread-caching" );
if (module_exists (p_intf, "dvdnav")) if (module_exists ("dvdnav"))
TestCaC( "dvdnav-caching" ); TestCaC( "dvdnav-caching" );
TestCaC( "tcp-caching" ); TestCaC( "tcp-caching" );
TestCaC( "fake-caching" ); TestCaC( "cdda-caching" ); TestCaC( "fake-caching" ); TestCaC( "cdda-caching" );
...@@ -432,18 +432,18 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -432,18 +432,18 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#ifdef WIN32 #ifdef WIN32
TestCaC( "dshow-caching" ); TestCaC( "dshow-caching" );
#else #else
if (module_exists (p_intf, "v4l")) if (module_exists ("v4l"))
TestCaC( "v4l-caching" ); TestCaC( "v4l-caching" );
if (module_exists (p_intf, "access_jack")) if (module_exists ("access_jack"))
TestCaC( "jack-input-caching" ); TestCaC( "jack-input-caching" );
if (module_exists (p_intf, "v4l2")) if (module_exists ("v4l2"))
TestCaC( "v4l2-caching" ); TestCaC( "v4l2-caching" );
if (module_exists (p_intf, "pvr")) if (module_exists ("pvr"))
TestCaC( "pvr-caching" ); TestCaC( "pvr-caching" );
#endif #endif
TestCaCi( "rtsp-caching", 4 ); TestCaCi( "ftp-caching", 2 ); TestCaCi( "rtsp-caching", 4 ); TestCaCi( "ftp-caching", 2 );
TestCaCi( "http-caching", 4 ); TestCaCi( "http-caching", 4 );
if (module_exists (p_intf, "access_realrtsp")) if (module_exists ("access_realrtsp"))
TestCaCi( "realrtsp-caching", 10 ); TestCaCi( "realrtsp-caching", 10 );
TestCaCi( "mms-caching", 19 ); TestCaCi( "mms-caching", 19 );
if( b_cache_equal ) ui.cachingCombo->setCurrentIndex( if( b_cache_equal ) ui.cachingCombo->setCurrentIndex(
...@@ -634,28 +634,28 @@ void SPrefsPanel::apply() ...@@ -634,28 +634,28 @@ void SPrefsPanel::apply()
if( i_comboValue ) if( i_comboValue )
{ {
CaC( "udp-caching" ); CaC( "udp-caching" );
if (module_exists (p_intf, "dvdread" )) if (module_exists ("dvdread" ))
CaC( "dvdread-caching" ); CaC( "dvdread-caching" );
if (module_exists (p_intf, "dvdnav" )) if (module_exists ("dvdnav" ))
CaC( "dvdnav-caching" ); CaC( "dvdnav-caching" );
CaC( "tcp-caching" ); CaC( "vcd-caching" ); CaC( "tcp-caching" ); CaC( "vcd-caching" );
CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" ); CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" );
CaC( "screen-caching" ); CaC( "screen-caching" );
CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 ); CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 );
CaCi( "http-caching", 4 ); CaCi( "http-caching", 4 );
if (module_exists (p_intf, "access_realrtsp" )) if (module_exists ("access_realrtsp" ))
CaCi( "realrtsp-caching", 10 ); CaCi( "realrtsp-caching", 10 );
CaCi( "mms-caching", 19 ); CaCi( "mms-caching", 19 );
#ifdef WIN32 #ifdef WIN32
CaC( "dshow-caching" ); CaC( "dshow-caching" );
#else #else
if (module_exists (p_intf, "v4l" )) if (module_exists ( "v4l" ))
CaC( "v4l-caching" ); CaC( "v4l-caching" );
if (module_exists (p_intf, "access_jack" )) if (module_exists ( "access_jack" ))
CaC( "jack-input-caching" ); CaC( "jack-input-caching" );
if (module_exists (p_intf, "v4l2" )) if (module_exists ( "v4l2" ))
CaC( "v4l2-caching" ); CaC( "v4l2-caching" );
if (module_exists (p_intf, "pvr" )) if (module_exists ( "pvr" ))
CaC( "pvr-caching" ); CaC( "pvr-caching" );
#endif #endif
//CaCi( "dv-caching" ) too short... //CaCi( "dv-caching" ) too short...
......
...@@ -76,7 +76,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) ...@@ -76,7 +76,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
syncW = new SyncControls( p_intf, videoTab ); syncW = new SyncControls( p_intf, videoTab );
mainTabW->addTab( syncW, qtr( "Synchronization" ) ); mainTabW->addTab( syncW, qtr( "Synchronization" ) );
if( module_exists( p_intf, "v4l2" ) ) if( module_exists( "v4l2" ) )
{ {
ExtV4l2 *v4l2 = new ExtV4l2( p_intf, mainTabW ); ExtV4l2 *v4l2 = new ExtV4l2( p_intf, mainTabW );
mainTabW->addTab( v4l2, qtr( "v4l2 controls" ) ); mainTabW->addTab( v4l2, qtr( "v4l2 controls" ) );
......
...@@ -507,48 +507,40 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -507,48 +507,40 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
notebook->AddPage( NetPanel( notebook ), wxU(_("Network")), notebook->AddPage( NetPanel( notebook ), wxU(_("Network")),
i_access_method == NET_ACCESS ); i_access_method == NET_ACCESS );
module_t *p_module = module_find( VLC_OBJECT(p_intf), "v4l" ); if( module_exists( "v4l" ) )
if( p_module )
{ {
AutoBuiltPanel *autopanel = AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module ); new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_release (p_module);
} }
p_module = module_find( VLC_OBJECT(p_intf), "pvr" ); if( module_exists( "pvr" ) )
if( p_module )
{ {
AutoBuiltPanel *autopanel = AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module ); new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_release (p_module);
} }
p_module = module_find( VLC_OBJECT(p_intf), "dvb" ); if( module_exists( "dvb" ) )
if( p_module )
{ {
AutoBuiltPanel *autopanel = AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module ); new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_release (p_module);
} }
p_module = module_find( VLC_OBJECT(p_intf), "dshow" ); if( module_exists( "dshow" ) )
if( p_module )
{ {
AutoBuiltPanel *autopanel = AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module ); new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel ); input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ), notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
i_access_method == CAPTURE_ACCESS ); i_access_method == CAPTURE_ACCESS );
module_release (p_module);
} }
/* Update Disc panel */ /* Update Disc panel */
......
...@@ -105,14 +105,14 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -105,14 +105,14 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text ); var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text );
/* Look for goom plugin */ /* Look for goom plugin */
if( module_exists( VLC_OBJECT(p_aout), "goom" ) ) if( module_exists( "goom" ) )
{ {
val.psz_string = (char*)"goom"; text.psz_string = (char*)"Goom"; val.psz_string = (char*)"goom"; text.psz_string = (char*)"Goom";
var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text ); var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text );
} }
/* Look for galaktos plugin */ /* Look for galaktos plugin */
if( module_exists( VLC_OBJECT(p_aout), "galaktos" ) ) if( module_exists( "galaktos" ) )
{ {
val.psz_string = (char*)"galaktos"; text.psz_string = (char*)"GaLaktos"; val.psz_string = (char*)"galaktos"; text.psz_string = (char*)"GaLaktos";
var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text ); var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text );
......
...@@ -207,8 +207,8 @@ LocaleFree ...@@ -207,8 +207,8 @@ LocaleFree
mdate mdate
module_config_free module_config_free
module_config_get module_config_get
__module_exists module_exists
__module_find module_find
module_get_help module_get_help
__module_GetModulesNamesForCapability __module_GetModulesNamesForCapability
module_get_name module_get_name
......
...@@ -663,7 +663,7 @@ void __module_unneed( vlc_object_t * p_this, module_t * p_module ) ...@@ -663,7 +663,7 @@ void __module_unneed( vlc_object_t * p_this, module_t * p_module )
* \param psz_name the name of the module * \param psz_name the name of the module
* \return a pointer to the module or NULL in case of a failure * \return a pointer to the module or NULL in case of a failure
*/ */
module_t *__module_find( vlc_object_t *p_this, const char * psz_name ) module_t *module_find( const char * psz_name )
{ {
module_t **list, *module; module_t **list, *module;
...@@ -692,9 +692,9 @@ module_t *__module_find( vlc_object_t *p_this, const char * psz_name ) ...@@ -692,9 +692,9 @@ module_t *__module_find( vlc_object_t *p_this, const char * psz_name )
* \param psz_name th name of the module * \param psz_name th name of the module
* \return TRUE if the module exists * \return TRUE if the module exists
*/ */
bool __module_exists( vlc_object_t *p_this, const char * psz_name ) bool module_exists (const char * psz_name)
{ {
module_t *p_module = __module_find( p_this, psz_name ); module_t *p_module = module_find (psz_name);
if( p_module ) if( p_module )
module_release (p_module); module_release (p_module);
return p_module != NULL; return p_module != NULL;
......
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