]> git.sesse.net Git - vlc/commitdiff
module_find, module_exists, module_get_main: remove useless paramter
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 5 Oct 2008 13:11:34 +0000 (16:11 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 5 Oct 2008 13:43:37 +0000 (16:43 +0300)
14 files changed:
include/vlc_modules.h
modules/codec/mpeg_audio.c
modules/codec/subtitles/subsusf.c
modules/gui/macosx/simple_prefs.m
modules/gui/qt4/components/complete_preferences.cpp
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/dialogs/extended.cpp
modules/gui/wxwidgets/dialogs/open.cpp
src/audio_output/input.c
src/libvlccore.sym
src/modules/modules.c

index 4e6cfdafeaa87cfb1b341a6011ee774400013b1c..bd00200213bf6865c9dc2de26423b44db212bb18 100644 (file)
 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)
 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, ( vlc_object_t *, 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( bool,  module_exists, (const char *) );
+VLC_EXPORT( module_t *, module_find, (const char *) );
 
 VLC_EXPORT( module_config_t *, module_config_get, ( const module_t *, unsigned * ) );
 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 )
 #define module_GetLongName( m ) module_get_name( m, true )
 VLC_EXPORT( const char *, module_get_help, ( const module_t *m ) );
 
-
-#define module_get_main(a) __module_get_main(VLC_OBJECT(a))
-static inline module_t * __module_get_main( vlc_object_t * p_this )
+static inline module_t *module_get_main (void)
 {
-    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 )
 {
index e5e55f490374c3b52ded734e945d5642f043004d..8a60f164b319ff4aa8bbd2554cb2af1ccc781202 100644 (file)
@@ -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 */
     if( p_dec->i_object_type == VLC_OBJECT_DECODER &&
-        !module_exists( p_this, "mpgatofixed32" ) )
+        !module_exists( "mpgatofixed32" ) )
     {
         return VLC_EGENERIC;
     }
index 945ed09e1853e002f8d7d5197e4e5d628c3f747f..d300ac042cd3e39f0798f1709c43bb7a4a6bb846 100644 (file)
@@ -517,7 +517,7 @@ static int ParseImageAttachments( decoder_t *p_dec )
                     fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
 
                     /* 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
                          * not all of them), so use sdl_image if it is available */
index 10f2ea1f6bd250deb7d445c610d4b8e543f329fe..42ebc42c248c5bbaa15522ff6b8e0076dc0f8697 100644 (file)
@@ -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"];
 
     /* 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_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
     int i_cache = config_GetInt( p_intf, "file-caching");
     
     TestCaC( "udp-caching" );
-    if( module_exists (p_intf, "dvdread") )
+    if( module_exists ("dvdread") )
         TestCaC( "dvdread-caching" );
-    if( module_exists (p_intf, "dvdnav") )
+    if( module_exists ("dvdnav") )
         TestCaC( "dvdnav-caching" );
     TestCaC( "tcp-caching" );
     TestCaC( "fake-caching" );
@@ -550,7 +550,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
     TestCaCi( "rtsp-caching", 4 );
     TestCaCi( "ftp-caching", 2 );
     TestCaCi( "http-caching", 4 );
-    if(module_exists (p_intf, "access_realrtsp"))
+    if(module_exists ("access_realrtsp"))
         TestCaCi( "realrtsp-caching", 10 );
     TestCaCi( "mms-caching", 19 );
     if( b_cache_equal )
@@ -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" );
 
         /* Last.FM is optional */
-        if( module_exists( p_intf, "audioscrobbler" ) )
+        if( module_exists( "audioscrobbler" ) )
         {   
             [o_audio_last_ckb setEnabled: YES];
             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
         #define CaC( name ) CaCi( name, 1 )
         msg_Dbg( p_intf, "Adjusting all cache values to: %i", [[o_input_cachelevel_pop selectedItem] tag] );
         CaC( "udp-caching" );
-        if( module_exists (p_intf, "dvdread" ) )
+        if( module_exists ( "dvdread" ) )
         {
             CaC( "dvdread-caching" );
             i = i + config_SaveConfigFile( p_intf, "dvdread" );
         }
-        if( module_exists (p_intf, "dvdnav" ) )
+        if( module_exists ( "dvdnav" ) )
         {
             CaC( "dvdnav-caching" );
             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
         CaC( "screen-caching" );
         CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 );
         CaCi( "http-caching", 4 );
-        if( module_exists (p_intf, "access_realrtsp" ) )
+        if( module_exists ( "access_realrtsp" ) )
         {
             CaCi( "realrtsp-caching", 10 );
             i = i + config_SaveConfigFile( p_intf, "access_realrtsp" );
index 64416ee567c4e2ad917bda00eda5f5d82d4a39e9..b34a14ef0d2842c133f5db7a72afc5774d3cade0 100644 (file)
@@ -75,7 +75,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
 #undef BI
 
     /* 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 */
     PrefsItemData *data = NULL;
@@ -354,10 +354,10 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     if( data->i_type == TYPE_CATEGORY )
         return;
     else if( data->i_type == TYPE_MODULE )
-        p_module = module_find( p_intf, data->psz_name );
+        p_module = module_find( data->psz_name );
     else
     {
-        p_module = module_get_main( p_intf );
+        p_module = module_get_main();
         assert( p_module );
     }
 
index 033b2f7932d1cc59324e2b70cab36fe86187c16d..9a7d2c043eff8bc8efbb852a7d59371ea0187e0e 100644 (file)
@@ -251,7 +251,7 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
     char *psz_parser, *psz_string;
     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 )
     {
         msg_Err( p_intf, "Unable to find filter module \"%s\n.", psz_name );
index 804b8ad0d09467fcd94dd9dff2ea3104b4658143..a3b100ec5836fd7066c1be755834d60123cfd9e7 100644 (file)
@@ -596,7 +596,7 @@ void CaptureOpenPanel::initialize()
     /*********************
      * DirectShow Stuffs *
      *********************/
-    if( module_exists( p_intf, "dshow" ) ){
+    if( module_exists( "dshow" ) ){
     addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
 
     /* dshow Main */
@@ -630,7 +630,7 @@ void CaptureOpenPanel::initialize()
     /**************
      * BDA Stuffs *
      **************/
-    if( module_exists( p_intf, "bda" ) ){
+    if( module_exists( "bda" ) ){
     addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" );
 
     /* bda Main */
@@ -695,7 +695,7 @@ void CaptureOpenPanel::initialize()
     /*******
      * V4L2*
      *******/
-    if( module_exists( p_intf, "v4l2" ) ){
+    if( module_exists( "v4l2" ) ){
     addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" );
 
     /* V4l Main panel */
@@ -730,7 +730,7 @@ void CaptureOpenPanel::initialize()
     /*******
      * V4L *
      *******/
-    if( module_exists( p_intf, "v4l" ) ){
+    if( module_exists( "v4l" ) ){
     addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
 
     /* V4l Main panel */
@@ -775,7 +775,7 @@ void CaptureOpenPanel::initialize()
     /*******
      * JACK *
      *******/
-    if( module_exists( p_intf, "jack" ) ){
+    if( module_exists( "jack" ) ){
     addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" );
 
     /* Jack Main panel */
@@ -829,7 +829,7 @@ void CaptureOpenPanel::initialize()
     /************
      * PVR      *
      ************/
-    if( module_exists( p_intf, "pvr" ) ){
+    if( module_exists( "pvr" ) ){
     addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
 
     /* PVR Main panel */
@@ -885,7 +885,7 @@ void CaptureOpenPanel::initialize()
     /**************
      * DVB Stuffs *
      **************/
-    if( module_exists( p_intf, "dvb" ) ){
+    if( module_exists( "dvb" ) ){
     addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
 
     /* DVB Main */
@@ -1122,7 +1122,7 @@ void CaptureOpenPanel::advancedDialog()
 
     /* Get the corresponding 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;
 
     /* Init */
index 588a6a909641e18c12d4db033fd5f597d3649e88..5d8e3b849e4d3dec06b89ee63c7e7a19dc332dd7 100644 (file)
@@ -1155,7 +1155,7 @@ void KeySelectorControl::finish()
     table->setAlternatingRowColors( true );
 
     /* Get the main Module */
-    module_t *p_main = module_find( p_this, "main" );
+    module_t *p_main = module_get_main();
     assert( p_main );
 
     /* Access to the module_config_t */
index ca5bf1082bc91051111a5780608c7393ef831da8..3cfb8f40e7b29c7e43d3acb9583703538b0a4019 100644 (file)
@@ -254,7 +254,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_GENERIC2( "directx-audio-device", IntegerList,
                     DirectXLabel, DirectXDevice );
 #else
-            if( module_exists( p_intf, "alsa" ) )
+            if( module_exists( "alsa" ) )
             {
                 audioControl( alsa );
                 optionWidgets.append( alsaControl );
@@ -264,7 +264,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             }
             else
                 optionWidgets.append( NULL );
-            if( module_exists( p_intf, "oss" ) )
+            if( module_exists( "oss" ) )
             {
                 audioControl2( OSS );
                 optionWidgets.append( OSSControl );
@@ -316,7 +316,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             updateAudioOptions( ui.outputModule->currentIndex() );
 
             /* LastFM */
-            if( module_exists( p_intf, "audioscrobbler" ) )
+            if( module_exists( "audioscrobbler" ) )
             {
                 CONFIG_GENERIC( "lastfm-username", String, ui.lastfm_user_label,
                         lastfm_user_edit );
@@ -422,9 +422,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             int i_cache = config_GetInt( p_intf, "file-caching");
 
             TestCaC( "udp-caching" );
-            if (module_exists (p_intf, "dvdread"))
+            if (module_exists ("dvdread"))
                 TestCaC( "dvdread-caching" );
-            if (module_exists (p_intf, "dvdnav"))
+            if (module_exists ("dvdnav"))
                 TestCaC( "dvdnav-caching" );
             TestCaC( "tcp-caching" );
             TestCaC( "fake-caching" ); TestCaC( "cdda-caching" );
@@ -432,18 +432,18 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             #ifdef WIN32
             TestCaC( "dshow-caching" );
             #else
-            if (module_exists (p_intf, "v4l"))
+            if (module_exists ("v4l"))
                 TestCaC( "v4l-caching" );
-            if (module_exists (p_intf, "access_jack"))
+            if (module_exists ("access_jack"))
                 TestCaC( "jack-input-caching" );
-            if (module_exists (p_intf, "v4l2"))
+            if (module_exists ("v4l2"))
                 TestCaC( "v4l2-caching" );
-            if (module_exists (p_intf, "pvr"))
+            if (module_exists ("pvr"))
                 TestCaC( "pvr-caching" );
             #endif
             TestCaCi( "rtsp-caching", 4 ); TestCaCi( "ftp-caching", 2 );
             TestCaCi( "http-caching", 4 );
-            if (module_exists (p_intf, "access_realrtsp"))
+            if (module_exists ("access_realrtsp"))
                 TestCaCi( "realrtsp-caching", 10 );
             TestCaCi( "mms-caching", 19 );
             if( b_cache_equal ) ui.cachingCombo->setCurrentIndex(
@@ -634,28 +634,28 @@ void SPrefsPanel::apply()
         if( i_comboValue )
         {
             CaC( "udp-caching" );
-            if (module_exists (p_intf, "dvdread" ))
+            if (module_exists ("dvdread" ))
                 CaC( "dvdread-caching" );
-            if (module_exists (p_intf, "dvdnav" ))
+            if (module_exists ("dvdnav" ))
                 CaC( "dvdnav-caching" );
             CaC( "tcp-caching" ); CaC( "vcd-caching" );
             CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" );
             CaC( "screen-caching" );
             CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 );
             CaCi( "http-caching", 4 );
-            if (module_exists (p_intf, "access_realrtsp" ))
+            if (module_exists ("access_realrtsp" ))
                 CaCi( "realrtsp-caching", 10 );
             CaCi( "mms-caching", 19 );
             #ifdef WIN32
             CaC( "dshow-caching" );
             #else
-            if (module_exists (p_intf, "v4l" ))
+            if (module_exists ( "v4l" ))
                 CaC( "v4l-caching" );
-            if (module_exists (p_intf, "access_jack" ))
+            if (module_exists ( "access_jack" ))
             CaC( "jack-input-caching" );
-            if (module_exists (p_intf, "v4l2" ))
+            if (module_exists ( "v4l2" ))
                 CaC( "v4l2-caching" );
-            if (module_exists (p_intf, "pvr" ))
+            if (module_exists ( "pvr" ))
                 CaC( "pvr-caching" );
             #endif
             //CaCi( "dv-caching" ) too short...
index 3cb89670cd5e58ddf4ac5170685229b27f86d4e8..476bdc3c4d70e6495fef0b65ea1845a8f243a760 100644 (file)
@@ -76,7 +76,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     syncW = new SyncControls( p_intf, videoTab );
     mainTabW->addTab( syncW, qtr( "Synchronization" ) );
 
-    if( module_exists( p_intf, "v4l2" ) )
+    if( module_exists( "v4l2" ) )
     {
         ExtV4l2 *v4l2 = new ExtV4l2( p_intf, mainTabW );
         mainTabW->addTab( v4l2, qtr( "v4l2 controls" ) );
index fdcf87db7513f9c8a57ca6e392f8c1e36d09f931..679f1aadea332299e0c27d5336ae693f53a43f5d 100644 (file)
@@ -507,48 +507,40 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     notebook->AddPage( NetPanel( notebook ), wxU(_("Network")),
                        i_access_method == NET_ACCESS );
 
-    module_t *p_module = module_find( VLC_OBJECT(p_intf), "v4l" );
-    if( p_module )
+    if( module_exists( "v4l" ) )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
         notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
-        module_release (p_module);
     }
 
-    p_module = module_find( VLC_OBJECT(p_intf), "pvr" );
-    if( p_module )
+    if( module_exists( "pvr" ) )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
         notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
-        module_release (p_module);
     }
 
-    p_module = module_find( VLC_OBJECT(p_intf), "dvb" );
-    if( p_module )
+    if( module_exists( "dvb" ) )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
         notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
-        module_release (p_module);
     }
 
-    p_module = module_find( VLC_OBJECT(p_intf), "dshow" );
-    if( p_module )
+    if( module_exists( "dshow" ) )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
         notebook->AddPage( autopanel, wxU( module_get_name(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
-        module_release (p_module);
     }
 
     /* Update Disc panel */
index 25516b6f0704aa4ea55823c9a1d05cc6cb46220c..747842cfb2196fc4d645e04aba85413e5df3d543 100644 (file)
@@ -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 );
 
         /* 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";
             var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text );
         }
 
         /* 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";
             var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text );
index badcf07d780db23a8f4d8c790902749c88c1fd10..7f050db84a43d3419ea0721af2713d9434182343 100644 (file)
@@ -207,8 +207,8 @@ LocaleFree
 mdate
 module_config_free
 module_config_get
-__module_exists
-__module_find
+module_exists
+module_find
 module_get_help
 __module_GetModulesNamesForCapability
 module_get_name
index d8f82ae8c62610dc3ced7fa20b1922fbec0e49b3..413b7814f080cc3863fe645566ea6ac177044ebf 100644 (file)
@@ -663,7 +663,7 @@ void __module_unneed( vlc_object_t * p_this, module_t * p_module )
  * \param psz_name the name of the module
  * \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;
 
@@ -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
  * \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 )
         module_release (p_module);
     return p_module != NULL;