From: Lennart Poettering Date: Wed, 17 May 2006 13:06:04 +0000 (+0000) Subject: add new channel mapping standard PA_CHANNEL_MAP_OSS X-Git-Tag: v0.9.0~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed3606c88480de9b348dee451e7ebfd1f6bd15d7;p=platform%2Fupstream%2Fpulseaudio.git 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 --- diff --git a/src/polyp/channelmap.c b/src/polyp/channelmap.c index 1e6347d..7266a0a 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 c9fae17..feccd28 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;