Loading...
Searching...
No Matches
pcm_extplug.h
Go to the documentation of this file.
/*
* ALSA external PCM plugin SDK (draft version)
*
* Copyright (c) 2005 Takashi Iwai <tiwai@suse.de>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#if !defined(__ALSA_PCM_EXTERNAL_H) && !defined(ALSA_LIBRARY_BUILD)
#warning "use #include <alsa/pcm_external.h>, <alsa/pcm_extplug.h> should not be used directly"
#include <alsa/pcm_external.h>
#endif
#ifndef __ALSA_PCM_EXTPLUG_H
#define __ALSA_PCM_EXTPLUG_H
enum {
SND_PCM_EXTPLUG_HW_FORMAT,
SND_PCM_EXTPLUG_HW_CHANNELS,
SND_PCM_EXTPLUG_HW_PARAMS
};
typedef struct snd_pcm_extplug snd_pcm_extplug_t;
typedef struct snd_pcm_extplug_callback snd_pcm_extplug_callback_t;
#ifdef DOC_HIDDEN
/* redefine typedefs for stupid doxygen */
typedef snd_pcm_extplug snd_pcm_extplug_t;
typedef snd_pcm_extplug_callback snd_pcm_extplug_callback_t;
#endif
/*
* Protocol version
*/
#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 ((SND_PCM_EXTPLUG_VERSION_MAJOR<<16) |\
(SND_PCM_EXTPLUG_VERSION_MINOR<<8) |\
(SND_PCM_EXTPLUG_VERSION_TINY))
struct snd_pcm_extplug {
unsigned int version;
const char *name;
const snd_pcm_extplug_callback_t *callback;
void *private_data;
snd_pcm_t *pcm;
snd_pcm_stream_t stream;
snd_pcm_format_t format;
snd_pcm_subformat_t subformat;
unsigned int channels;
unsigned int rate;
snd_pcm_format_t slave_format;
snd_pcm_subformat_t slave_subformat;
unsigned int slave_channels;
};
struct snd_pcm_extplug_callback {
snd_pcm_sframes_t (*transfer)(snd_pcm_extplug_t *ext,
const snd_pcm_channel_area_t *dst_areas,
snd_pcm_uframes_t dst_offset,
const snd_pcm_channel_area_t *src_areas,
snd_pcm_uframes_t src_offset,
snd_pcm_uframes_t size);
int (*close)(snd_pcm_extplug_t *ext);
int (*hw_params)(snd_pcm_extplug_t *ext, snd_pcm_hw_params_t *params);
int (*hw_free)(snd_pcm_extplug_t *ext);
void (*dump)(snd_pcm_extplug_t *ext, snd_output_t *out);
int (*init)(snd_pcm_extplug_t *ext);
snd_pcm_chmap_query_t **(*query_chmaps)(snd_pcm_extplug_t *ext);
snd_pcm_chmap_t *(*get_chmap)(snd_pcm_extplug_t *ext);
int (*set_chmap)(snd_pcm_extplug_t *ext, const snd_pcm_chmap_t *map);
};
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);
int snd_pcm_extplug_delete(snd_pcm_extplug_t *ext);
/* clear hw_parameter setting */
void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *ext);
/* hw_parameter setting */
int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
int snd_pcm_extplug_set_param_link(snd_pcm_extplug_t *extplug, int type,
int keep_link);
static __inline__ int snd_pcm_extplug_set_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
{
return snd_pcm_extplug_set_param_list(extplug, type, 1, &val);
}
static __inline__ int snd_pcm_extplug_set_slave_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
{
return snd_pcm_extplug_set_slave_param_list(extplug, type, 1, &val);
}
#endif /* __ALSA_PCM_EXTPLUG_H */
snd_config_t
struct _snd_config snd_config_t
Internal structure for a configuration node object.
Definition conf.h:74
snd_output_t
struct _snd_output snd_output_t
Internal structure for an output object.
Definition output.h:60
snd_pcm_extplug_callback_t
snd_pcm_extplug_callback snd_pcm_extplug_callback_t
Definition pcm_extplug.h:60
snd_pcm_extplug_delete
int snd_pcm_extplug_delete(snd_pcm_extplug_t *ext)
Delete the extplug instance.
Definition pcm_extplug.c:751
snd_pcm_extplug_create
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.
Definition pcm_extplug.c:676
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.
Definition pcm_extplug.c:851
snd_pcm_extplug_params_reset
void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *ext)
Reset extplug parameters.
Definition pcm_extplug.c:763
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.
Definition pcm_extplug.c:781
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.
Definition pcm_extplug.c:803
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.
Definition pcm_extplug.c:829
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 e...
Definition pcm_extplug.c:875
snd_pcm_extplug_t
snd_pcm_extplug snd_pcm_extplug_t
Definition pcm_extplug.h:59
SND_PCM_EXTPLUG_HW_CHANNELS
@ SND_PCM_EXTPLUG_HW_CHANNELS
Definition pcm_extplug.h:49
SND_PCM_EXTPLUG_HW_FORMAT
@ SND_PCM_EXTPLUG_HW_FORMAT
Definition pcm_extplug.h:48
SND_PCM_EXTPLUG_HW_PARAMS
@ SND_PCM_EXTPLUG_HW_PARAMS
Definition pcm_extplug.h:50
snd_pcm_subformat_t
snd_pcm_subformat_t
Definition pcm.h:288
snd_pcm_hw_params_t
struct _snd_pcm_hw_params snd_pcm_hw_params_t
Definition pcm.h:68
snd_pcm_sframes_t
long snd_pcm_sframes_t
Definition pcm.h:402
snd_pcm_t
struct _snd_pcm snd_pcm_t
Definition pcm.h:422
snd_pcm_format_t
snd_pcm_format_t
Definition pcm.h:129
snd_pcm_uframes_t
unsigned long snd_pcm_uframes_t
Definition pcm.h:400
snd_pcm_stream_t
snd_pcm_stream_t
Definition pcm.h:105
snd_pcm_channel_area_t
Definition pcm.h:496
snd_pcm_chmap_query_t
Definition pcm.h:652
snd_pcm_chmap_t
Definition pcm.h:646
snd_pcm_extplug_callback
Definition pcm_extplug.h:134
snd_pcm_extplug_callback::transfer
snd_pcm_sframes_t(* transfer)(snd_pcm_extplug_t *ext, const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset, snd_pcm_uframes_t size)
Definition pcm_extplug.h:138
snd_pcm_extplug_callback::close
int(* close)(snd_pcm_extplug_t *ext)
Definition pcm_extplug.h:147
snd_pcm_extplug_callback::dump
void(* dump)(snd_pcm_extplug_t *ext, snd_output_t *out)
Definition pcm_extplug.h:159
snd_pcm_extplug_callback::set_chmap
int(* set_chmap)(snd_pcm_extplug_t *ext, const snd_pcm_chmap_t *map)
Definition pcm_extplug.h:175
snd_pcm_extplug_callback::init
int(* init)(snd_pcm_extplug_t *ext)
Definition pcm_extplug.h:163
snd_pcm_extplug_callback::hw_params
int(* hw_params)(snd_pcm_extplug_t *ext, snd_pcm_hw_params_t *params)
Definition pcm_extplug.h:151
snd_pcm_extplug_callback::hw_free
int(* hw_free)(snd_pcm_extplug_t *ext)
Definition pcm_extplug.h:155
snd_pcm_extplug
Definition pcm_extplug.h:77
snd_pcm_extplug::name
const char * name
Definition pcm_extplug.h:86
snd_pcm_extplug::slave_subformat
snd_pcm_subformat_t slave_subformat
Definition pcm_extplug.h:126
snd_pcm_extplug::pcm
snd_pcm_t * pcm
Definition pcm_extplug.h:98
snd_pcm_extplug::stream
snd_pcm_stream_t stream
Definition pcm_extplug.h:102
snd_pcm_extplug::format
snd_pcm_format_t format
Definition pcm_extplug.h:106
snd_pcm_extplug::private_data
void * private_data
Definition pcm_extplug.h:94
snd_pcm_extplug::channels
unsigned int channels
Definition pcm_extplug.h:114
snd_pcm_extplug::slave_channels
unsigned int slave_channels
Definition pcm_extplug.h:130
snd_pcm_extplug::callback
const snd_pcm_extplug_callback_t * callback
Definition pcm_extplug.h:90
snd_pcm_extplug::rate
unsigned int rate
Definition pcm_extplug.h:118
snd_pcm_extplug::version
unsigned int version
Definition pcm_extplug.h:82
snd_pcm_extplug::subformat
snd_pcm_subformat_t subformat
Definition pcm_extplug.h:110
snd_pcm_extplug::slave_format
snd_pcm_format_t slave_format
Definition pcm_extplug.h:122
type
uint8_t type
Definition ump_msg.h:1