gmerlin
Topics | Data Structures | Typedefs | Enumerations | Functions
Plugin registry

Database of all installed plugins. More...

Topics

 Defaults saved between sessions
 Plugin defaults.
 

Data Structures

struct  bg_plugin_info_s
 Information about a plugin. More...
 
struct  bg_plugin_registry_options_t
 Creation options for a plugin registry. More...
 
struct  bg_plugin_handle_s
 Handle of a loaded plugin. More...
 

Typedefs

typedef struct bg_plugin_info_s bg_plugin_info_t
 Typedef for plugin info.
 
typedef struct bg_plugin_registry_s bg_plugin_registry_t
 Opaque handle for a plugin registry.
 
typedef struct bg_plugin_handle_s bg_plugin_handle_t
 Typedef for plugin handle.
 

Enumerations

enum  bg_plugin_api_t {
  BG_PLUGIN_API_GMERLIN = 0 ,
  BG_PLUGIN_API_LADSPA ,
  BG_PLUGIN_API_LV ,
  BG_PLUGIN_API_FREI0R
}
 Identifiers for plugin APIs. More...
 
enum  bg_stream_type_t {
  BG_STREAM_AUDIO = (1<<0) ,
  BG_STREAM_TEXT = (1<<1) ,
  BG_STREAM_OVERLAY = (1<<2) ,
  BG_STREAM_VIDEO = (1<<3)
}
 Identifiers for stream types. More...
 

Functions

bg_plugin_registry_tbg_plugin_registry_create (bg_cfg_section_t *section)
 Create a plugin registry.
 
bg_plugin_registry_tbg_plugin_registry_create_with_options (bg_cfg_section_t *section, const bg_plugin_registry_options_t *opt)
 Create a plugin registry with options.
 
void bg_plugin_registry_scan_devices (bg_plugin_registry_t *plugin_reg, uint32_t type_mask, uint32_t flag_mask)
 Scan for pluggable devices.
 
void bg_plugin_registry_destroy (bg_plugin_registry_t *reg)
 Destroy a plugin registry.
 
int bg_plugin_registry_get_num_plugins (bg_plugin_registry_t *reg, uint32_t type_mask, uint32_t flag_mask)
 Count plugins.
 
const bg_plugin_info_tbg_plugin_find_by_index (bg_plugin_registry_t *reg, int index, uint32_t type_mask, uint32_t flag_mask)
 Find a plugin by index.
 
const bg_plugin_info_tbg_plugin_find_by_name (bg_plugin_registry_t *reg, const char *name)
 Find a plugin by it's unique short name.
 
const bg_plugin_info_tbg_plugin_find_by_filename (bg_plugin_registry_t *reg, const char *filename, int type_mask)
 Find a plugin by the file extension.
 
const bg_plugin_info_tbg_plugin_find_by_mimetype (bg_plugin_registry_t *reg, const char *mimetype, int type_mask)
 Find a plugin by the mime type.
 
const bg_plugin_info_tbg_plugin_find_by_compression (bg_plugin_registry_t *reg, gavl_codec_id_t id, int typemask, int flagmask)
 Find a plugin by the compression ID.
 
const bg_plugin_info_tbg_plugin_find_by_protocol (bg_plugin_registry_t *reg, const char *protocol)
 Find an input plugin for a network protocol.
 
char ** bg_plugin_registry_get_plugins (bg_plugin_registry_t *reg, uint32_t type_mask, uint32_t flag_mask)
 Get a list of plugins.
 
void bg_plugin_registry_free_plugins (char **plugins)
 Free a plugin list.
 
int bg_input_plugin_load (bg_plugin_registry_t *reg, const char *location, const bg_plugin_info_t *info, bg_plugin_handle_t **ret, bg_input_callbacks_t *callbacks, int prefer_edl)
 Load and open an input plugin.
 
int bg_input_plugin_load_full (bg_plugin_registry_t *reg, const char *location, const bg_plugin_info_t *info, bg_plugin_handle_t **ret, bg_input_callbacks_t *callbacks, int prefer_edl, int *track)
 Load and open an input plugin with URL redirection.
 
int bg_input_plugin_load_edl (bg_plugin_registry_t *reg, const gavl_edl_t *edl, const bg_plugin_info_t *info, bg_plugin_handle_t **ret, bg_input_callbacks_t *callbacks)
 Load and open an edl decoder.
 
void bg_plugin_registry_set_extensions (bg_plugin_registry_t *reg, const char *plugin_name, const char *extensions)
 Set file extensions for a plugin.
 
void bg_plugin_registry_set_protocols (bg_plugin_registry_t *reg, const char *plugin_name, const char *protocols)
 Set protocols for a plugin.
 
void bg_plugin_registry_set_priority (bg_plugin_registry_t *reg, const char *plugin_name, int priority)
 Set priority for a plugin.
 
bg_cfg_section_tbg_plugin_registry_get_section (bg_plugin_registry_t *reg, const char *plugin_name)
 Get the config section belonging to a plugin.
 
void bg_plugin_registry_set_parameter_info (bg_plugin_registry_t *reg, uint32_t type_mask, uint32_t flag_mask, bg_parameter_info_t *ret)
 Set a parameter info for selecting and configuring plugins.
 
void bg_plugin_registry_set_parameter_info_input (bg_plugin_registry_t *reg, uint32_t type_mask, uint32_t flag_mask, bg_parameter_info_t *ret)
 Set a parameter info for selecting and configuring input plugins.
 
void bg_plugin_registry_set_parameter_input (void *data, const char *name, const bg_parameter_value_t *val)
 Set a parameter of an input plugin.
 
bg_parameter_info_tbg_plugin_registry_create_encoder_parameters (bg_plugin_registry_t *reg, uint32_t stream_type_mask, uint32_t flag_mask, int stream_params)
 Create a parameter array for encoders.
 
bg_parameter_info_tbg_plugin_registry_create_compressor_parameters (bg_plugin_registry_t *reg, uint32_t flag_mask)
 Create a parameter array for compressors.
 
void bg_plugin_registry_set_compressor_parameter (bg_plugin_registry_t *plugin_reg, bg_plugin_handle_t **plugin, const char *name, const bg_parameter_value_t *val)
 Set a compressor parameter.
 
gavl_codec_id_t bg_plugin_registry_get_compressor_id (bg_plugin_registry_t *plugin_reg, bg_cfg_section_t *section)
 Get a compression ID from a compressor section.
 
const char * bg_encoder_section_get_plugin (bg_plugin_registry_t *plugin_reg, bg_cfg_section_t *s, bg_stream_type_t stream_type, int stream_mask)
 Get the name for an encoding plugin.
 
void bg_encoder_section_get_plugin_config (bg_plugin_registry_t *plugin_reg, bg_cfg_section_t *s, bg_stream_type_t stream_type, int stream_mask, bg_cfg_section_t **section_ret, const bg_parameter_info_t **params_ret)
 Get the plugin configuration for an encoding plugin.
 
void bg_encoder_section_get_stream_config (bg_plugin_registry_t *plugin_reg, bg_cfg_section_t *s, bg_stream_type_t stream_type, int stream_mask, bg_cfg_section_t **section_ret, const bg_parameter_info_t **params_ret)
 Get the stream configuration for an encoding plugin.
 
bg_cfg_section_tbg_encoder_section_get_from_registry (bg_plugin_registry_t *plugin_reg, const bg_parameter_info_t *parameters, uint32_t type_mask, uint32_t flag_mask)
 Get an encoder configuration section from a registry.
 
void bg_encoder_section_store_in_registry (bg_plugin_registry_t *plugin_reg, bg_cfg_section_t *s, const bg_parameter_info_t *parameters, uint32_t type_mask, uint32_t flag_mask)
 Store an encoder configuration in a registry.
 
void bg_plugin_registry_add_device (bg_plugin_registry_t *reg, const char *plugin_name, const char *device, const char *name)
 Add a device to a plugin.
 
void bg_plugin_registry_set_device_name (bg_plugin_registry_t *reg, const char *plugin_name, const char *device, const char *name)
 Change the name of a device.
 
void bg_plugin_registry_find_devices (bg_plugin_registry_t *reg, const char *plugin_name)
 Let a plugin rescan for devices.
 
void bg_plugin_registry_remove_device (bg_plugin_registry_t *reg, const char *plugin_name, const char *device, const char *name)
 Remove a device.
 
gavl_video_frame_tbg_plugin_registry_load_image (bg_plugin_registry_t *reg, const char *filename, gavl_video_format_t *format, gavl_metadata_t *m)
 Load an image.
 
void bg_plugin_registry_save_image (bg_plugin_registry_t *reg, const char *filename, gavl_video_frame_t *frame, const gavl_video_format_t *format, const gavl_metadata_t *m)
 Save an image.
 
bg_plugin_handle_tbg_plugin_load (bg_plugin_registry_t *reg, const bg_plugin_info_t *info)
 Load a plugin.
 
bg_plugin_handle_tbg_ov_plugin_load (bg_plugin_registry_t *reg, const bg_plugin_info_t *info, const char *window_id)
 Load a video output plugin.
 
void bg_plugin_lock (void *h)
 Lock a plugin.
 
void bg_plugin_unlock (void *h)
 Unlock a plugin.
 
void bg_plugin_ref (bg_plugin_handle_t *h)
 Increase the reference count.
 
void bg_plugin_unref (bg_plugin_handle_t *h)
 Decrease the reference count.
 
void bg_plugin_unref_nolock (bg_plugin_handle_t *h)
 Decrease the reference count without locking.
 
bg_plugin_info_tbg_plugin_info_create (const bg_plugin_common_t *plugin)
 Create a plugin info from a plugin.
 
bg_plugin_handle_tbg_plugin_handle_create ()
 Create an empty plugin handle.
 
int bg_plugin_registry_changed (bg_plugin_registry_t *reg)
 Check if the plugin registry was changed.
 
void bg_plugin_save_metadata (bg_plugin_handle_t *h)
 Save the metadata to an xml file.
 

Detailed Description

Database of all installed plugins.

The plugin registry keeps informations about all installed plugins. Furthermore, it manages default plugins and some other settings. Available plugins are cached in the file $HOME/.gmerlin/plugins.xml, which is used by all applications. Application specific data are stored in a bg_cfg_section_t.

It allows you to search for plugins according to certain criteria. You get detailed information about plugins in bg_plugin_info_t structs.

Typedef Documentation

◆ bg_plugin_info_t

Typedef for plugin info.

◆ bg_plugin_registry_t

typedef struct bg_plugin_registry_s bg_plugin_registry_t

Opaque handle for a plugin registry.

You don't want to know, what's inside here.

◆ bg_plugin_handle_t

Typedef for plugin handle.

Enumeration Type Documentation

◆ bg_plugin_api_t

Identifiers for plugin APIs.

Enumerator
BG_PLUGIN_API_GMERLIN 

Always 0 so native plugins can leave this empty.

BG_PLUGIN_API_LADSPA 

Ladspa API.

BG_PLUGIN_API_LV 

Libvisual.

BG_PLUGIN_API_FREI0R 

frei0r

◆ bg_stream_type_t

Identifiers for stream types.

Function Documentation

◆ bg_plugin_registry_create()

bg_plugin_registry_t * bg_plugin_registry_create ( bg_cfg_section_t * section)

Create a plugin registry.

Parameters
sectionA configuration section

The configuration section will be owned exclusively by the plugin registry, applications should not touch it.

◆ bg_plugin_registry_create_with_options()

bg_plugin_registry_t * bg_plugin_registry_create_with_options ( bg_cfg_section_t * section,
const bg_plugin_registry_options_t * opt )

Create a plugin registry with options.

Parameters
sectionA configuration section
optThe options structure

The configuration section will be owned exclusively by the plugin registry, applications should not touch it.

◆ bg_plugin_registry_scan_devices()

void bg_plugin_registry_scan_devices ( bg_plugin_registry_t * plugin_reg,
uint32_t type_mask,
uint32_t flag_mask )

Scan for pluggable devices.

Parameters
plugin_regA plugin registry
type_maskMask of all types you want to have the devices scanned for
flag_maskMask of all flags you want to have the devices scanned for

Some plugins offer a list of supported devices as parameters. To update these (e.g. if pluggable devices are among them), call this function right after you created the plugin registry

◆ bg_plugin_registry_destroy()

void bg_plugin_registry_destroy ( bg_plugin_registry_t * reg)

Destroy a plugin registry.

Parameters
regA plugin registry

◆ bg_plugin_registry_get_num_plugins()

int bg_plugin_registry_get_num_plugins ( bg_plugin_registry_t * reg,
uint32_t type_mask,
uint32_t flag_mask )

Count plugins.

Parameters
regA plugin registry
type_maskMask of all types you want to have
flag_maskMask of all flags you want to have
Returns
Number of available plugins matching type_mask and flag_mask

◆ bg_plugin_find_by_index()

const bg_plugin_info_t * bg_plugin_find_by_index ( bg_plugin_registry_t * reg,
int index,
uint32_t type_mask,
uint32_t flag_mask )

Find a plugin by index.

Parameters
regA plugin registry
indexIndex
type_maskMask of all types you want to have
flag_maskMask of all flags you want to have
Returns
A plugin info or NULL

This function should be called after bg_plugin_registry_get_num_plugins to get a particular plugin

◆ bg_plugin_find_by_name()

const bg_plugin_info_t * bg_plugin_find_by_name ( bg_plugin_registry_t * reg,
const char * name )

Find a plugin by it's unique short name.

Parameters
regA plugin registry
nameThe name
Returns
A plugin info or NULL

◆ bg_plugin_find_by_filename()

const bg_plugin_info_t * bg_plugin_find_by_filename ( bg_plugin_registry_t * reg,
const char * filename,
int type_mask )

Find a plugin by the file extension.

Parameters
regA plugin registry
filenameThe file, whose extension should match
type_maskMask of plugin types to be returned
Returns
A plugin info or NULL

This function returns the first plugin matching type_mask, whose extensions match filename.

◆ bg_plugin_find_by_mimetype()

const bg_plugin_info_t * bg_plugin_find_by_mimetype ( bg_plugin_registry_t * reg,
const char * mimetype,
int type_mask )

Find a plugin by the mime type.

Parameters
regA plugin registry
mimetypeMimetype
type_maskMask of plugin types to be returned
Returns
A plugin info or NULL

This function returns the first plugin matching type_mask, whose extensions match filename.

◆ bg_plugin_find_by_compression()

const bg_plugin_info_t * bg_plugin_find_by_compression ( bg_plugin_registry_t * reg,
gavl_codec_id_t id,
int typemask,
int flagmask )

Find a plugin by the compression ID.

Parameters
regA plugin registry
typemaskMask of plugin types to be returned
flagmaskMask of plugin flags to be returned
Returns
A plugin info or NULL

◆ bg_plugin_find_by_protocol()

const bg_plugin_info_t * bg_plugin_find_by_protocol ( bg_plugin_registry_t * reg,
const char * protocol )

Find an input plugin for a network protocol.

Parameters
regA plugin registry
protocolThe network protocol (e.g. http)
Returns
A plugin info or NULL

◆ bg_plugin_registry_get_plugins()

char ** bg_plugin_registry_get_plugins ( bg_plugin_registry_t * reg,
uint32_t type_mask,
uint32_t flag_mask )

Get a list of plugins.

Parameters
regA plugin registry
type_maskMask of all returned plugin types
flag_maskMask of all returned plugin flags
Returns
A NULL-terminated list of plugin names.

This functions returns plugin names suitable for adding to GUI menus. Use bg_plugin_find_by_name to get the corresponding plugin infos.

Use bg_plugin_registry_free_plugins to free the returned list.

◆ bg_plugin_registry_free_plugins()

void bg_plugin_registry_free_plugins ( char ** plugins)

Free a plugin list.

Parameters
pluginsList returned by bg_plugin_registry_get_plugins

◆ bg_input_plugin_load()

int bg_input_plugin_load ( bg_plugin_registry_t * reg,
const char * location,
const bg_plugin_info_t * info,
bg_plugin_handle_t ** ret,
bg_input_callbacks_t * callbacks,
int prefer_edl )

Load and open an input plugin.

Parameters
regA plugin registry
locationFilename or URL
infoPlugin to use (can be NULL for autodetection)
retWill return the plugin handle.
callbacksInput callbacks (only for authentication)
prefer_edlIf 1 EDLs are preferred over raw streams
Returns
1 on success, 0 on error.

This is a convenience function to load an input file. If info is NULL, the plugin will be autodetected. The handle is stored in ret. If ret is non-null before the call, the old plugin will be unrefed.

◆ bg_input_plugin_load_full()

int bg_input_plugin_load_full ( bg_plugin_registry_t * reg,
const char * location,
const bg_plugin_info_t * info,
bg_plugin_handle_t ** ret,
bg_input_callbacks_t * callbacks,
int prefer_edl,
int * track )

Load and open an input plugin with URL redirection.

Parameters
regA plugin registry
locationFilename or URL
infoPlugin to use (can be NULL for autodetection)
retWill return the plugin handle.
callbacksInput callbacks (only for authentication)
prefer_edlIf 1 EDLs are preferred over raw streams
trackTrack index (might get changed for redirectors)
Returns
1 on success, 0 on error.

Like bg_input_plugin_load but it does URL redirection e.g. for m3u or pls files.

◆ bg_input_plugin_load_edl()

int bg_input_plugin_load_edl ( bg_plugin_registry_t * reg,
const gavl_edl_t * edl,
const bg_plugin_info_t * info,
bg_plugin_handle_t ** ret,
bg_input_callbacks_t * callbacks )

Load and open an edl decoder.

Parameters
regA plugin registry
edlThe edl to open
infoPlugin to use (can be NULL for autodetection)
retWill return the plugin handle.
callbacksInput callbacks (only for authentication)
Returns
1 on success, 0 on error.

This is a convenience function to load an input file. If info is NULL, the plugin will be autodetected. The handle is stored in ret. If ret is non-null before the call, the old plugin will be unrefed.

◆ bg_plugin_registry_set_extensions()

void bg_plugin_registry_set_extensions ( bg_plugin_registry_t * reg,
const char * plugin_name,
const char * extensions )

Set file extensions for a plugin.

Parameters
regA plugin registry
plugin_nameName of the plugin
extensionsSpace separated list of file extensions

The extensions will be saved in the plugin file

◆ bg_plugin_registry_set_protocols()

void bg_plugin_registry_set_protocols ( bg_plugin_registry_t * reg,
const char * plugin_name,
const char * protocols )

Set protocols for a plugin.

Parameters
regA plugin registry
plugin_nameName of the plugin
protocolsSpace separated list of protocols

The protocols will be saved in the plugin file

◆ bg_plugin_registry_set_priority()

void bg_plugin_registry_set_priority ( bg_plugin_registry_t * reg,
const char * plugin_name,
int priority )

Set priority for a plugin.

Parameters
regA plugin registry
plugin_nameName of the plugin
priorityPriority (BG_PLUGIN_PRIORITY_MIN..BG_PLUGIN_PRIORITY_MAX, should be 1..10)

The priority will be saved in the plugin file

◆ bg_plugin_registry_get_section()

bg_cfg_section_t * bg_plugin_registry_get_section ( bg_plugin_registry_t * reg,
const char * plugin_name )

Get the config section belonging to a plugin.

Parameters
regA plugin registry
plugin_nameShort name of the plugin
Returns
The config section belonging to the plugin or NULL

◆ bg_plugin_registry_set_parameter_info()

void bg_plugin_registry_set_parameter_info ( bg_plugin_registry_t * reg,
uint32_t type_mask,
uint32_t flag_mask,
bg_parameter_info_t * ret )

Set a parameter info for selecting and configuring plugins.

Parameters
regA plugin registry
type_maskMask of all returned types
flag_maskMask of all returned flags
retWhere the parameter info will be copied

◆ bg_plugin_registry_set_parameter_info_input()

void bg_plugin_registry_set_parameter_info_input ( bg_plugin_registry_t * reg,
uint32_t type_mask,
uint32_t flag_mask,
bg_parameter_info_t * ret )

Set a parameter info for selecting and configuring input plugins.

Parameters
regA plugin registry
type_maskMask of all returned types
flag_maskMask of all returned flags
retWhere the parameter info will be copied

◆ bg_plugin_registry_set_parameter_input()

void bg_plugin_registry_set_parameter_input ( void * data,
const char * name,
const bg_parameter_value_t * val )

Set a parameter of an input plugin.

Parameters
dataA plugin registry cast to void
nameName
valValue

◆ bg_plugin_registry_create_encoder_parameters()

bg_parameter_info_t * bg_plugin_registry_create_encoder_parameters ( bg_plugin_registry_t * reg,
uint32_t stream_type_mask,
uint32_t flag_mask,
int stream_params )

Create a parameter array for encoders.

Parameters
regA plugin registry
stream_type_maskMask of all stream types to be encoded
flag_maskMask of all returned plugin flags
Returns
Parameter array for setting up encoders

Free the returned parameters with bg_parameter_info_destroy_array

If you create a config section from the returned parameters (with bg_cfg_section_create_from_parameters or bg_cfg_section_create_items) the resulting encoding section will contain the complete encoder setup. It can be manipulated through the bg_encoder_section_*() functions.

◆ bg_plugin_registry_create_compressor_parameters()

bg_parameter_info_t * bg_plugin_registry_create_compressor_parameters ( bg_plugin_registry_t * reg,
uint32_t flag_mask )

Create a parameter array for compressors.

Parameters
plugin_regA plugin registry
flag_maskMask of all returned plugin flags
Returns
Parameter array for setting up encoders

Free the returned parameters with bg_parameter_info_destroy_array

◆ bg_plugin_registry_set_compressor_parameter()

void bg_plugin_registry_set_compressor_parameter ( bg_plugin_registry_t * plugin_reg,
bg_plugin_handle_t ** plugin,
const char * name,
const bg_parameter_value_t * val )

Set a compressor parameter.

Parameters
plugin_regA plugin registry
pluginAddress of a plugin handle
nameParameter name
valValue

Call this with the parameters returned by bg_plugin_registry_create_encoder_parameters and afterwards *plugin will be a codec plugin with all parameters set.

◆ bg_plugin_registry_get_compressor_id()

gavl_codec_id_t bg_plugin_registry_get_compressor_id ( bg_plugin_registry_t * plugin_reg,
bg_cfg_section_t * section )

Get a compression ID from a compressor section.

Parameters
plugin_regA plugin registry
sectionA section
Returns
The codec ID

Call this with a section corrsponding to the parameters created by bg_plugin_registry_create_compressor_parameters

◆ bg_encoder_section_get_plugin()

const char * bg_encoder_section_get_plugin ( bg_plugin_registry_t * plugin_reg,
bg_cfg_section_t * s,
bg_stream_type_t stream_type,
int stream_mask )

Get the name for an encoding plugin.

Parameters
plugin_regA plugin registry
sAn encoder section (see bg_plugin_registry_create_encoder_parameters)
stream_typeThe stream type to encode
stream_maskThe mask passed to bg_plugin_registry_create_encoder_parameters
Returns
Returns the plugin name or NULL if the stream will be encoded by the video encoder

◆ bg_encoder_section_get_plugin_config()

void bg_encoder_section_get_plugin_config ( bg_plugin_registry_t * plugin_reg,
bg_cfg_section_t * s,
bg_stream_type_t stream_type,
int stream_mask,
bg_cfg_section_t ** section_ret,
const bg_parameter_info_t ** params_ret )

Get the plugin configuration for an encoding plugin.

Parameters
plugin_regA plugin registry
sAn encoder section (see bg_plugin_registry_create_encoder_parameters)
stream_typeThe stream type to encode
stream_maskThe mask passed to bg_plugin_registry_create_encoder_parameters
section_retIf non-null returns the config section for the plugin
params_retIf non-null returns the parameters for the plugin

◆ bg_encoder_section_get_stream_config()

void bg_encoder_section_get_stream_config ( bg_plugin_registry_t * plugin_reg,
bg_cfg_section_t * s,
bg_stream_type_t stream_type,
int stream_mask,
bg_cfg_section_t ** section_ret,
const bg_parameter_info_t ** params_ret )

Get the stream configuration for an encoding plugin.

Parameters
plugin_regA plugin registry
sAn encoder section (see bg_plugin_registry_create_encoder_parameters)
stream_typeThe stream type to encode
stream_maskThe mask passed to bg_plugin_registry_create_encoder_parameters
section_retIf non-null returns the config section for the stream
params_retIf non-null returns the parameters for the stream

◆ bg_encoder_section_get_from_registry()

bg_cfg_section_t * bg_encoder_section_get_from_registry ( bg_plugin_registry_t * plugin_reg,
const bg_parameter_info_t * parameters,
uint32_t type_mask,
uint32_t flag_mask )

Get an encoder configuration section from a registry.

Parameters
plugin_regA plugin registry
parametersParameters returned by bg_plugin_registry_create_encoder_parameters
type_maskThe stream mask passed to bg_plugin_registry_create_encoder_parameters
flag_maskThe mask passed to bg_plugin_registry_create_encoder_parameters
Returns
The encoder section with the values from the registry

◆ bg_encoder_section_store_in_registry()

void bg_encoder_section_store_in_registry ( bg_plugin_registry_t * plugin_reg,
bg_cfg_section_t * s,
const bg_parameter_info_t * parameters,
uint32_t type_mask,
uint32_t flag_mask )

Store an encoder configuration in a registry.

Parameters
plugin_regA plugin registry
sThe encoder section to store
parametersParameters returned by bg_plugin_registry_create_encoder_parameters
type_maskThe stream mask passed to bg_plugin_registry_create_encoder_parameters
flag_maskThe mask passed to bg_plugin_registry_create_encoder_parameters
Returns
The encoder section with the values from the registry

◆ bg_plugin_registry_add_device()

void bg_plugin_registry_add_device ( bg_plugin_registry_t * reg,
const char * plugin_name,
const char * device,
const char * name )

Add a device to a plugin.

Parameters
regA plugin registry
plugin_nameName of the plugin
deviceDevice file
nameName for the device

◆ bg_plugin_registry_set_device_name()

void bg_plugin_registry_set_device_name ( bg_plugin_registry_t * reg,
const char * plugin_name,
const char * device,
const char * name )

Change the name of a device.

Parameters
regA plugin registry
plugin_nameName of the plugin
deviceDevice file name
nameNew name for the device

Usually, plugins are quite smart in getting the name (Vendor, Model etc) of devices from the OS. In the case, you want to change names of a device use this function

◆ bg_plugin_registry_find_devices()

void bg_plugin_registry_find_devices ( bg_plugin_registry_t * reg,
const char * plugin_name )

Let a plugin rescan for devices.

Parameters
regA plugin registry
plugin_nameName of the plugin

This will let the plugin rescan for devices. Call this, after you changed your hardware.

◆ bg_plugin_registry_remove_device()

void bg_plugin_registry_remove_device ( bg_plugin_registry_t * reg,
const char * plugin_name,
const char * device,
const char * name )

Remove a device.

Parameters
regA plugin registry
plugin_nameName of the plugin
deviceDevice file name
nameNew name for the device

Remove a device from the list of devices. Call this if a plugin detected a device multiple times.

◆ bg_plugin_registry_load_image()

gavl_video_frame_t * bg_plugin_registry_load_image ( bg_plugin_registry_t * reg,
const char * filename,
gavl_video_format_t * format,
gavl_metadata_t * m )

Load an image.

Parameters
regA plugin registry
filenameImage filename
formatReturns format of the image
mReturns metadata
Returns
The frame, which contains the image

Use gavl_video_frame_destroy to free the return value

◆ bg_plugin_registry_save_image()

void bg_plugin_registry_save_image ( bg_plugin_registry_t * reg,
const char * filename,
gavl_video_frame_t * frame,
const gavl_video_format_t * format,
const gavl_metadata_t * m )

Save an image.

Parameters
regA plugin registry
filenameImage filename
frameThe frame, which contains the image
formatReturns format of the image
mMetadata

◆ bg_plugin_load()

bg_plugin_handle_t * bg_plugin_load ( bg_plugin_registry_t * reg,
const bg_plugin_info_t * info )

Load a plugin.

Parameters
regA plugin registry
infoThe plugin info

Load a plugin and return handle with reference count of 1

◆ bg_ov_plugin_load()

bg_plugin_handle_t * bg_ov_plugin_load ( bg_plugin_registry_t * reg,
const bg_plugin_info_t * info,
const char * window_id )

Load a video output plugin.

Parameters
regA plugin registry
infoThe plugin info
window_idThe window ID or NULL

Load a video output plugin for embedding into an already existing window and return handle with reference count of 1

◆ bg_plugin_lock()

void bg_plugin_lock ( void * h)

Lock a plugin.

Parameters
hA plugin handle

◆ bg_plugin_unlock()

void bg_plugin_unlock ( void * h)

Unlock a plugin.

Parameters
hA plugin handle

◆ bg_plugin_ref()

void bg_plugin_ref ( bg_plugin_handle_t * h)

Increase the reference count.

Parameters
hA plugin handle

◆ bg_plugin_unref()

void bg_plugin_unref ( bg_plugin_handle_t * h)

Decrease the reference count.

Parameters
hA plugin handle

If the reference count gets zero, the plugin will be destroyed

◆ bg_plugin_unref_nolock()

void bg_plugin_unref_nolock ( bg_plugin_handle_t * h)

Decrease the reference count without locking.

Parameters
hA plugin handle

Use this only if you know for sure, that the plugin is already locked and no other thread waits for the plugin to be unlocked. If the reference count gets zero, the plugin will be destroyed

◆ bg_plugin_info_create()

bg_plugin_info_t * bg_plugin_info_create ( const bg_plugin_common_t * plugin)

Create a plugin info from a plugin.

Parameters
pluginA plugin
Returns
A newly allocated plugin info

This is used by internal plugins only.

◆ bg_plugin_handle_create()

bg_plugin_handle_t * bg_plugin_handle_create ( )

Create an empty plugin handle.

Returns
A newly allocated plugin handle

Use this function only if you create a plugin handle outside a plugin registry. Free the returned info with bg_plugin_unref

◆ bg_plugin_registry_changed()

int bg_plugin_registry_changed ( bg_plugin_registry_t * reg)

Check if the plugin registry was changed.

Returns
1 if the registry was changed, 0 else

If this function returns 1, you should save the associated config registry also.

◆ bg_plugin_save_metadata()

void bg_plugin_save_metadata ( bg_plugin_handle_t * h)

Save the metadata to an xml file.