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

@ -182,6 +182,13 @@ typedef enum _snd_ctl_event_type {
/** Mute state */
#define SND_CTL_TLV_DB_GAIN_MUTE -9999999
/** TLV type - fixed channel map positions */
#define SND_CTL_TLVT_CHMAP_FIXED 0x00101
/** TLV type - freely swappable channel map positions */
#define SND_CTL_TLVT_CHMAP_VAR 0x00102
/** TLV type - pair-wise swappable channel map positions */
#define SND_CTL_TLVT_CHMAP_PAIRED 0x00103
/** CTL type */
typedef enum _snd_ctl_type {
/** Kernel level CTL */

View file

@ -474,6 +474,18 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
int snd_pcm_unlink(snd_pcm_t *pcm);
enum {
SND_CHMAP_NONE = 0, /** unspecified channel position */
SND_CHMAP_FIXED, /** fixed channel position */
SND_CHMAP_VAR, /** freely swappable channel position */
SND_CHMAP_PAIRED, /** pair-wise swappable channel position */
};
int **snd_pcm_query_chmaps(snd_pcm_t *pcm);
void snd_pcm_free_chmaps(int **maps);
int *snd_pcm_get_chmap(snd_pcm_t *pcm);
int snd_pcm_set_chmap(snd_pcm_t *pcm, const int *map);
//int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
/*

View file

@ -477,6 +477,31 @@ enum {
SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
};
/* channel positions */
enum {
SNDRV_CHMAP_UNKNOWN = 0,
SNDRV_CHMAP_FL, /* front left */
SNDRV_CHMAP_FC, /* front center */
SNDRV_CHMAP_FR, /* front right */
SNDRV_CHMAP_FLC, /* front left center */
SNDRV_CHMAP_FRC, /* front right center */
SNDRV_CHMAP_RL, /* rear left */
SNDRV_CHMAP_RC, /* rear center */
SNDRV_CHMAP_RR, /* rear right */
SNDRV_CHMAP_RLC, /* rear left center */
SNDRV_CHMAP_RRC, /* rear right center */
SNDRV_CHMAP_SL, /* side left */
SNDRV_CHMAP_SR, /* side right */
SNDRV_CHMAP_LFE, /* LFE */
SNDRV_CHMAP_FLW, /* front left wide */
SNDRV_CHMAP_FRW, /* front right wide */
SNDRV_CHMAP_FLH, /* front left high */
SNDRV_CHMAP_FCH, /* front center high */
SNDRV_CHMAP_FRH, /* front right high */
SNDRV_CHMAP_TC, /* top center */
SNDRV_CHMAP_LAST = SNDRV_CHMAP_TC,
};
enum {
SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct sndrv_pcm_info),