ALSA project - the C library reference
Data Structures | Macros | Typedefs | Enumerations | Functions
External Filter plugin SDK
Collaboration diagram for External Filter plugin SDK:

Data Structures

struct  snd_pcm_extplug_t
 
struct  snd_pcm_extplug_callback_t
 

Macros

#define SND_PCM_EXTPLUG_VERSION_MAJOR   1
 
#define SND_PCM_EXTPLUG_VERSION_MINOR   0
 
#define SND_PCM_EXTPLUG_VERSION_TINY   2
 
#define SND_PCM_EXTPLUG_VERSION
 

Typedefs

typedef snd_pcm_extplug snd_pcm_extplug_t
 
typedef snd_pcm_extplug_callback snd_pcm_extplug_callback_t
 

Enumerations

enum  { SND_PCM_EXTPLUG_HW_FORMAT , SND_PCM_EXTPLUG_HW_CHANNELS , SND_PCM_EXTPLUG_HW_PARAMS }
 

Functions

int snd_pcm_extplug_create (snd_pcm_extplug_t *ext, const char *name, snd_config_t *root, snd_config_t *slave_conf, snd_pcm_stream_t stream, int mode)
 Create an extplug instance. More...
 
int snd_pcm_extplug_delete (snd_pcm_extplug_t *ext)
 Delete the extplug instance. More...
 
void snd_pcm_extplug_params_reset (snd_pcm_extplug_t *ext)
 Reset extplug parameters. More...
 
int snd_pcm_extplug_set_param_list (snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list)
 Set master parameter as the list. More...
 
int snd_pcm_extplug_set_param_minmax (snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max)
 Set master parameter as the min/max values. More...
 
int snd_pcm_extplug_set_slave_param_list (snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list)
 Set slave parameter as the list. More...
 
int snd_pcm_extplug_set_slave_param_minmax (snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max)
 Set slave parameter as the min/max values. More...
 
int snd_pcm_extplug_set_param_link (snd_pcm_extplug_t *extplug, int type, int keep_link)
 Keep the client and slave format/channels the same if requested. This is for example useful if this extplug does not support any channel conversion. More...
 

Detailed Description

See the PCM (digital audio) interface page for more details.

Macro Definition Documentation

◆ SND_PCM_EXTPLUG_VERSION

#define SND_PCM_EXTPLUG_VERSION
Value:
#define SND_PCM_EXTPLUG_VERSION_MINOR
Definition: pcm_extplug.h:62
#define SND_PCM_EXTPLUG_VERSION_TINY
Definition: pcm_extplug.h:63
#define SND_PCM_EXTPLUG_VERSION_MAJOR
Definition: pcm_extplug.h:61

Filter-plugin protocol version

◆ SND_PCM_EXTPLUG_VERSION_MAJOR

#define SND_PCM_EXTPLUG_VERSION_MAJOR   1

Protocol major version

◆ SND_PCM_EXTPLUG_VERSION_MINOR

#define SND_PCM_EXTPLUG_VERSION_MINOR   0

Protocol minor version

◆ SND_PCM_EXTPLUG_VERSION_TINY

#define SND_PCM_EXTPLUG_VERSION_TINY   2

Protocol tiny version

Typedef Documentation

◆ snd_pcm_extplug_callback_t

Callback table of extplug

◆ snd_pcm_extplug_t

Handle of external filter plugin

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

hw constraints for extplug

Enumerator
SND_PCM_EXTPLUG_HW_FORMAT 

format

SND_PCM_EXTPLUG_HW_CHANNELS 

channels

SND_PCM_EXTPLUG_HW_PARAMS 

max number of hw constraints

Function Documentation

◆ snd_pcm_extplug_create()

int snd_pcm_extplug_create ( snd_pcm_extplug_t extplug,
const char *  name,
snd_config_t root,
snd_config_t slave_conf,
snd_pcm_stream_t  stream,
int  mode 
)

Create an extplug instance.

Parameters
extplugthe extplug handle
namename of the PCM
rootconfiguration tree root
slave_confslave configuration root
streamstream direction
modePCM open mode
Returns
0 if successful, or a negative error code

Creates the extplug instance based on the given handle. The slave_conf argument is mandatory, and usually taken from the config tree of the PCM plugin as "slave" config value. name, root, stream and mode arguments are the values used for opening the PCM.

The callback is the mandatory field of extplug handle. At least, start, stop and pointer callbacks must be set before calling this function.

◆ snd_pcm_extplug_delete()

int snd_pcm_extplug_delete ( snd_pcm_extplug_t extplug)

Delete the extplug instance.

Parameters
extplugthe extplug handle to delete
Returns
0 if successful, or a negative error code

The destructor of extplug instance. Closes the PCM and deletes the associated resources.

◆ snd_pcm_extplug_params_reset()

void snd_pcm_extplug_params_reset ( snd_pcm_extplug_t extplug)

Reset extplug parameters.

Parameters
extplugthe extplug handle

Resets the all parameters for the given extplug handle.

◆ snd_pcm_extplug_set_param_link()

int snd_pcm_extplug_set_param_link ( snd_pcm_extplug_t extplug,
int  type,
int  keep_link 
)

Keep the client and slave format/channels the same if requested. This is for example useful if this extplug does not support any channel conversion.

Parameters
extplugthe extplug handle
typeparameter type
keep_linkif 1 the parameter identified by type will be kept the same for the client and slave PCM of this extplug
Returns
0 if successful, or a negative error code

◆ snd_pcm_extplug_set_param_list()

int snd_pcm_extplug_set_param_list ( snd_pcm_extplug_t extplug,
int  type,
unsigned int  num_list,
const unsigned int *  list 
)

Set master parameter as the list.

Parameters
extplugthe extplug handle
typeparameter type
num_listnumber of available values
listthe list of available values
Returns
0 if successful, or a negative error code

Sets the master parameter as the list. The available values of the given parameter type of this PCM (as input) is restricted to the ones of the given list.

◆ snd_pcm_extplug_set_param_minmax()

int snd_pcm_extplug_set_param_minmax ( snd_pcm_extplug_t extplug,
int  type,
unsigned int  min,
unsigned int  max 
)

Set master parameter as the min/max values.

Parameters
extplugthe extplug handle
typeparameter type
minthe minimum value
maxthe maximum value
Returns
0 if successful, or a negative error code

Sets the master parameter as the min/max values. The available values of the given parameter type of this PCM (as input) is restricted between the given minimum and maximum values.

◆ snd_pcm_extplug_set_slave_param_list()

int snd_pcm_extplug_set_slave_param_list ( snd_pcm_extplug_t extplug,
int  type,
unsigned int  num_list,
const unsigned int *  list 
)

Set slave parameter as the list.

Parameters
extplugthe extplug handle
typeparameter type
num_listnumber of available values
listthe list of available values
Returns
0 if successful, or a negative error code

Sets the slave parameter as the list. The available values of the given parameter type of the slave PCM is restricted to the ones of the given list.

◆ snd_pcm_extplug_set_slave_param_minmax()

int snd_pcm_extplug_set_slave_param_minmax ( snd_pcm_extplug_t extplug,
int  type,
unsigned int  min,
unsigned int  max 
)

Set slave parameter as the min/max values.

Parameters
extplugthe extplug handle
typeparameter type
minthe minimum value
maxthe maximum value
Returns
0 if successful, or a negative error code

Sets the slave parameter as the min/max values. The available values of the given parameter type of the slave PCM is restricted between the given minimum and maximum values.