summaryrefslogtreecommitdiffstats
path: root/audio/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-06-09 15:39:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-09 15:39:43 +0000
commit67b0472474e5232b4f31f6a70f916d9721a724de (patch)
treec7e45b0e87befc30b2398c0e0fd86c8823408dfe /audio/include
parentb0f6afbaf89b20530bc733def877fd4b862f54d5 (diff)
parent7cb33cef3d5031ed0c14d114aec1ef7c972df476 (diff)
downloadandroid_system_media-67b0472474e5232b4f31f6a70f916d9721a724de.tar.gz
android_system_media-67b0472474e5232b4f31f6a70f916d9721a724de.tar.bz2
android_system_media-67b0472474e5232b4f31f6a70f916d9721a724de.zip
Merge "audio_channel_in_mask_from_count now handles up to 8 channels" into mnc-dev
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 3e58d83a..5cf8bdb4 100644
--- a/audio/include/system/audio.h
+++ b/audio/include/system/audio.h
@@ -1293,9 +1293,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
@@ -1313,6 +1312,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;
}