diff options
author | Andy Hung <hunga@google.com> | 2015-04-21 13:28:10 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-04-21 17:16:29 -0700 |
commit | 1f6902ea391a84a33b0dca376285a5440ba5f55f (patch) | |
tree | f27b3f49df8c56aa3f7358198858e27e6ecd724f /audio/include | |
parent | 9c8dd45c203ac7f9fa558b9436fa133a3026d62a (diff) | |
download | android_system_media-1f6902ea391a84a33b0dca376285a5440ba5f55f.tar.gz android_system_media-1f6902ea391a84a33b0dca376285a5440ba5f55f.tar.bz2 android_system_media-1f6902ea391a84a33b0dca376285a5440ba5f55f.zip |
Add canonical channel index masks for endpoints
Change-Id: I93f219bbcc9823855ef36bd01cf09450f44df929
Diffstat (limited to 'audio/include')
-rw-r--r-- | audio/include/system/audio.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/audio/include/system/audio.h b/audio/include/system/audio.h index 2a85de1f..a7378273 100644 --- a/audio/include/system/audio.h +++ b/audio/include/system/audio.h @@ -476,6 +476,21 @@ typedef enum { // 3 is reserved for future use } audio_channel_representation_t; +/* The channel index masks defined here are the canonical masks for 1 to 8 channel + * endpoints and apply to both source and sink. + */ +enum { + AUDIO_CHANNEL_INDEX_HDR = AUDIO_CHANNEL_REPRESENTATION_INDEX << AUDIO_CHANNEL_COUNT_MAX, + AUDIO_CHANNEL_INDEX_MASK_1 = AUDIO_CHANNEL_INDEX_HDR | (1 << 1) - 1, + AUDIO_CHANNEL_INDEX_MASK_2 = AUDIO_CHANNEL_INDEX_HDR | (1 << 2) - 1, + AUDIO_CHANNEL_INDEX_MASK_3 = AUDIO_CHANNEL_INDEX_HDR | (1 << 3) - 1, + AUDIO_CHANNEL_INDEX_MASK_4 = AUDIO_CHANNEL_INDEX_HDR | (1 << 4) - 1, + AUDIO_CHANNEL_INDEX_MASK_5 = AUDIO_CHANNEL_INDEX_HDR | (1 << 5) - 1, + AUDIO_CHANNEL_INDEX_MASK_6 = AUDIO_CHANNEL_INDEX_HDR | (1 << 6) - 1, + AUDIO_CHANNEL_INDEX_MASK_7 = AUDIO_CHANNEL_INDEX_HDR | (1 << 7) - 1, + AUDIO_CHANNEL_INDEX_MASK_8 = AUDIO_CHANNEL_INDEX_HDR | (1 << 8) - 1, +}; + /* The return value is undefined if the channel mask is invalid. */ static inline uint32_t audio_channel_mask_get_bits(audio_channel_mask_t channel) { @@ -1249,6 +1264,7 @@ static inline audio_channel_mask_t audio_channel_out_mask_from_count(uint32_t ch /* Derive an input channel mask for position assignment from a channel count. * Currently handles only mono and stereo. + * TODO: consider switching to index channels when > 2 * Returns the matching channel mask, * or AUDIO_CHANNEL_NONE if the channel count is zero, * or AUDIO_CHANNEL_INVALID if the channel count exceeds that of the |