if test "x${enable_svgalib}" = "xyes"
then
- BUILTINS="${BUILTINS} video_output/svgalib"
+ PLUGINS="${PLUGINS} video_output/svgalib"
svgalib_LDFLAGS="${svgalib_LDFLAGS} -lvgagl -lvga"
fi
[ --enable-svgalib SVGAlib support (default disabled)])
if test "x${enable_svgalib}" = "xyes"
then
- BUILTINS="${BUILTINS} video_output/svgalib"
+ PLUGINS="${PLUGINS} video_output/svgalib"
svgalib_LDFLAGS="${svgalib_LDFLAGS} -lvgagl -lvga"
fi
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.60 2002/08/15 12:11:15 sam Exp $
+ * $Id: modules.h,v 1.61 2002/08/21 17:31:58 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
int i_score; /* Score for each capability */
u32 i_cpu; /* Required CPU capabilities */
+ vlc_bool_t b_unloadable; /* Can we be dlclosed? */
+ vlc_bool_t b_reentrant; /* Are we reentrant? */
vlc_bool_t b_submodule; /* Is this a submodule? */
/* Callbacks */
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_inner.h,v 1.30 2002/08/14 17:06:53 sam Exp $
+ * $Id: modules_inner.h,v 1.31 2002/08/21 17:31:58 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
module_config_t p_config[ 100 ]; \
STORE_SYMBOLS; \
p_module->b_submodule = VLC_FALSE; \
+ p_module->b_unloadable = VLC_TRUE; \
+ p_module->b_reentrant = VLC_TRUE; \
p_module->psz_object_name = MODULE_STRING; \
p_module->psz_longname = MODULE_STRING; \
p_module->pp_shortcuts[ 0 ] = MODULE_STRING; \
i_shortcut++
#define set_description( desc ) \
- p_module->psz_longname = desc
+ p_submodule->psz_longname = desc
#define set_capability( cap, score ) \
p_submodule->psz_capability = cap; \
p_submodule->pf_activate = activate; \
p_submodule->pf_deactivate = deactivate
+#define linked_with_a_crap_library_which_uses_atexit( ) \
+ p_module->b_unloadable = VLC_FALSE
+
/*
* module_activate: this function is called before functions can be accessed,
* we do allocation tasks here, and maybe additional stuff such as large
* gtk_main.c : Gtk+ wrapper for gtk_main
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: gtk_main.c,v 1.3 2002/08/21 15:55:15 sam Exp $
+ * $Id: gtk_main.c,v 1.4 2002/08/21 17:31:58 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
{
VLC_COMMON_MEMBERS
- /* XXX: Ugly kludge, see g_atexit */
- void ( *pf_callback[MAX_ATEXIT] ) ( void );
-
} gtk_main_t;
/*****************************************************************************
* Local variables (mutex-protected).
*****************************************************************************/
-static void ** pp_global_data = NULL;
static int i_refcount = 0;
static gtk_main_t * p_gtk_main = NULL;
* Module descriptor
*****************************************************************************/
vlc_module_begin();
- pp_global_data = p_module->p_vlc->pp_global_data;
set_description( _("Gtk+ helper module") );
set_capability( "gtk_main", 100 );
add_shortcut( "gtk" );
add_shortcut( "gnome" );
#endif
set_callbacks( Open, Close );
+ linked_with_a_crap_library_which_uses_atexit();
vlc_module_end();
-/*****************************************************************************
- * g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
- *****************************************************************************
- * gtk_init() makes several calls to g_atexit() which calls atexit() to
- * register tidying callbacks to be called at program exit. Since the Gtk+
- * plugin is likely to be unloaded at program exit, we have to export this
- * symbol to intercept the g_atexit() calls. Talk about crude hack.
- *****************************************************************************/
-void g_atexit( GVoidFunc func )
-{
- gtk_main_t *p_this;
-
- int i_dummy;
-
- if( pp_global_data == NULL )
- {
- atexit( func );
- return;
- }
-
- p_this = (gtk_main_t *)*pp_global_data;
- if( p_this == NULL )
- {
- /* Looks like this atexit() call wasn't for us. */
- return;
- }
-
- for( i_dummy = 0;
- i_dummy < MAX_ATEXIT && p_this->pf_callback[i_dummy] != NULL;
- i_dummy++ )
- {
- ;
- }
-
- if( i_dummy >= MAX_ATEXIT - 1 )
- {
- msg_Err( p_this, "too many atexit() callbacks to register" );
- return;
- }
-
- p_this->pf_callback[i_dummy] = func;
- p_this->pf_callback[i_dummy + 1] = NULL;
-}
-
/*****************************************************************************
* Open: initialize and create window
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
- /* Initialize Gtk+ */
-
vlc_mutex_lock( p_this->p_vlc->p_global_lock );
if( i_refcount > 0 )
}
p_gtk_main = vlc_object_create( p_this, sizeof(gtk_main_t) );
- p_gtk_main->pf_callback[0] = NULL;
/* Only initialize gthreads if it's the first time we do it */
if( !g_thread_supported() )
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
- int i_dummy;
-
vlc_mutex_lock( p_this->p_vlc->p_global_lock );
i_refcount--;
gtk_main_quit();
vlc_thread_join( p_gtk_main );
- /* Launch stored callbacks */
- for( i_dummy = 0;
- i_dummy < MAX_ATEXIT && p_gtk_main->pf_callback[i_dummy] != NULL;
- i_dummy++ )
- {
- p_gtk_main->pf_callback[i_dummy]();
- }
-
vlc_object_destroy( p_gtk_main );
p_gtk_main = NULL;
#endif
static int i_args = 1;
- /* gtk_init will register stuff with g_atexit, so we need to have
- * the global lock if we want to be able to intercept the calls */
- *p_this->p_vlc->pp_global_data = p_gtk_main;
-
/* FIXME: deprecated ? */
/* gdk_threads_init(); */
* svgalib.c : SVGAlib plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: svgalib.c,v 1.1 2002/08/21 15:10:33 sam Exp $
+ * $Id: svgalib.c,v 1.2 2002/08/21 17:31:58 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
set_description( _("SVGAlib module") );
set_capability( "video output", 0 );
set_callbacks( Create, Destroy );
+ linked_with_a_crap_library_which_uses_atexit();
vlc_module_end();
/*****************************************************************************
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.91 2002/08/21 11:07:42 xav Exp $
+ * $Id: modules.c,v 1.92 2002/08/21 17:31:58 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
#ifdef HAVE_DYNAMIC_PLUGINS
if( !p_module->b_builtin )
{
- module_unload( p_module->handle );
+ if( p_module->b_unloadable )
+ {
+ module_unload( p_module->handle );
+ }
UndupModule( p_module );
free( p_module->psz_filename );
free( p_module->psz_longname );