libgpac
Documentation of the core library of GPAC
module.c File Reference
#include "module_wrap.h"
#include <gpac/config_file.h>
#include <gpac/tools.h>
#include <gpac/network.h>
#include <gpac/modules/video_out.h>
#include <gpac/modules/audio_out.h>
#include <gpac/modules/font.h>
+ Include dependency graph for module.c:

Macros

#define LOAD_PLUGIN(__name)
 

Functions

static void load_all_modules (GF_ModuleManager *mgr)
 
GF_EXPORT GF_Err gf_module_load_static (GF_InterfaceRegister *(*register_module)())
 load a static module given its interface function More...
 
u32 gf_modules_refresh (GF_ModuleManager *pm)
 
static void gf_modules_check_load ()
 
void gf_modules_refresh_module_directories ()
 
void gf_modules_new (GF_Config *config)
 module manager construtcor More...
 
void gf_module_reload_dirs ()
 
void gf_modules_del ()
 module manager destructor More...
 
Bool gf_module_is_loaded (GF_ModuleManager *pm, char *filename)
 
GF_EXPORT u32 gf_modules_count ()
 get module count More...
 
GF_EXPORT GF_BaseInterfacegf_modules_load (u32 whichplug, u32 InterfaceFamily)
 loads an interface More...
 
void * gf_modules_load_filter (u32 whichplug, void *fsess)
 filter module load More...
 
GF_EXPORT GF_BaseInterfacegf_modules_load_by_name (const char *plug_name, u32 InterfaceFamily, Bool rebrowse_all)
 loads an interface by module name More...
 
GF_EXPORT GF_Err gf_modules_close_interface (GF_BaseInterface *ifce)
 interface shutdown More...
 
GF_EXPORT const char * gf_modules_get_file_name (u32 i)
 get module file name More...
 
GF_EXPORT const char * gf_module_get_file_name (GF_BaseInterface *ifce)
 get module file name More...
 
static Bool module_check_ifce (GF_BaseInterface *ifce, u32 ifce_type)
 
GF_BaseInterfacegf_module_load (u32 ifce_type, const char *name)
 module load More...
 
GF_EXPORT const char * gf_module_get_key (GF_BaseInterface *dr, char *key_name)
 query module option More...
 
GF_EXPORT Bool gf_module_get_bool (GF_BaseInterface *dr, char *key_name)
 query module option as boolean More...
 
GF_EXPORT Bool gf_module_get_int (GF_BaseInterface *dr, char *key_name)
 query module option as int More...
 

Variables

GF_ModuleManager * gpac_modules_static = NULL
 

Macro Definition Documentation

◆ LOAD_PLUGIN

#define LOAD_PLUGIN (   __name)
Value:
{ \
GF_InterfaceRegister *gf_register_module_##__name(); \
pr = gf_register_module_##__name();\
if (!pr) {\
GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("Failed to statically load module ##__name\n"));\
} else {\
gf_list_add(mgr->plugin_registry, pr); \
} \
}
@ GF_LOG_CORE
Definition: tools.h:776
@ GF_LOG_ERROR
Definition: tools.h:741

Function Documentation

◆ load_all_modules()

static void load_all_modules ( GF_ModuleManager *  mgr)
static
+ Here is the caller graph for this function:

◆ gf_module_load_static()

GF_EXPORT GF_Err gf_module_load_static ( GF_InterfaceRegister *(*)()  register_module)
Parameters
register_modulethe register interface function
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_refresh()

u32 gf_modules_refresh ( GF_ModuleManager *  pm)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_check_load()

static void gf_modules_check_load ( )
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_refresh_module_directories()

void gf_modules_refresh_module_directories ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_new()

void gf_modules_new ( GF_Config *  config)

Constructs a module manager object.

Parameters
configGPAC configuration file handle. If this is NULL, the modules won't be able to share the configuration file with the rest of the GPAC framework.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_module_reload_dirs()

void gf_module_reload_dirs ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_del()

void gf_modules_del ( )

Destroys the module manager

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_module_is_loaded()

Bool gf_module_is_loaded ( GF_ModuleManager *  pm,
char *  filename 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_count()

GF_EXPORT u32 gf_modules_count ( )

Gets the number of modules found in the manager directory

Returns
the number of loaded modules
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_load()

GF_EXPORT GF_BaseInterface* gf_modules_load ( u32  index,
u32  InterfaceFamily 
)

Loads an interface in the desired module.

Parameters
indexthe 0-based index of the module to load the interface from
InterfaceFamilytype of the interface to load
Returns
the interface object if found and loaded, NULL otherwise.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_load_filter()

void* gf_modules_load_filter ( u32  index,
void *  fsess 
)

Loads a filter module (not using GF_BaseInterface) from its index. Returns NULL if no such filter.

Parameters
indexindex of the filter module to load
fsessopaque handle passed to the filter loader
Returns
the loaded filter register, or NULL if not found
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_load_by_name()

GF_EXPORT GF_BaseInterface* gf_modules_load_by_name ( const char *  mod_name,
u32  InterfaceFamily,
Bool  rebrowse_all 
)

Loads an interface in the desired module

Parameters
mod_namethe name of the module (shared library file) or of the interface as declared when registered.
InterfaceFamilytype of the interface to load
rebrowse_allif GF_TRUE, locate an interface for this type if not found by name
Returns
the interface object if found and loaded, NULL otherwise.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_close_interface()

GF_EXPORT GF_Err gf_modules_close_interface ( GF_BaseInterface interface_obj)

Closes an interface

Parameters
interface_objthe interface to close
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_modules_get_file_name()

GF_EXPORT const char* gf_modules_get_file_name ( u32  index)

Gets a module shared library file name based on its index

Parameters
indexthe 0-based index of the module to query
Returns
the name of the shared library module
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_module_get_file_name()

GF_EXPORT const char* gf_module_get_file_name ( GF_BaseInterface ifce)

Gets a module shared library file name based on its index

Parameters
ifcethe module instance to query
Returns
the name of the shared library module
+ Here is the caller graph for this function:

◆ module_check_ifce()

static Bool module_check_ifce ( GF_BaseInterface ifce,
u32  ifce_type 
)
static
+ Here is the caller graph for this function:

◆ gf_module_load()

GF_BaseInterface* gf_module_load ( u32  ifce_type,
const char *  name 
)

Loads a module based on a preferred name. If not found, check for predefined names for the given interface type in fthe global config and loads by predefined name. If still not found, enumerate modules.

Parameters
ifce_typetype of module interface to load
namename of preferred module
Returns
the loaded module, or NULL if not found
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_module_get_key()

GF_EXPORT const char* gf_module_get_key ( GF_BaseInterface ifce,
char *  key 
)

Loads a key from config in the module options.

Parameters
ifcethe module instance to query
keythe key to query
Returns
the key value or null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_module_get_bool()

GF_EXPORT Bool gf_module_get_bool ( GF_BaseInterface ifce,
char *  key_name 
)

Loads a boolean key from config in the module options.

Parameters
ifcethe module instance to query
key_namethe key to query
Returns
GF_TRUE if key is found and equals yes, true or 1, GF_FALSE otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_module_get_int()

GF_EXPORT Bool gf_module_get_int ( GF_BaseInterface ifce,
char *  key_name 
)

Loads an integer key from config in the module options.

Parameters
ifcethe module instance to query
key_namethe key to query
Returns
integer value of key, 0 if not found
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ gpac_modules_static

GF_ModuleManager* gpac_modules_static = NULL