Add multichannel support

Test: make vts -j123 && vts-tradefed run commandAndExit vts \
--skip-all-system-status-check \
--skip-preconditions -m VtsHalMediaOmxStoreV1_0Host \
-l INFO

Bug: 69811887
Change-Id: I6ddf882d5a0d991acc8123ed6d220835fc6cce5c
This commit is contained in:
Pawin Vongmasa 2018-05-10 18:39:25 -07:00
parent 14ad821b0a
commit c678d51bdc

View file

@ -90,6 +90,51 @@ void setupPCMPort(sp<IOmxNode> omxNode, OMX_U32 portIndex, int32_t nChannels,
param.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
param.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
break;
case 3:
param.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
param.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
param.eChannelMapping[2] = OMX_AUDIO_ChannelCF;
break;
case 4:
param.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
param.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
param.eChannelMapping[2] = OMX_AUDIO_ChannelLR;
param.eChannelMapping[3] = OMX_AUDIO_ChannelRR;
break;
case 5:
param.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
param.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
param.eChannelMapping[2] = OMX_AUDIO_ChannelCF;
param.eChannelMapping[3] = OMX_AUDIO_ChannelLR;
param.eChannelMapping[4] = OMX_AUDIO_ChannelRR;
break;
case 6:
param.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
param.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
param.eChannelMapping[2] = OMX_AUDIO_ChannelCF;
param.eChannelMapping[3] = OMX_AUDIO_ChannelLFE;
param.eChannelMapping[4] = OMX_AUDIO_ChannelLR;
param.eChannelMapping[5] = OMX_AUDIO_ChannelRR;
break;
case 7:
param.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
param.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
param.eChannelMapping[2] = OMX_AUDIO_ChannelCF;
param.eChannelMapping[3] = OMX_AUDIO_ChannelLFE;
param.eChannelMapping[4] = OMX_AUDIO_ChannelLR;
param.eChannelMapping[5] = OMX_AUDIO_ChannelRR;
param.eChannelMapping[6] = OMX_AUDIO_ChannelCS;
break;
case 8:
param.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
param.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
param.eChannelMapping[2] = OMX_AUDIO_ChannelCF;
param.eChannelMapping[3] = OMX_AUDIO_ChannelLFE;
param.eChannelMapping[4] = OMX_AUDIO_ChannelLR;
param.eChannelMapping[5] = OMX_AUDIO_ChannelRR;
param.eChannelMapping[6] = OMX_AUDIO_ChannelLS;
param.eChannelMapping[7] = OMX_AUDIO_ChannelRS;
break;
default:
EXPECT_TRUE(false);
}