VLC 4.0.0-dev
bank.c File Reference
Include dependency graph for bank.c:

Data Structures

struct  vlc_modcap
 

Typedefs

typedef struct vlc_modcap vlc_modcap_t
 

Functions

int() vlc_entry__core (vlc_set_cb, void *)
 Core module. More...
 
static int vlc_modcap_cmp (const void *a, const void *b)
 
static void vlc_modcap_free (void *data)
 
static int vlc_module_cmp (const void *a, const void *b)
 
static void vlc_modcap_sort (const void *node, const VISIT which, const int depth)
 
static int vlc_module_store (module_t *mod)
 Adds a module to the bank. More...
 
static void vlc_plugin_store (vlc_plugin_t *lib)
 Adds a plugin (and all its modules) to the bank. More...
 
static vlc_plugin_tmodule_InitStatic (vlc_plugin_cb entry)
 Registers a statically-linked plug-in. More...
 
static void module_InitStaticModules (void)
 
int vlc_plugin_Map (struct vlc_logger *log, vlc_plugin_t *plugin)
 
static void vlc_plugin_Unmap (vlc_plugin_t *plugin)
 
void * vlc_plugin_Symbol (struct vlc_logger *log, vlc_plugin_t *plugin, const char *name)
 
void module_InitBank (void)
 Init bank. More...
 
void module_EndBank (bool b_plugins)
 Unloads all unused plugin modules and empties the module bank in case of success. More...
 
void module_LoadPlugins (libvlc_int_t *obj)
 Loads module descriptions for all available plugins. More...
 
void module_list_free (module_t **list)
 Frees a flat list of VLC modules. More...
 
module_t ** module_list_get (size_t *n)
 Gets the flat list of VLC modules. More...
 
size_t module_list_cap (module_t *const **restrict list, const char *name)
 

Variables

struct {
   vlc_mutex_t   lock
 
   block_t *   caches
 
   void *   caps_tree
 
   size_t   count
 
   unsigned   usage
 
modules = { { .value = ATOMIC_VAR_INIT(0), .recursion = ATOMIC_VAR_INIT(0), .owner = ATOMIC_VAR_INIT(0), } , NULL, NULL, 0, 0 }
 
vlc_plugin_tvlc_plugins = NULL
 List of all plug-ins. More...
 
const vlc_plugin_cb vlc_static_modules []
 

Typedef Documentation

◆ vlc_modcap_t

typedef struct vlc_modcap vlc_modcap_t

Function Documentation

◆ module_EndBank()

void module_EndBank ( bool  b_plugins)

◆ 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_MODULE_ENTRY, vlc_mutex_lock(), and vlc_plugin_store().

Referenced by libvlc_InternalInit().

◆ module_InitStatic()

static vlc_plugin_t * module_InitStatic ( vlc_plugin_cb  entry)
static

Registers a statically-linked plug-in.

References unlikely, and vlc_plugin_describe().

Referenced by module_InitBank(), and module_InitStaticModules().

◆ module_InitStaticModules()

static void module_InitStaticModules ( void  )
static

◆ module_list_cap()

size_t module_list_cap ( module_t *const **restrict  list,
const char *  name 
)

◆ module_list_free()

void module_list_free ( module_t **  list)

Frees a flat list of VLC modules.

Parameters
listlist obtained by module_list_get()

References list.

Referenced by ListModules(), and module_find().

◆ module_list_get()

module_t ** module_list_get ( size_t *  n)

Gets the flat list of VLC modules.

Parameters
n[OUT] pointer to the number of modules
Returns
table of module pointers (release with module_list_free()), or NULL in case of error (in that case, *n is zeroed).

References modules, vlc_plugin_t::next, module_t::next, unlikely, and vlc_plugins.

Referenced by ListModules(), and module_find().

◆ module_LoadPlugins()

void module_LoadPlugins ( libvlc_int_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(), module_InitStaticModules(), modules, msg_Dbg, twalk(), vlc_modcap_sort(), and vlc_mutex_unlock().

Referenced by libvlc_InternalInit().

◆ vlc_entry__core()

int() vlc_entry__core ( vlc_set_cb  vlc_set,
void *  opaque 
)

Core module.

◆ vlc_modcap_cmp()

static int vlc_modcap_cmp ( const void *  a,
const void *  b 
)
static

References vlc_modcap::name.

Referenced by module_list_cap(), and vlc_module_store().

◆ vlc_modcap_free()

static void vlc_modcap_free ( void *  data)
static

◆ vlc_modcap_sort()

static void vlc_modcap_sort ( const void *  node,
const VISIT  which,
const int  depth 
)
static

References leaf, postorder, and vlc_module_cmp().

Referenced by module_LoadPlugins().

◆ vlc_module_cmp()

static int vlc_module_cmp ( const void *  a,
const void *  b 
)
static

References module_t::i_score.

Referenced by vlc_modcap_sort().

◆ vlc_module_store()

static int vlc_module_store ( module_t mod)
static

◆ vlc_plugin_Map()

int vlc_plugin_Map ( struct vlc_logger log,
vlc_plugin_t plugin 
)

Referenced by vlc_module_map().

◆ vlc_plugin_store()

static void vlc_plugin_store ( vlc_plugin_t lib)
static

◆ vlc_plugin_Symbol()

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

References name.

Referenced by config_GetIntChoices(), and config_GetPszChoices().

◆ vlc_plugin_Unmap()

static void vlc_plugin_Unmap ( vlc_plugin_t plugin)
static

Referenced by module_EndBank().

Variable Documentation

◆ caches

block_t* caches

Referenced by module_EndBank().

◆ caps_tree

void* caps_tree

Referenced by module_EndBank().

◆ count

size_t count

◆ lock

◆ 

◆ usage

unsigned usage

◆ vlc_plugins

◆ vlc_static_modules

const vlc_plugin_cb vlc_static_modules[]
extern