summaryrefslogtreecommitdiffstats
path: root/audio/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-06-08 16:12:42 -0700
committerGlenn Kasten <gkasten@google.com>2015-06-08 16:38:53 -0700
commit7cb33cef3d5031ed0c14d114aec1ef7c972df476 (patch)
tree4663de868ba0d576735d9c315d6a8ff8974437eb /audio/include
parent21aa43a5ea032080aee301abc60780887f94665f (diff)
downloadandroid_system_media-7cb33cef3d5031ed0c14d114aec1ef7c972df476.tar.gz
android_system_media-7cb33cef3d5031ed0c14d114aec1ef7c972df476.tar.bz2
android_system_media-7cb33cef3d5031ed0c14d114aec1ef7c972df476.zip
audio_channel_in_mask_from_count now handles up to 8 channels
Bug: 21375533 Change-Id: I4b2fabd326e7cfd3d04ed83cf95e29bd91c99530
Diffstat (limited to 'audio/include')
-rw-r--r--audio/include/system/audio.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/audio/include/system/audio.h b/audio/include/system/audio.h
index a4a557b4..bc87c62a 100644
--- a/audio/include/system/audio.h
+++ b/audio/include/system/audio.h
@@ -1289,9 +1289,8 @@ static inline audio_channel_mask_t audio_channel_out_mask_from_count(uint32_t ch
AUDIO_CHANNEL_REPRESENTATION_POSITION, bits);
}
-/* 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
+/* Derive a default input channel mask from a channel count.
+ * Assumes a position mask for mono and stereo, or an index mask for channel counts > 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
@@ -1309,6 +1308,14 @@ static inline audio_channel_mask_t audio_channel_in_mask_from_count(uint32_t cha
case 2:
bits = AUDIO_CHANNEL_IN_STEREO;
break;
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ // FIXME FCC_8
+ return audio_channel_mask_for_index_assignment_from_count(channel_count);
default:
return AUDIO_CHANNEL_INVALID;
}