gmerlin
Modules | Data Structures | Typedefs | Enumerations | Functions
Plugins

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_tbg_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...
 

Detailed Description

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 Documentation

typedef int(* bg_read_audio_func_t)(void *priv, gavl_audio_frame_t *frame, int stream, int num_samples)

Generic prototype for reading audio.

Parameters
privPrivate data
frameAudio frame
streamStream index (0 is only one stream)
samplesSamples to read
Returns
The number of samples 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.

Parameters
privPrivate data
frameVideo frame
streamStream index (0 is only one stream)
Returns
1 if a frame could be read, 0 else

This is a generic prototype for reading audio. It's shared between input pluigns, recorders and filters to enable arbitrary chaining.

Typedef for base structure common to all plugins.

Enumeration Type Documentation

Plugin types.

Enumerator
BG_PLUGIN_NONE 

None or undefined.

BG_PLUGIN_INPUT 

Media input.

BG_PLUGIN_OUTPUT_AUDIO 

Audio output.

BG_PLUGIN_OUTPUT_VIDEO 

Video output.

BG_PLUGIN_RECORDER_AUDIO 

Audio recorder.

BG_PLUGIN_RECORDER_VIDEO 

Video recorder.

BG_PLUGIN_ENCODER_AUDIO 

Encoder for audio only.

BG_PLUGIN_ENCODER_VIDEO 

Encoder for video only.

BG_PLUGIN_ENCODER_SUBTITLE_TEXT 

Encoder for text subtitles only.

BG_PLUGIN_ENCODER_SUBTITLE_OVERLAY 

Encoder for overlay subtitles only.

BG_PLUGIN_ENCODER 

Encoder for multiple kinds of streams.

BG_PLUGIN_ENCODER_PP 

Encoder postprocessor (e.g. CD burner)

BG_PLUGIN_IMAGE_READER 

Image reader.

BG_PLUGIN_IMAGE_WRITER 

Image writer.

BG_PLUGIN_FILTER_AUDIO 

Audio filter.

BG_PLUGIN_FILTER_VIDEO 

Video filter.

BG_PLUGIN_VISUALIZATION 

Visualization.

BG_PLUGIN_AV_RECORDER 

Audio/Video recorder.

Function Documentation

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.

Parameters
arrAn array (can be NULL)
deviceDevice string
nameHumanized description (can be NULL)
Returns
Newly allocated array. The source array is freed.

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.

Parameters
arra device array