MPD
Data Structures | Functions
filter_plugin.h File Reference

This header declares the filter_plugin class. More...

#include <glib.h>
#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  filter_plugin
 

Functions

struct filterfilter_new (const struct filter_plugin *plugin, const struct config_param *param, GError **error_r)
 Creates a new instance of the specified filter plugin.
 
struct filterfilter_configured_new (const struct config_param *param, GError **error_r)
 Creates a new filter, loads configuration and the plugin name from the specified configuration section.
 
void filter_free (struct filter *filter)
 Deletes a filter.
 
struct audio_formatfilter_open (struct filter *filter, struct audio_format *audio_format, GError **error_r)
 Opens the filter, preparing it for filter_filter().
 
void filter_close (struct filter *filter)
 Closes the filter.
 
const void * filter_filter (struct filter *filter, const void *src, size_t src_size, size_t *dest_size_r, GError **error_r)
 Filters a block of PCM data.
 

Detailed Description

This header declares the filter_plugin class.

It describes a plugin API for objects which filter raw PCM data.

Definition in file filter_plugin.h.

Function Documentation

void filter_close ( struct filter filter)

Closes the filter.

After that, you may call filter_open() again.

Parameters
filterthe filter object
struct filter* filter_configured_new ( const struct config_param param,
GError **  error_r 
)
read

Creates a new filter, loads configuration and the plugin name from the specified configuration section.

Parameters
paramthe configuration section
errorlocation to store the error occuring, or NULL to ignore errors.
Returns
a new filter object, or NULL on error
const void* filter_filter ( struct filter filter,
const void *  src,
size_t  src_size,
size_t *  dest_size_r,
GError **  error_r 
)

Filters a block of PCM data.

Parameters
filterthe filter object
srcthe input buffer
src_sizethe size of #src_buffer in bytes
dest_size_rthe size of the returned buffer
errorlocation to store the error occuring, or NULL to ignore errors.
Returns
the destination buffer on success (will be invalidated by filter_close() or filter_filter()), NULL on error
void filter_free ( struct filter filter)

Deletes a filter.

It must be closed prior to calling this function, see filter_close().

Parameters
filterthe filter object
struct filter* filter_new ( const struct filter_plugin plugin,
const struct config_param param,
GError **  error_r 
)
read

Creates a new instance of the specified filter plugin.

Parameters
pluginthe filter plugin
paramoptional configuration section
errorlocation to store the error occuring, or NULL to ignore errors.
Returns
a new filter object, or NULL on error
struct audio_format* filter_open ( struct filter filter,
struct audio_format audio_format,
GError **  error_r 
)
read

Opens the filter, preparing it for filter_filter().

Parameters
filterthe filter object
audio_formatthe audio format of incoming data; the plugin may modify the object to enforce another input format
errorlocation to store the error occuring, or NULL to ignore errors.
Returns
the format of outgoing data