VLC  3.0.15
Functions
modules.c File Reference
Include dependency graph for modules.c:

Functions

bool module_provides (const module_t *m, const char *cap)
 Checks whether a module implements a capability. More...
 
const char * module_get_object (const module_t *m)
 Get the internal name of a module. More...
 
const char * module_get_name (const module_t *m, bool long_name)
 Get the human-friendly name of a module. More...
 
const char * module_get_help (const module_t *m)
 Get the help for a module. More...
 
const char * module_get_capability (const module_t *m)
 Gets the capability of a module. More...
 
int module_get_score (const module_t *m)
 Get the score for a module. More...
 
const char * module_gettext (const module_t *m, const char *str)
 Translate a string using the module's text domain. More...
 
int module_start (vlc_object_t *obj, const module_t *m)
 
void module_stop (vlc_object_t *obj, const module_t *m)
 
static bool module_match_name (const module_t *m, const char *name)
 
static int module_load (vlc_object_t *obj, module_t *m, vlc_activate_t init, va_list args)
 
module_tvlc_module_load (vlc_object_t *obj, const char *capability, const char *name, bool strict, vlc_activate_t probe,...)
 Finds and instantiates the best module of a certain type. More...
 
void vlc_module_unload (vlc_object_t *obj, module_t *module, vlc_deactivate_t deinit,...)
 Deinstantiates a module. More...
 
static int generic_start (void *func, va_list ap)
 
static void generic_stop (void *func, va_list ap)
 
module_tmodule_need (vlc_object_t *obj, const char *cap, const char *name, bool strict)
 
void module_unneed (vlc_object_t *obj, module_t *module)
 
module_tmodule_find (const char *name)
 Get a pointer to a module_t given it's name. More...
 
bool module_exists (const char *psz_name)
 Tell if a module exists. More...
 
module_config_tmodule_config_get (const module_t *module, unsigned *restrict psize)
 Get the configuration of a module. More...
 
void module_config_free (module_config_t *config)
 Release the configuration. More...
 

Function Documentation

◆ generic_start()

static int generic_start ( void *  func,
va_list  ap 
)
static

Referenced by module_need().

◆ generic_stop()

static void generic_stop ( void *  func,
va_list  ap 
)
static

Referenced by module_unneed().

◆ module_config_free()

void module_config_free ( module_config_t config)

Release the configuration.

Parameters
theconfiguration
Returns
nothing

References config.

◆ module_config_get()

module_config_t* module_config_get ( const module_t module,
unsigned *restrict  psize 
)

Get the configuration of a module.

Parameters
modulethe module
psizethe size of the configuration returned
Returns
the configuration as an array

References module_config_t::b_internal, module_config_t::b_removed, vlc_plugin_t::conf, config, vlc_plugin_t::items, vlc_plugin_t::module, module_t::plugin, vlc_plugin_t::size, and vlc_alloc().

◆ module_exists()

bool module_exists ( const char *  psz_name)

Tell if a module exists.

Parameters
psz_nameth name of the module
Returns
TRUE if the module exists

References module_find(), and psz_name.

Referenced by aout_New().

◆ module_find()

module_t* module_find ( const char *  name)

Get a pointer to a module_t given it's name.

Parameters
namethe name of the module
Returns
a pointer to the module or NULL in case of a failure

References count, module_t::i_shortcuts, list, module_list_free(), module_list_get(), name, module_t::pp_shortcuts, and unlikely.

Referenced by module_exists().

◆ module_get_capability()

const char* module_get_capability ( const module_t m)

Gets the capability of a module.

Parameters
mthe module
Returns
the capability, or "none" if unspecified

References module_t::psz_capability.

Referenced by module_provides(), and vlc_module_store().

◆ module_get_help()

const char* module_get_help ( const module_t m)

Get the help for a module.

Parameters
mthe module
Returns
the help

References module_t::psz_help.

◆ module_get_name()

const char* module_get_name ( const module_t m,
bool  long_name 
)

Get the human-friendly name of a module.

Parameters
mthe module
long_nameTRUE to have the long name of the module
Returns
the short or long name of the module

References module_get_object(), module_t::psz_longname, and module_t::psz_shortname.

Referenced by filter_chain_AppendInner().

◆ module_get_object()

const char* module_get_object ( const module_t m)

Get the internal name of a module.

Parameters
mthe module
Returns
the module name

References module_t::i_shortcuts, module_t::pp_shortcuts, and unlikely.

Referenced by config_SaveConfigFile(), ListModules(), module_get_name(), module_is_main(), module_unneed(), and vlc_module_load().

◆ module_get_score()

int module_get_score ( const module_t m)

Get the score for a module.

Parameters
mthe module return the score for the capability

References module_t::i_score.

Referenced by vlc_module_load().

◆ module_gettext()

const char* module_gettext ( const module_t m,
const char *  str 
)

Translate a string using the module's text domain.

Parameters
mthe module
strthe American English ASCII string to localize
Returns
the gettext-translated string

References module_t::plugin, vlc_plugin_t::textdomain, and unlikely.

Referenced by ListModules(), and print_section().

◆ module_load()

static int module_load ( vlc_object_t obj,
module_t m,
vlc_activate_t  init,
va_list  args 
)
static

< No error

< Unspecified error

< No error

References init, module_Map(), module_t::pf_activate, module_t::plugin, VLC_EGENERIC, vlc_objres_clear(), and VLC_SUCCESS.

Referenced by vlc_module_load().

◆ module_match_name()

static bool module_match_name ( const module_t m,
const char *  name 
)
static

◆ module_need()

module_t* module_need ( vlc_object_t obj,
const char *  cap,
const char *  name,
bool  strict 
)

◆ module_provides()

bool module_provides ( const module_t m,
const char *  cap 
)

Checks whether a module implements a capability.

Parameters
mthe module
capthe capability to check
Returns
true if the module has the capability

References module_get_capability().

◆ module_start()

int module_start ( vlc_object_t obj,
const module_t m 
)

< No error

References module_t::pf_activate, and VLC_SUCCESS.

◆ module_stop()

void module_stop ( vlc_object_t obj,
const module_t m 
)

◆ module_unneed()

void module_unneed ( vlc_object_t obj,
module_t module 
)

◆ vlc_module_load()

module_t* vlc_module_load ( vlc_object_t obj,
const char *  capability,
const char *  name,
bool  strict,
vlc_activate_t  probe,
  ... 
)

Finds and instantiates the best module of a certain type.

All candidates modules having the specified capability and name will be sorted in decreasing order of priority. Then the probe callback will be invoked for each module, until it succeeds (returns 0), or all candidate module failed to initialize.

The probe callback first parameter is the address of the module entry point. Further parameters are passed as an argument list; it corresponds to the variable arguments passed to this function. This scheme is meant to support arbitrary prototypes for the module entry point.

Parameters
objVLC object
capabilitycapability, i.e. class of module
namename of the module asked, if any
strictif true, do not fallback to plugin with a different name but the same capability
probemodule probe callback
Returns
the module or NULL in case of a failure

< No error

< Timeout

< No error

< Timeout

References vlc_common_members::force, likely, module_get_object(), module_get_score(), module_list_cap(), module_list_free(), module_load(), module_match_name(), msg_Dbg, name, vlc_object_t::obj, strcasecmp(), unlikely, var_InheritString, VLC_ETIMEOUT, vlc_object_set_name, and VLC_SUCCESS.

Referenced by module_need().

◆ vlc_module_unload()

void vlc_module_unload ( vlc_object_t obj,
module_t module,
vlc_deactivate_t  deinit,
  ... 
)

Deinstantiates a module.

Parameters
modulethe module pointer as returned by vlc_module_load()
deinitdeactivation callback

References module_t::pf_deactivate, and vlc_objres_clear().

Referenced by module_unneed().