]> git.sesse.net Git - vlc/blobdiff - src/misc/plugins.c
Portage du client sous BeOS. Il manque encore l'audio mais �a marche.
[vlc] / src / misc / plugins.c
index 77f71e015520d40c5e7f25866930a01c1eb1dc73..40e16b18eb17b785d8491dd97fd45e9d9dac5b96 100644 (file)
 #error no dynamic plugins available on your system !
 #endif
 
+#ifdef SYS_BEOS
+#include "beos_specific.h"
+#endif
+
 #include "plugins.h"
 
 #define PLUGIN_PATH_COUNT 5
@@ -45,23 +49,30 @@ int RequestPlugin ( plugin_id_t * p_plugin, char * psz_mask, char * psz_name )
     char * psz_plugin;
     char * psz_plugin_path[ PLUGIN_PATH_COUNT ] =
     {
-        ".", PLUGIN_PATH,
-        "plugins/aout", "plugins/vout", "plugins/intf" /* these ones should disappear */
+        ".",
+        "plugins/aout", "plugins/vout", "plugins/intf", /* these ones should disappear */
+        PLUGIN_PATH
     };
 
     i_length = strlen( psz_mask ) + strlen( psz_name );
 
     for ( i_count = 0 ; i_count < PLUGIN_PATH_COUNT ; i_count++ )
     {
+#ifdef SYS_BEOS
+        char * psz_program_path;
+        
+        psz_program_path = beos_GetProgramPath();
+        psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + strlen(psz_program_path) + i_length + 6 );
+        sprintf( psz_plugin, "%s/%s/%s_%s.so", psz_program_path, psz_plugin_path[i_count], psz_mask, psz_name );        
+#else
         psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + i_length + 6 );
         sprintf( psz_plugin, "%s/%s_%s.so", psz_plugin_path[i_count], psz_mask, psz_name );
+#endif
 
 #if defined(HAVE_DLFCN_H)
         *p_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
-
 #elif defined(HAVE_IMAGE_H)
-        *p_plugin = load_addon_image( psz_plugin );
-
+        *p_plugin = load_add_on( psz_plugin );
 #endif
 
         free( psz_plugin );
@@ -69,11 +80,9 @@ int RequestPlugin ( plugin_id_t * p_plugin, char * psz_mask, char * psz_name )
 #if defined(HAVE_DLFCN_H)
        if( *p_plugin != NULL )
             return( 0 );
-
 #elif defined(HAVE_IMAGE_H)
         if( *p_plugin >= 0 )
             return( 0 );
-
 #endif
     }
 
@@ -84,10 +93,8 @@ void TrashPlugin ( plugin_id_t plugin )
 {
 #if defined(HAVE_DLFCN_H)
     dlclose( plugin );
-
 #elif defined(HAVE_IMAGE_H)
     unload_add_on( plugin );
-
 #endif
 }
 
@@ -95,15 +102,12 @@ void * GetPluginFunction ( plugin_id_t plugin, char *psz_name )
 {
 #if defined(HAVE_DLFCN_H)
     return( dlsym(plugin, psz_name) );
-
 #elif defined(HAVE_IMAGE_H)
-    void * p_func;
-    
+    void * p_func;   
     if( get_image_symbol( plugin, psz_name, B_SYMBOL_TYPE_TEXT, &p_func ) )
         return( NULL );
     else
         return( p_func );    
-
 #endif
 }