]> git.alsa-project.org Git - alsa-lib.git/commitdiff
PCM: Define MONO and other channel map positions
authorTakashi Iwai <tiwai@suse.de>
Wed, 12 Sep 2012 16:43:59 +0000 (18:43 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 13 Sep 2012 06:24:59 +0000 (08:24 +0200)
Follow the new definitions in the kernel side.  MONO and others have
been added, and the order of position table was changed again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/pcm.h
include/sound/asound.h
src/pcm/pcm.c

index 8129ed344533a1b652b7eaa95f82a0f3291b2d02..5fb6130f1ba45ad70251789e6beb50060df35458 100644 (file)
@@ -489,6 +489,8 @@ enum snd_pcm_chmap_type {
 /** channel positions */
 enum snd_pcm_chmap_position {
        SND_CHMAP_UNKNOWN = 0,  /** unspecified */
+       SND_CHMAP_NA,           /** N/A, silent */
+       SND_CHMAP_MONO,         /** mono stream */
        SND_CHMAP_FL,           /** front left */
        SND_CHMAP_FR,           /** front right */
        SND_CHMAP_RL,           /** rear left */
@@ -508,8 +510,13 @@ enum snd_pcm_chmap_position {
        SND_CHMAP_FCH,          /** front center high */
        SND_CHMAP_FRH,          /** front right high */
        SND_CHMAP_TC,           /** top center */
-       SND_CHMAP_NA,           /** N/A, silent */
-       SND_CHMAP_LAST = SND_CHMAP_NA,  /** last entry */
+       SND_CHMAP_TFL,          /** top front left */
+       SND_CHMAP_TFR,          /** top front right */
+       SND_CHMAP_TFC,          /** top front center */
+       SND_CHMAP_TRL,          /** top rear left */
+       SND_CHMAP_TRR,          /** top rear right */
+       SND_CHMAP_TRC,          /** top rear center */
+       SND_CHMAP_LAST = SND_CHMAP_TRC, /** last entry */
 };
 
 #define SND_CHMAP_POSITION_MASK                0xffff /** bitmask for channel position */
index cb1b9c584a09bf4a9d14ff838739e74092cabc07..e24d144a59d77740ae49d80f49f439ab4fbd4746 100644 (file)
@@ -479,8 +479,10 @@ enum {
 
 /* channel positions */
 enum {
-       /* this follows the alsa-lib mixer channel value + 1 */
        SNDRV_CHMAP_UNKNOWN = 0,
+       SNDRV_CHMAP_NA,         /* N/A, silent */
+       SNDRV_CHMAP_MONO,       /* mono stream */
+       /* this follows the alsa-lib mixer channel value + 3 */
        SNDRV_CHMAP_FL,         /* front left */
        SNDRV_CHMAP_FR,         /* front right */
        SNDRV_CHMAP_RL,         /* rear left */
@@ -501,8 +503,13 @@ enum {
        SNDRV_CHMAP_FCH,        /* front center high */
        SNDRV_CHMAP_FRH,        /* front right high */
        SNDRV_CHMAP_TC,         /* top center */
-       SNDRV_CHMAP_NA,         /* N/A, silent */
-       SNDRV_CHMAP_LAST = SNDRV_CHMAP_NA,
+       SNDRV_CHMAP_TFL,        /* top front left */
+       SNDRV_CHMAP_TFR,        /* top front right */
+       SNDRV_CHMAP_TFC,        /* top front center */
+       SNDRV_CHMAP_TRL,        /* top rear left */
+       SNDRV_CHMAP_TRR,        /* top rear right */
+       SNDRV_CHMAP_TRC,        /* top rear center */
+       SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
 };
 
 #define SNDRV_CHMAP_POSITION_MASK      0xffff
index 19a9abe4a5cd005245ba01f9572f415265b7bc69..d01fa90ddb9094817f4f78ce27b009fd0731ba25 100644 (file)
@@ -7375,7 +7375,7 @@ const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val)
 
 #define _NAME(n) [SND_CHMAP_##n] = #n
 static const char *chmap_names[SND_CHMAP_LAST + 1] = {
-       _NAME(UNKNOWN),
+       _NAME(UNKNOWN), _NAME(NA), _NAME(MONO),
        _NAME(FL), _NAME(FR),
        _NAME(RL), _NAME(RR),
        _NAME(FC), _NAME(LFE),
@@ -7383,7 +7383,8 @@ static const char *chmap_names[SND_CHMAP_LAST + 1] = {
        _NAME(RC), _NAME(FLC), _NAME(FRC), _NAME(RLC), _NAME(RRC),
        _NAME(FLW), _NAME(FRW),
        _NAME(FLH), _NAME(FCH), _NAME(FRH), _NAME(TC),
-       _NAME(NA),
+       _NAME(TFL), _NAME(TFR), _NAME(TFC),
+       _NAME(TRL), _NAME(TRR), _NAME(TRC),
 };
 #undef _NAME
 
@@ -7397,6 +7398,8 @@ const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val)
 
 static const char *chmap_long_names[SND_CHMAP_LAST + 1] = {
        [SND_CHMAP_UNKNOWN] = "Unknown",
+       [SND_CHMAP_NA] = "Unused",
+       [SND_CHMAP_MONO] = "Mono",
        [SND_CHMAP_FL] = "Front Left",
        [SND_CHMAP_FR] = "Front Right",
        [SND_CHMAP_RL] = "Rear Left",
@@ -7416,7 +7419,12 @@ static const char *chmap_long_names[SND_CHMAP_LAST + 1] = {
        [SND_CHMAP_FCH] = "Front Center High",
        [SND_CHMAP_FRH] = "Front Right High",
        [SND_CHMAP_TC] = "Top Center",
-       [SND_CHMAP_NA] = "Unused",
+       [SND_CHMAP_TFL] = "Top Front Left",
+       [SND_CHMAP_TFR] = "Top Front Right",
+       [SND_CHMAP_TFC] = "Top Front Center",
+       [SND_CHMAP_TRL] = "Top Rear Left",
+       [SND_CHMAP_TRR] = "Top Rear Right",
+       [SND_CHMAP_TRC] = "Top Rear Center",
 };
 
 const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val)