Fix bug 4319552 Use commonly defined channel mask values in native

The native channel mask values are equal to the Java values, which
 differ from other standards simply for legacy reasons. It is
 preferrable to use commonly used values, and translate from the
 Java constants to the common values when specifying a Java mask.
The new definitions uses the same values and ordering as in
 OpenSL ES and other standards.

Change-Id: I879f64b281714c60684cd8b36fe6ae648a555121
This commit is contained in:
Jean-Michel Trivi 2011-07-25 16:19:07 -07:00
parent 2ca5592218
commit 6d4f39754b
1 changed files with 18 additions and 20 deletions

View File

@ -152,28 +152,26 @@ typedef enum {
AUDIO_FORMAT_PCM_SUB_8_24_BIT),
} audio_format_t;
/* Channel mask definitions must be kept in sync with JAVA values in
* frameworks/base/media/java/android/media/AudioFormat.java */
typedef enum {
/* output channels */
AUDIO_CHANNEL_OUT_FRONT_LEFT = 0x4,
AUDIO_CHANNEL_OUT_FRONT_RIGHT = 0x8,
AUDIO_CHANNEL_OUT_FRONT_CENTER = 0x10,
AUDIO_CHANNEL_OUT_LOW_FREQUENCY = 0x20,
AUDIO_CHANNEL_OUT_BACK_LEFT = 0x40,
AUDIO_CHANNEL_OUT_BACK_RIGHT = 0x80,
AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x100,
AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x200,
AUDIO_CHANNEL_OUT_BACK_CENTER = 0x400,
AUDIO_CHANNEL_OUT_SIDE_LEFT = 0x800,
AUDIO_CHANNEL_OUT_SIDE_RIGHT = 0x1000,
AUDIO_CHANNEL_OUT_TOP_CENTER = 0x2000,
AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT = 0x4000,
AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER = 0x8000,
AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT = 0x10000,
AUDIO_CHANNEL_OUT_TOP_BACK_LEFT = 0x20000,
AUDIO_CHANNEL_OUT_TOP_BACK_CENTER = 0x40000,
AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT = 0x80000,
AUDIO_CHANNEL_OUT_FRONT_LEFT = 0x1,
AUDIO_CHANNEL_OUT_FRONT_RIGHT = 0x2,
AUDIO_CHANNEL_OUT_FRONT_CENTER = 0x4,
AUDIO_CHANNEL_OUT_LOW_FREQUENCY = 0x8,
AUDIO_CHANNEL_OUT_BACK_LEFT = 0x10,
AUDIO_CHANNEL_OUT_BACK_RIGHT = 0x20,
AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x40,
AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x80,
AUDIO_CHANNEL_OUT_BACK_CENTER = 0x100,
AUDIO_CHANNEL_OUT_SIDE_LEFT = 0x200,
AUDIO_CHANNEL_OUT_SIDE_RIGHT = 0x400,
AUDIO_CHANNEL_OUT_TOP_CENTER = 0x800,
AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT = 0x1000,
AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER = 0x2000,
AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT = 0x4000,
AUDIO_CHANNEL_OUT_TOP_BACK_LEFT = 0x8000,
AUDIO_CHANNEL_OUT_TOP_BACK_CENTER = 0x10000,
AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT = 0x20000,
AUDIO_CHANNEL_OUT_MONO = AUDIO_CHANNEL_OUT_FRONT_LEFT,
AUDIO_CHANNEL_OUT_STEREO = (AUDIO_CHANNEL_OUT_FRONT_LEFT |