VLC  4.0.0-dev
Data Structures | Macros | Typedefs | Functions | Variables
modules.h File Reference
Include dependency graph for modules.h:

Go to the source code of this file.

Data Structures

struct  vlc_plugin_t
 VLC plugin. More...
 
struct  module_t
 Internal module descriptor. More...
 

Macros

#define MODULE_SHORTCUT_MAX   20
 
#define module_LoadPlugins(a)   module_LoadPlugins(VLC_OBJECT(a))
 

Typedefs

typedef struct vlc_plugin_t vlc_plugin_t
 VLC plugin. More...
 
typedef int(* vlc_plugin_cb) (int(*) (void *, void *, int,...), void *)
 Plugin entry point prototype. More...
 
typedef void(* vlc_deactivate_cb) (vlc_object_t *)
 Plugin deactivation callback. More...
 

Functions

int vlc_entry__core (int(*)(void *, void *, int,...), void *)
 Core module. More...
 
vlc_plugin_tvlc_plugin_create (void)
 
void vlc_plugin_destroy (vlc_plugin_t *)
 Destroys a plug-in. More...
 
module_tvlc_module_create (vlc_plugin_t *)
 
void vlc_module_destroy (module_t *)
 Destroys a module. More...
 
vlc_plugin_tvlc_plugin_describe (vlc_plugin_cb)
 Runs a plug-in descriptor. More...
 
int vlc_plugin_resolve (vlc_plugin_t *, vlc_plugin_cb)
 
void module_InitBank (void)
 Init bank. More...
 
void module_LoadPlugins (vlc_object_t *)
 Loads module descriptions for all available plugins. More...
 
void module_EndBank (bool)
 Unloads all unused plugin modules and empties the module bank in case of success. More...
 
int vlc_plugin_Map (struct vlc_logger *, vlc_plugin_t *)
 
void * vlc_plugin_Symbol (struct vlc_logger *, vlc_plugin_t *, const char *name)
 
size_t module_list_cap (module_t *const **, const char *)
 Lists of all VLC modules with a given capability. More...
 
int vlc_bindtextdomain (const char *)
 
void * vlc_dlopen (const char *path, bool) VLC_USED
 Loads a dynamically linked library. More...
 
int vlc_dlclose (void *)
 Unloads a dynamic library. More...
 
void * vlc_dlsym (void *handle, const char *) VLC_USED
 Looks up a symbol from a dynamically loaded library. More...
 
char * vlc_dlerror (void) VLC_USED
 Formats an error message for vlc_dlopen() or vlc_dlsym(). More...
 
vlc_plugin_tvlc_cache_load (vlc_object_t *, const char *, block_t **)
 
vlc_plugin_tvlc_cache_lookup (vlc_plugin_t **, const char *relpath)
 
void CacheSave (vlc_object_t *, const char *, vlc_plugin_t *const *, size_t)
 

Variables

struct vlc_plugin_tvlc_plugins
 List of all plug-ins. More...
 

Macro Definition Documentation

◆ module_LoadPlugins

#define module_LoadPlugins (   a)    module_LoadPlugins(VLC_OBJECT(a))

◆ MODULE_SHORTCUT_MAX

#define MODULE_SHORTCUT_MAX   20

Typedef Documentation

◆ vlc_deactivate_cb

typedef void(* vlc_deactivate_cb) (vlc_object_t *)

Plugin deactivation callback.

◆ vlc_plugin_cb

typedef int(* vlc_plugin_cb) (int(*)(void *, void *, int,...), void *)

Plugin entry point prototype.

◆ vlc_plugin_t

typedef struct vlc_plugin_t vlc_plugin_t

VLC plugin.

Function Documentation

◆ CacheSave()

void CacheSave ( vlc_object_t ,
const char *  ,
vlc_plugin_t *const *  ,
size_t   
)

◆ module_EndBank()

void module_EndBank ( bool  )

◆ module_InitBank()

void module_InitBank ( void  )

Init bank.

Creates a module bank structure which will be filled later on with all the modules found.

References config_SortConfig(), likely, module_InitStatic(), modules, vlc_entry__core(), vlc_mutex_lock(), and vlc_plugin_store().

Referenced by libvlc_InternalInit().

◆ module_list_cap()

size_t module_list_cap ( module_t *const **  ,
const char *   
)

Lists of all VLC modules with a given capability.

The list is sorted by decreasing module score.

Parameters
listpointer to the table of modules [OUT]
namename of capability of modules to look for
Returns
the number of modules in the list (possibly zero)

◆ module_LoadPlugins()

void module_LoadPlugins ( vlc_object_t obj)

Loads module descriptions for all available plugins.

Fills the module bank structure with the plugin modules.

Parameters
p_thisvlc object structure

References config_SortConfig(), config_UnsortConfig(), count, list, module_InitStaticModules(), module_list_free(), module_list_get(), modules, msg_Dbg, twalk(), vlc_modcap_sort(), and vlc_mutex_unlock().

◆ vlc_bindtextdomain()

int vlc_bindtextdomain ( const char *  )

◆ vlc_cache_load()

vlc_plugin_t* vlc_cache_load ( vlc_object_t ,
const char *  ,
block_t **   
)

◆ vlc_cache_lookup()

vlc_plugin_t* vlc_cache_lookup ( vlc_plugin_t **  ,
const char *  relpath 
)

◆ vlc_dlclose()

int vlc_dlclose ( void *  )

Unloads a dynamic library.

This function unloads a previously opened dynamically linked library using a system dependent method.

Parameters
handlehandle of the library
Return values
0on success
-1on error (none are defined though)

◆ vlc_dlerror()

char* vlc_dlerror ( void  )

Formats an error message for vlc_dlopen() or vlc_dlsym().

Returns
a heap-allocated nul-terminated error string, or NULL.

References FromLocaleDup, and strdup().

◆ vlc_dlopen()

void* vlc_dlopen ( const char *  path,
bool   
)

Loads a dynamically linked library.

Parameters
pathlibrary file path
lazywhether to resolve the symbols lazily
Returns
a module handle on success, or NULL on error.

References ToLocaleDup, unlikely, and VLC_UNUSED.

◆ vlc_dlsym()

void* vlc_dlsym ( void *  handle,
const char *   
)

Looks up a symbol from a dynamically loaded library.

This function looks for a named symbol within a loaded library.

Parameters
handlehandle to the library
namefunction name
Returns
the address of the symbol on success, or NULL on error
Note
If the symbol address is NULL, errors cannot be detected. However, normal symbols such as function or global variables cannot have NULL as their address.

References name.

◆ vlc_entry__core()

int vlc_entry__core ( int(*)(void *, void *, int,...)  ,
void *   
)

Core module.

Referenced by module_InitBank().

◆ vlc_module_create()

module_t* vlc_module_create ( vlc_plugin_t )

◆ vlc_module_destroy()

void vlc_module_destroy ( module_t )

Destroys a module.

References module_t::next, and module_t::pp_shortcuts.

Referenced by vlc_plugin_destroy().

◆ vlc_plugin_create()

vlc_plugin_t* vlc_plugin_create ( void  )

◆ vlc_plugin_describe()

vlc_plugin_t* vlc_plugin_describe ( vlc_plugin_cb  entry)

Runs a plug-in descriptor.

This loads the plug-in meta-data in memory.

References unlikely, vlc_plugin_create(), vlc_plugin_desc_cb(), and vlc_plugin_destroy().

Referenced by module_InitStatic().

◆ vlc_plugin_destroy()

void vlc_plugin_destroy ( vlc_plugin_t plugin)

Destroys a plug-in.

Warning
If the plug-in was dynamically loaded in memory, the library handle and associated memory mappings and linker resources will be leaked.

References vlc_plugin_t::conf, config_Free(), vlc_plugin_t::items, vlc_plugin_t::module, vlc_plugin_t::size, and vlc_module_destroy().

Referenced by module_EndBank(), and vlc_plugin_describe().

◆ vlc_plugin_Map()

int vlc_plugin_Map ( struct vlc_logger ,
vlc_plugin_t  
)

Referenced by vlc_module_map().

◆ vlc_plugin_resolve()

int vlc_plugin_resolve ( vlc_plugin_t ,
vlc_plugin_cb   
)

◆ vlc_plugin_Symbol()

void* vlc_plugin_Symbol ( struct vlc_logger ,
vlc_plugin_t ,
const char *  name 
)

References name.

Referenced by config_GetIntChoices(), and config_GetPszChoices().

Variable Documentation

◆ vlc_plugins

struct vlc_plugin_t* vlc_plugins