summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/BufferProviders.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-05-05 23:48:38 -0700
committerAndy Hung <hunga@google.com>2015-05-06 10:28:06 -0700
commit18aa27016a94d0fee243637a80fd0741f89e08f2 (patch)
tree35a0e32b3d526daba44572ff9516076ad43d4974 /services/audioflinger/BufferProviders.cpp
parentd1abb8f94d7ed749ee959655db1e07d26dad074d (diff)
downloadframeworks_av-18aa27016a94d0fee243637a80fd0741f89e08f2.zip
frameworks_av-18aa27016a94d0fee243637a80fd0741f89e08f2.tar.gz
frameworks_av-18aa27016a94d0fee243637a80fd0741f89e08f2.tar.bz2
Support channel index masks for output hal
Change-Id: Ib3e61ff6faf91c71b85102b5d77f90f124c08220
Diffstat (limited to 'services/audioflinger/BufferProviders.cpp')
-rw-r--r--services/audioflinger/BufferProviders.cpp42
1 files changed, 2 insertions, 40 deletions
diff --git a/services/audioflinger/BufferProviders.cpp b/services/audioflinger/BufferProviders.cpp
index 77bf4ac..8a580e8 100644
--- a/services/audioflinger/BufferProviders.cpp
+++ b/services/audioflinger/BufferProviders.cpp
@@ -292,46 +292,8 @@ RemixBufferProvider::RemixBufferProvider(audio_channel_mask_t inputChannelMask,
ALOGV("RemixBufferProvider(%p)(%#x, %#x, %#x) %zu %zu",
this, format, inputChannelMask, outputChannelMask,
mInputChannels, mOutputChannels);
-
- const audio_channel_representation_t inputRepresentation =
- audio_channel_mask_get_representation(inputChannelMask);
- const audio_channel_representation_t outputRepresentation =
- audio_channel_mask_get_representation(outputChannelMask);
- const uint32_t inputBits = audio_channel_mask_get_bits(inputChannelMask);
- const uint32_t outputBits = audio_channel_mask_get_bits(outputChannelMask);
-
- switch (inputRepresentation) {
- case AUDIO_CHANNEL_REPRESENTATION_POSITION:
- switch (outputRepresentation) {
- case AUDIO_CHANNEL_REPRESENTATION_POSITION:
- memcpy_by_index_array_initialization(mIdxAry, ARRAY_SIZE(mIdxAry),
- outputBits, inputBits);
- return;
- case AUDIO_CHANNEL_REPRESENTATION_INDEX:
- // TODO: output channel index mask not currently allowed
- // fall through
- default:
- break;
- }
- break;
- case AUDIO_CHANNEL_REPRESENTATION_INDEX:
- switch (outputRepresentation) {
- case AUDIO_CHANNEL_REPRESENTATION_POSITION:
- memcpy_by_index_array_initialization_src_index(mIdxAry, ARRAY_SIZE(mIdxAry),
- outputBits, inputBits);
- return;
- case AUDIO_CHANNEL_REPRESENTATION_INDEX:
- // TODO: output channel index mask not currently allowed
- // fall through
- default:
- break;
- }
- break;
- default:
- break;
- }
- LOG_ALWAYS_FATAL("invalid channel mask conversion from %#x to %#x",
- inputChannelMask, outputChannelMask);
+ (void) memcpy_by_index_array_initialization_from_channel_mask(
+ mIdxAry, ARRAY_SIZE(mIdxAry), outputChannelMask, inputChannelMask);
}
void RemixBufferProvider::copyFrames(void *dst, const void *src, size_t frames)