gmerlin
Typedefs | Functions
Filter chains

Chains of A/V filters. More...

Typedefs

typedef struct
bg_audio_filter_chain_s 
bg_audio_filter_chain_t
 Audio filter chain.
typedef struct
bg_video_filter_chain_s 
bg_video_filter_chain_t
 Video filter chain.

Functions

bg_audio_filter_chain_tbg_audio_filter_chain_create (const bg_gavl_audio_options_t *opt, bg_plugin_registry_t *plugin_reg)
 Create an audio filter chain.
const bg_parameter_info_tbg_audio_filter_chain_get_parameters (bg_audio_filter_chain_t *ch)
 Return parameters.
void bg_audio_filter_chain_set_parameter (void *data, const char *name, const bg_parameter_value_t *val)
 Set a parameter for an audio chain.
int bg_audio_filter_chain_need_rebuild (bg_audio_filter_chain_t *ch)
 Check if an audio filter chain needs to be rebuilt.
int bg_audio_filter_chain_need_restart (bg_audio_filter_chain_t *ch)
 Check if an audio filter chain needs to be restarted.
void bg_audio_filter_chain_connect_input (bg_audio_filter_chain_t *ch, bg_read_audio_func_t func, void *priv, int stream)
 Set input callback of an audio filter chain.
int bg_audio_filter_chain_init (bg_audio_filter_chain_t *ch, const gavl_audio_format_t *in_format, gavl_audio_format_t *out_format)
 Initialize an audio filter chain.
void bg_audio_filter_chain_set_input_format (bg_audio_filter_chain_t *ch, const gavl_audio_format_t *in_format)
 Change the input format of an audio filter chain.
int bg_audio_filter_chain_set_out_format (bg_audio_filter_chain_t *ch, const gavl_audio_format_t *out_format)
 Set output format of an audio filter chain.
int bg_audio_filter_chain_read (void *priv, gavl_audio_frame_t *frame, int stream, int num_samples)
 Read a audio samples from an audio filter chain.
void bg_audio_filter_chain_destroy (bg_audio_filter_chain_t *ch)
 Destroy an audio filter chain.
void bg_audio_filter_chain_lock (bg_audio_filter_chain_t *ch)
 Lock an audio filter chain.
void bg_audio_filter_chain_unlock (bg_audio_filter_chain_t *ch)
 Unlock an audio filter chain.
void bg_audio_filter_chain_reset (bg_audio_filter_chain_t *ch)
 Reset an audio filter chain.
bg_video_filter_chain_tbg_video_filter_chain_create (const bg_gavl_video_options_t *opt, bg_plugin_registry_t *plugin_reg)
 Create a video filter chain.
const bg_parameter_info_tbg_video_filter_chain_get_parameters (bg_video_filter_chain_t *ch)
 Return parameters.
void bg_video_filter_chain_set_parameter (void *data, const char *name, const bg_parameter_value_t *val)
 Set a parameter for a video chain.
int bg_video_filter_chain_need_rebuild (bg_video_filter_chain_t *ch)
 Check if a video filter chain needs to be rebuilt.
int bg_video_filter_chain_need_restart (bg_video_filter_chain_t *ch)
 Check if a video filter chain needs to be restarted.
void bg_video_filter_chain_connect_input (bg_video_filter_chain_t *ch, bg_read_video_func_t func, void *priv, int stream)
 Set input callback of a video filter chain.
int bg_video_filter_chain_init (bg_video_filter_chain_t *ch, const gavl_video_format_t *in_format, gavl_video_format_t *out_format)
 Initialize a video filter chain.
void bg_video_filter_chain_set_input_format (bg_video_filter_chain_t *ch, const gavl_video_format_t *in_format)
 Change the input format of a video filter chain.
int bg_video_filter_chain_set_out_format (bg_video_filter_chain_t *ch, const gavl_video_format_t *out_format)
 Set output format of a video filter chain.
int bg_video_filter_chain_read (void *priv, gavl_video_frame_t *frame, int stream)
 Read a video frame from a video filter chain.
void bg_video_filter_chain_destroy (bg_video_filter_chain_t *ch)
 Destroy a video filter chain.
void bg_video_filter_chain_lock (bg_video_filter_chain_t *ch)
 Lock a video filter chain.
void bg_video_filter_chain_unlock (bg_video_filter_chain_t *ch)
 Unlock a video filter chain.
void bg_video_filter_chain_reset (bg_video_filter_chain_t *ch)
 Reset a video filter chain.

Detailed Description

Chains of A/V filters.


Typedef Documentation

typedef struct bg_audio_filter_chain_s bg_audio_filter_chain_t

Audio filter chain.

Opaque handle for an audio filter chain. You don't want to know, what's inside.

typedef struct bg_video_filter_chain_s bg_video_filter_chain_t

Video filter chain.

Opaque handle for a video filter chain. You don't want to know, what's inside.


Function Documentation

bg_audio_filter_chain_t* bg_audio_filter_chain_create ( const bg_gavl_audio_options_t *  opt,
bg_plugin_registry_t plugin_reg 
)

Create an audio filter chain.

Parameters:
optConversion options
plugin_regA plugin registry

The conversion options should be valid for the whole lifetime of the filter chain.

Return parameters.

Parameters:
chAn audio filter chain
Returns:
A NULL terminated array of parameter descriptions

Usually, there will be a parameter of type BG_PARAMETER_MULTI_CHAIN, which includes all installed filters and their respective parameters.

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

Set a parameter for an audio chain.

Parameters:
dataAn audio converter as void*
nameName
valValue

In some cases the filter chain must be rebuilt after setting a parameter. The application should therefore call bg_audio_filter_chain_need_rebuild and call bg_audio_filter_chain_init if necessary.

Check if an audio filter chain needs to be rebuilt.

Parameters:
chAn audio filter chain
Returns:
1 if the chain must be rebuilt, 0 else

If this returns true, you should call bg_audio_filter_chain_rebuild or bg_audio_filter_chain_init. It's usually used after bg_audio_filter_chain_set_parameter.

Check if an audio filter chain needs to be restarted.

Parameters:
chAn audio filter chain
Returns:
1 if the chain must be restarted, 0 else

If this returns true, you should call bg_audio_filter_chain_init. It's usually used after bg_audio_filter_chain_set_parameter.

void bg_audio_filter_chain_connect_input ( bg_audio_filter_chain_t ch,
bg_read_audio_func_t  func,
void *  priv,
int  stream 
)

Set input callback of an audio filter chain.

Parameters:
chAn audio filter chain
funcThe function to call
privThe private handle to pass to func
streamThe stream argument to pass to func

This function must be called before bg_audio_filter_chain_init.

int bg_audio_filter_chain_init ( bg_audio_filter_chain_t ch,
const gavl_audio_format_t in_format,
gavl_audio_format_t out_format 
)

Initialize an audio filter chain.

Parameters:
chAn audio filter chain
in_formatInput format
out_formatReturns the output format

Change the input format of an audio filter chain.

Parameters:
chAn audio filter chain
in_formatNew input format

Set output format of an audio filter chain.

Parameters:
chAn audio filter chain
out_formatOutput format
Returns:
The number of conversion steps

This function initializes a final audio converter at the output for delivering the desired format.

int bg_audio_filter_chain_read ( void *  priv,
gavl_audio_frame_t frame,
int  stream,
int  num_samples 
)

Read a audio samples from an audio filter chain.

Parameters:
privAn audio filter chain
frameAn audio frame
streamStream number (must be 0)
num_samplesNumber of samples to read
Returns:
Number of samples read, 0 means EOF.

Destroy an audio filter chain.

Parameters:
chAn audio filter chain

Lock an audio filter chain.

Parameters:
chAn audio filter chain

In multithreaded enviroments, you must lock the chain for calls to bg_audio_filter_chain_set_parameter and bg_audio_filter_chain_read.

Unlock an audio filter chain.

Parameters:
chAn audio filter chain

In multithreaded enviroments, you must lock the chain for calls to bg_audio_filter_chain_set_parameter and bg_audio_filter_chain_read.

Reset an audio filter chain.

Parameters:
chAn audio filter chain

Set the internal state as if no sample has been processed since last init

bg_video_filter_chain_t* bg_video_filter_chain_create ( const bg_gavl_video_options_t *  opt,
bg_plugin_registry_t plugin_reg 
)

Create a video filter chain.

Parameters:
optConversion options
plugin_regA plugin registry

The conversion options should be valid for the whole lifetime of the filter chain.

Return parameters.

Parameters:
chA video filter chain
Returns:
A NULL terminated array of parameter descriptions

Usually, there will be a parameter of type BG_PARAMETER_MULTI_CHAIN, which includes all installed filters and their respective parameters.

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

Set a parameter for a video chain.

Parameters:
dataA video converter as void*
nameName
valValue

In some cases the filter chain must be rebuilt after setting a parameter. The application should therefore call bg_video_filter_chain_need_rebuild and call bg_video_filter_chain_init if necessary.

Check if a video filter chain needs to be rebuilt.

Parameters:
chA video filter chain
Returns:
1 if the chain must be rebuilt, 0 else

If this returns true, you should call bg_video_filter_chain_init. It's usually used after bg_video_filter_chain_set_parameter.

Check if a video filter chain needs to be restarted.

Parameters:
chA video filter chain
Returns:
1 if the chain must be restarted, 0 else

If this returns true, you should call bg_video_filter_chain_init. It's usually used after bg_video_filter_chain_set_parameter.

void bg_video_filter_chain_connect_input ( bg_video_filter_chain_t ch,
bg_read_video_func_t  func,
void *  priv,
int  stream 
)

Set input callback of a video filter chain.

Parameters:
chA video filter chain
funcThe function to call
privThe private handle to pass to func
streamThe stream argument to pass to func

This function must be called before bg_video_filter_chain_init.

int bg_video_filter_chain_init ( bg_video_filter_chain_t ch,
const gavl_video_format_t in_format,
gavl_video_format_t out_format 
)

Initialize a video filter chain.

Parameters:
chA video filter chain
in_formatInput format
out_formatReturns the output format

Change the input format of a video filter chain.

Parameters:
chAn video filter chain
in_formatNew input format

Set output format of a video filter chain.

Parameters:
chA video filter chain
out_formatOutput format

This function initializes a final video converter at the output for delivering the desired format.

int bg_video_filter_chain_read ( void *  priv,
gavl_video_frame_t frame,
int  stream 
)

Read a video frame from a video filter chain.

Parameters:
privA video filter chain
frameA video frame
streamStream number (must be 0)
Returns:
1 if a frame was read, 0 means EOF.

Destroy a video filter chain.

Parameters:
chA video filter chain

Lock a video filter chain.

Parameters:
chA video filter chain

In multithreaded enviroments, you must lock the chain for calls to bg_video_filter_chain_set_parameter and bg_video_filter_chain_read.

Unlock a video filter chain.

Parameters:
chA video filter chain

In multithreaded enviroments, you must lock the chain for calls to bg_video_filter_chain_set_parameter and bg_video_filter_chain_read.

Reset a video filter chain.

Parameters:
chA video filter chain

Set the internal state as if no sample has been processed since last init