summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-05-17 13:06:04 +0000
committerLennart Poettering <lennart@poettering.net>2006-05-17 13:06:04 +0000
commited3606c88480de9b348dee451e7ebfd1f6bd15d7 (patch)
tree137e6e340e852eaa508f9967c05429d8cdf1861a
parente767fda182739827c6e8a4b843c826409b8fbc80 (diff)
add new channel mapping standard PA_CHANNEL_MAP_OSS
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@895 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/polyp/channelmap.c35
-rw-r--r--src/polyp/channelmap.h7
2 files changed, 39 insertions, 3 deletions
diff --git a/src/polyp/channelmap.c b/src/polyp/channelmap.c
index 1e6347d6..7266a0a0 100644
--- a/src/polyp/channelmap.c
+++ b/src/polyp/channelmap.c
@@ -273,6 +273,41 @@ pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, p
return NULL;
}
+ case PA_CHANNEL_MAP_OSS:
+
+ switch (channels) {
+ case 1:
+ m->map[0] = PA_CHANNEL_POSITION_MONO;
+ return m;
+
+ case 8:
+ m->map[6] = PA_CHANNEL_POSITION_REAR_LEFT;
+ m->map[7] = PA_CHANNEL_POSITION_REAR_RIGHT;
+ /* Fall through */
+
+ case 6:
+ m->map[4] = PA_CHANNEL_POSITION_SIDE_LEFT;
+ m->map[5] = PA_CHANNEL_POSITION_SIDE_RIGHT;
+ /* Fall through */
+
+ case 4:
+ m->map[3] = PA_CHANNEL_POSITION_LFE;
+ /* Fall through */
+
+ case 3:
+ m->map[2] = PA_CHANNEL_POSITION_FRONT_CENTER;
+ /* Fall through */
+
+ case 2:
+ m->map[0] = PA_CHANNEL_POSITION_FRONT_LEFT;
+ m->map[1] = PA_CHANNEL_POSITION_FRONT_RIGHT;
+ return m;
+
+ default:
+ return NULL;
+ }
+
+
default:
return NULL;
}
diff --git a/src/polyp/channelmap.h b/src/polyp/channelmap.h
index c9fae17e..feccd284 100644
--- a/src/polyp/channelmap.h
+++ b/src/polyp/channelmap.h
@@ -122,10 +122,11 @@ typedef enum pa_channel_position {
/** A list of channel mapping definitions for pa_channel_map_init_auto() */
typedef enum pa_channel_map_def {
- PA_CHANNEL_MAP_AIFF, /**< The mapping from RFC3551, which is based on AIFF-C */
- PA_CHANNEL_MAP_ALSA, /**< The default mapping used by ALSA */
- PA_CHANNEL_MAP_AUX, /**< Only aux channels */
+ PA_CHANNEL_MAP_AIFF, /**< The mapping from RFC3551, which is based on AIFF-C */
+ PA_CHANNEL_MAP_ALSA, /**< The default mapping used by ALSA */
+ PA_CHANNEL_MAP_AUX, /**< Only aux channels */
PA_CHANNEL_MAP_WAVEEX, /**< Microsoft's WAVEFORMATEXTENSIBLE mapping */
+ PA_CHANNEL_MAP_OSS, /**< The default channel mapping used by OSS as defined in the OSS 4.0 API specs */
PA_CHANNEL_MAP_DEFAULT = PA_CHANNEL_MAP_AIFF /**< The default channel map */
} pa_channel_map_def_t;