GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
plugable modules

Plugable Module functions. More...

+ Collaboration diagram for plugable modules:

Data Structures

struct  GF_BaseInterface
 Base Interface. More...
 
struct  GF_InterfaceRegister
 Interface Registry. More...
 

Macros

#define GF_DECL_MODULE_INTERFACE
 common module interface More...
 
#define GF_REGISTER_MODULE_INTERFACE(_ifce, _ifce_type, _ifce_name, _ifce_author)
 module interface registration More...
 
#define GPAC_MODULE_EXPORT
 module interface function export. Modules that can be compiled in libgpac rather than in sharde libraries shall use this macro to declare the 3 exported functions More...
 
#define GPAC_MODULE_STATIC_DELARATION(__name)
 module interface function export. Modules that can be compiled in libgpac rather than in sharde libraries shall use this macro to declare the 3 exported functions More...
 

Functions

GF_ModuleManager * gf_modules_new (const char *directory, GF_Config *cfgFile)
 module manager construtcor More...
 
void gf_modules_del (GF_ModuleManager *pm)
 module manager destructor More...
 
u32 gf_modules_refresh (GF_ModuleManager *pm)
 refreshes modules More...
 
u32 gf_modules_get_count (GF_ModuleManager *pm)
 get module count More...
 
const char ** gf_modules_get_module_directories (GF_ModuleManager *pm, u32 *num_dirs)
 get all modules directories More...
 
const char * gf_modules_get_file_name (GF_ModuleManager *pm, u32 index)
 get module file name More...
 
const char * gf_module_get_file_name (GF_BaseInterface *ifce)
 get module file name More...
 
GF_BaseInterfacegf_modules_load_interface (GF_ModuleManager *pm, u32 index, u32 InterfaceFamily)
 loads an interface More...
 
GF_BaseInterfacegf_modules_load_interface_by_name (GF_ModuleManager *pm, const char *mod_name, u32 InterfaceFamily)
 loads an interface by module name More...
 
GF_Err gf_modules_close_interface (GF_BaseInterface *interface_obj)
 interface shutdown More...
 
const char * gf_modules_get_option (GF_BaseInterface *interface_obj, const char *secName, const char *keyName)
 interface option query More...
 
GF_Err gf_modules_set_option (GF_BaseInterface *interface_obj, const char *secName, const char *keyName, const char *keyValue)
 interface option update More...
 
GF_Config * gf_modules_get_config (GF_BaseInterface *ifce)
 get config file More...
 

Detailed Description

This section documents the plugable module functions of the GPAC framework. A module is a dynamic/shared library providing one or several interfaces to the GPAC framework. A module cannot provide several interfaces of the same type. Each module must export the following functions:

* u32 *QueryInterfaces(u32 interface_type);

This function is used to query supported interfaces. It returns a zero-terminated array of supported interface types.

This function is used to load an interface. It returns the interface object, NULL if error.

This function is used to destroy an interface.

Each interface must begin with the interface macro in order to be type-casted to the base interface structure.

struct {
extensions;
};

Data Structure Documentation

struct GF_BaseInterface

This structure represent a base interface, e.g. the minimal interface declaration without functionalities. Each interface is type-casted to this structure and shall always be checked against its interface type. API Versioning is taken care of in the interface type itsel, changing at each modification of the interface API

+ Collaboration diagram for GF_BaseInterface:
Data Fields
u32 InterfaceType
const char * module_name
const char * author_name
void * HPLUG

Macro Definition Documentation

#define GF_DECL_MODULE_INTERFACE

This is the module interface declaration macro. It must be placed first in an interface structure declaration.

#define GF_REGISTER_MODULE_INTERFACE (   _ifce,
  _ifce_type,
  _ifce_name,
  _ifce_author 
)

This is the module interface registration macro. A module must call this macro whenever creating a new interface.

#define GPAC_MODULE_EXPORT
#define GPAC_MODULE_STATIC_DELARATION (   __name)

Function Documentation

GF_ModuleManager* gf_modules_new ( const char *  directory,
GF_Config *  cfgFile 
)

Constructs a module manager object.

Parameters
directoryabsolute path to the directory where the manager shall look for modules
cfgFileGPAC 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.
Returns
the module manager object

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_modules_del ( GF_ModuleManager *  pm)

Destroys the module manager

Parameters
pmthe module manager

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_modules_refresh ( GF_ModuleManager *  pm)

Refreshes all modules in the manager directory and load unloaded ones

Parameters
pmthe module manager
Returns
the number of loaded modules

+ Here is the caller graph for this function:

u32 gf_modules_get_count ( GF_ModuleManager *  pm)

Gets the number of modules found in the manager directory

Parameters
pmthe module manager
Returns
the number of loaded modules

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char** gf_modules_get_module_directories ( GF_ModuleManager *  pm,
u32 num_dirs 
)

Update module manager with all modules directories

Parameters
pmthe module manager
num_dirsthe number of module directories
Returns
The list of modules directories

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* gf_modules_get_file_name ( GF_ModuleManager *  pm,
u32  index 
)

Gets a module shared library file name based on its index

Parameters
pmthe module manager
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:

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
GF_BaseInterface* gf_modules_load_interface ( GF_ModuleManager *  pm,
u32  index,
u32  InterfaceFamily 
)

Loads an interface in the desired module.

Parameters
pmthe module manager
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_BaseInterface* gf_modules_load_interface_by_name ( GF_ModuleManager *  pm,
const char *  mod_name,
u32  InterfaceFamily 
)

Loads an interface in the desired module

Parameters
pmthe module manager
mod_namethe name of the module (shared library file) or of the interface as declared when registered.
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_Err gf_modules_close_interface ( GF_BaseInterface interface_obj)

Closes an interface

Parameters
interface_objthe interface to close

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* gf_modules_get_option ( GF_BaseInterface interface_obj,
const char *  secName,
const char *  keyName 
)

Gets an option from the config file associated with the module manager

Parameters
interface_objthe interface object used
secNamethe desired key parent section name
keyNamethe desired key name
Returns
the desired key value if found, NULL otherwise.

+ Here is the call graph for this function:

GF_Err gf_modules_set_option ( GF_BaseInterface interface_obj,
const char *  secName,
const char *  keyName,
const char *  keyValue 
)

Sets an option in the config file associated with the module manager

Parameters
interface_objthe interface object used
secNamethe desired key parent section name
keyNamethe desired key name
keyValuethe desired key value
Note
this will also create both section and key if they are not found in the configuration file

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Config* gf_modules_get_config ( GF_BaseInterface ifce)

Gets the configuration file for the module instance

Parameters
ifcethe interface object used
Returns
handle to the config file

+ Here is the caller graph for this function: