Implement the channel mapping API

Added new channel-mapping API functions.
Not all plugins are covered, especially the route, multi and external
plugins don't work yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2012-07-25 15:05:15 +02:00
parent 1ef1c5cdb4
commit 3c4a22ea49
27 changed files with 386 additions and 0 deletions

View file

@ -7302,6 +7302,61 @@ OBSOLETE1(snd_pcm_sw_params_get_silence_size, ALSA_0.9, ALSA_0.9.0rc4);
#endif /* DOC_HIDDEN */
/**
* \!brief Query the available channel maps
* \param pcm PCM handle to query
* \return the NULL-terminated array of integer pointers, each of
* which contains the channel map. A channel map is represented by an
* integer array, beginning with the channel map type, followed by the
* number of channels, and the position of each channel.
*/
int **snd_pcm_query_chmaps(snd_pcm_t *pcm)
{
if (!pcm->ops->query_chmaps)
return NULL;
return pcm->ops->query_chmaps(pcm);
}
/**
* \!brief Release the channel map array allocated via #snd_pcm_query_chmaps
* \param maps the array pointer to release
*/
void snd_pcm_free_chmaps(int **maps)
{
int **p;
if (!maps)
return;
for (p = maps; *p; p++)
free(*p);
free(maps);
}
/**
* \!brief Get the current channel map
* \param pcm PCM instance
* \return the current channel map, or NULL if error
*/
int *snd_pcm_get_chmap(snd_pcm_t *pcm)
{
if (!pcm->ops->get_chmap)
return NULL;
return pcm->ops->get_chmap(pcm);
}
/**
* \!brief Configure the current channel map
* \param pcm PCM instance
* \param map the channel map to write
* \return zero if succeeded, or a negative error code
*/
int snd_pcm_set_chmap(snd_pcm_t *pcm, const int *map)
{
if (!pcm->ops->set_chmap)
return -ENXIO;
return pcm->ops->set_chmap(pcm, map);
}
/*
* basic helpers
*/