gmerlin
|
Plugin types and associated functions. More...
Modules | |
Plugin flags | |
Macros for the plugin flags. | |
Media input | |
Media input. | |
Audio output | |
Audio output. | |
Recorder | |
Recorder. | |
Video output | |
Video output. | |
Encoder | |
Encoder. | |
Encoding postprocessor | |
Encoding postprocessor. | |
Image support | |
Read and write image files. | |
A/V Filters | |
A/V Filters. | |
Audio Visualization plugins | |
Audio Visualization plugins. | |
Data Structures | |
struct | bg_device_info_t |
Device description. More... | |
struct | bg_plugin_common_s |
Base structure common to all plugins. More... | |
Typedefs | |
typedef int(* | bg_read_audio_func_t )(void *priv, gavl_audio_frame_t *frame, int stream, int num_samples) |
Generic prototype for reading audio. More... | |
typedef int(* | bg_read_video_func_t )(void *priv, gavl_video_frame_t *frame, int stream) |
Generic prototype for reading video. More... | |
typedef struct bg_plugin_common_s | bg_plugin_common_t |
Typedef for base structure common to all plugins. More... | |
Enumerations | |
enum | bg_plugin_type_t { BG_PLUGIN_NONE = 0, BG_PLUGIN_INPUT = (1<<0), BG_PLUGIN_OUTPUT_AUDIO = (1<<1), BG_PLUGIN_OUTPUT_VIDEO = (1<<2), BG_PLUGIN_RECORDER_AUDIO = (1<<3), BG_PLUGIN_RECORDER_VIDEO = (1<<4), BG_PLUGIN_ENCODER_AUDIO = (1<<5), BG_PLUGIN_ENCODER_VIDEO = (1<<6), BG_PLUGIN_ENCODER_SUBTITLE_TEXT = (1<<7), BG_PLUGIN_ENCODER_SUBTITLE_OVERLAY = (1<<8), BG_PLUGIN_ENCODER = (1<<9), BG_PLUGIN_ENCODER_PP = (1<<10), BG_PLUGIN_IMAGE_READER = (1<<11), BG_PLUGIN_IMAGE_WRITER = (1<<12), BG_PLUGIN_FILTER_AUDIO = (1<<13), BG_PLUGIN_FILTER_VIDEO = (1<<14), BG_PLUGIN_VISUALIZATION = (1<<15), BG_PLUGIN_AV_RECORDER = (1<<16) } |
Plugin types. More... | |
Functions | |
bg_device_info_t * | bg_device_info_append (bg_device_info_t *arr, const char *device, const char *name) |
Append device info to an existing array and return the new array. More... | |
void | bg_device_info_destroy (bg_device_info_t *arr) |
Free an array of device descriptions. More... | |
Plugin types and associated functions.
Gmerlin plugins are structs which contain function pointers and other data. The API looks a bit complicated, but many functions are optional, so plugins can, in prinpiple, be very simple. All plugins are based on a common struct (bg_plugin_common_t), which contains an identifier for the plugin type. The bg_plugin_common_t pointer can be casted to the derived plugin types.
The application calls the functions in the order, in which they are defined. Some functions are mandatory from the plugin view (i.e. they must be non-null), some functions are mandatory for the application (i.e. the application must check for them and call them if they are present.
The configuration of the plugins works entirely through the parameter passing mechanisms (see Parameter description). Configurable plugins only need to define get_parameters and set_parameter methods. Encoding plugins have an additional layer, which allows setting parameters individually for each stream.
Events, which are caught by the plugins (e.g. song name changes or mouse clicks) are propagated through optional callbacks. These are passed from the application to the plugin with the set_callbacks function. Applications should not rely on any callback to be actually supported by a plugin. Plugins should not rely on the presence of any callback
typedef int(* bg_read_audio_func_t)(void *priv, gavl_audio_frame_t *frame, int stream, int num_samples) |
Generic prototype for reading audio.
priv | Private data |
frame | Audio frame |
stream | Stream index (0 is only one stream) |
samples | Samples to read |
This is a generic prototype for reading audio. It's shared between input pluigns, recorders and filters to enable arbitrary chaining.
typedef int(* bg_read_video_func_t)(void *priv, gavl_video_frame_t *frame, int stream) |
Generic prototype for reading video.
priv | Private data |
frame | Video frame |
stream | Stream index (0 is only one stream) |
This is a generic prototype for reading audio. It's shared between input pluigns, recorders and filters to enable arbitrary chaining.
typedef struct bg_plugin_common_s bg_plugin_common_t |
Typedef for base structure common to all plugins.
enum bg_plugin_type_t |
Plugin types.
bg_device_info_t* bg_device_info_append | ( | bg_device_info_t * | arr, |
const char * | device, | ||
const char * | name | ||
) |
Append device info to an existing array and return the new array.
arr | An array (can be NULL) |
device | Device string |
name | Humanized description (can be NULL) |
This is used mainly by the device detection routines of the plugins
void bg_device_info_destroy | ( | bg_device_info_t * | arr | ) |
Free an array of device descriptions.
arr | a device array |