diff options
author | Ram Mohan M <ram.mohan@ittiam.com> | 2017-06-08 11:43:59 +0530 |
---|---|---|
committer | Pawin Vongmasa <pawin@google.com> | 2017-06-08 05:25:29 -0700 |
commit | 59197e8cf9b961b925d16ee913bdbf18b75850e5 (patch) | |
tree | 2928b327cce71c9d2b77bfbd6658f7577e6d6403 | |
parent | 538b7d85ef1d9d655587917c744646461f02d8c8 (diff) | |
download | platform_hardware_interfaces-59197e8cf9b961b925d16ee913bdbf18b75850e5.tar.gz platform_hardware_interfaces-59197e8cf9b961b925d16ee913bdbf18b75850e5.tar.bz2 platform_hardware_interfaces-59197e8cf9b961b925d16ee913bdbf18b75850e5.zip |
AudioDec Test: Ignore output port configuration
audio dec components vorbis, opus and raw undergo auto output port
configuration and donot allow client to configure. By pass output port
configuration for these components
Test: VtsHalMediaOmxV1_0Host
Bug: 37501531
Change-Id: Ib1539b36589db5bdf1b6d82fcd0c50ba420a0299
-rw-r--r-- | media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp | 83 | ||||
-rw-r--r-- | media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp | 4 |
2 files changed, 62 insertions, 25 deletions
diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp index 5ba195e565..29d4ff1708 100644 --- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp +++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp @@ -479,7 +479,9 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer, android::Vector<BufferInfo>* oBuffer, OMX_AUDIO_CODINGTYPE eEncoding, OMX_U32 kPortIndexInput, OMX_U32 kPortIndexOutput, - Message msg) { + Message msg, + AudioDecHidlTest::standardComp comp = + AudioDecHidlTest::standardComp::unknown_comp) { android::hardware::media::omx::V1_0::Status status; if (msg.data.eventData.event == OMX_EventPortSettingsChanged) { @@ -514,8 +516,18 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer, int32_t nSampleRate; getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels, &nSampleRate); - setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, - nChannels, nSampleRate); + // Configure output port + // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way + // to + // configure output PCM port. The port undergoes auto configuration + // internally basing on parsed elementary stream information. + if (comp != AudioDecHidlTest::standardComp::vorbis && + comp != AudioDecHidlTest::standardComp::opus && + comp != AudioDecHidlTest::standardComp::raw) { + setDefaultPortParam(omxNode, kPortIndexOutput, + OMX_AUDIO_CodingPCM, nChannels, + nSampleRate); + } // If you can disable a port, then you should be able to // enable @@ -594,7 +606,7 @@ void decodeNFrames(sp<IOmxNode> omxNode, sp<CodecObserver> observer, OMX_AUDIO_CODINGTYPE eEncoding, OMX_U32 kPortIndexInput, OMX_U32 kPortIndexOutput, std::ifstream& eleStream, android::Vector<FrameData>* Info, int offset, int range, - bool signalEOS = true) { + AudioDecHidlTest::standardComp comp, bool signalEOS = true) { android::hardware::media::omx::V1_0::Status status; Message msg; @@ -633,7 +645,7 @@ void decodeNFrames(sp<IOmxNode> omxNode, sp<CodecObserver> observer, if (status == android::hardware::media::omx::V1_0::Status::OK && msg.type == Message::Type::EVENT) { portReconfiguration(omxNode, observer, iBuffer, oBuffer, eEncoding, - kPortIndexInput, kPortIndexOutput, msg); + kPortIndexInput, kPortIndexOutput, msg, comp); } if (frameID == (int)Info->size() || frameID == (offset + range)) break; @@ -754,8 +766,13 @@ TEST_F(AudioDecHidlTest, DecodeTest) { getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels, &nSampleRate); // Configure output port - setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, - nChannels, nSampleRate); + // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to + // configure output PCM port. The port undergoes auto configuration + // internally basing on parsed elementary stream information. + if (compName != vorbis && compName != opus && compName != raw) { + setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, + nChannels, nSampleRate); + } android::Vector<BufferInfo> iBuffer, oBuffer; @@ -769,7 +786,7 @@ TEST_F(AudioDecHidlTest, DecodeTest) { ASSERT_EQ(eleStream.is_open(), true); decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, - (int)Info.size()); + (int)Info.size(), compName); eleStream.close(); waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput); @@ -808,8 +825,13 @@ TEST_F(AudioDecHidlTest, EOSTest_M) { getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels, &nSampleRate); // Configure output port - setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, - nChannels, nSampleRate); + // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to + // configure output PCM port. The port undergoes auto configuration + // internally basing on parsed elementary stream information. + if (compName != vorbis && compName != opus && compName != raw) { + setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, + nChannels, nSampleRate); + } android::Vector<BufferInfo> iBuffer, oBuffer; @@ -880,8 +902,13 @@ TEST_F(AudioDecHidlTest, ThumbnailTest) { getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels, &nSampleRate); // Configure output port - setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, - nChannels, nSampleRate); + // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to + // configure output PCM port. The port undergoes auto configuration + // internally basing on parsed elementary stream information. + if (compName != vorbis && compName != opus && compName != raw) { + setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, + nChannels, nSampleRate); + } android::Vector<BufferInfo> iBuffer, oBuffer; @@ -898,8 +925,8 @@ TEST_F(AudioDecHidlTest, ThumbnailTest) { eleStream.open(mURL, std::ifstream::binary); ASSERT_EQ(eleStream.is_open(), true); decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding, - kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, - i + 1); + kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, i + 1, + compName); eleStream.close(); waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput); @@ -915,7 +942,7 @@ TEST_F(AudioDecHidlTest, ThumbnailTest) { ASSERT_EQ(eleStream.is_open(), true); decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, i + 1, - false); + compName, false); eleStream.close(); waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput); @@ -979,8 +1006,13 @@ TEST_F(AudioDecHidlTest, SimpleEOSTest) { getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels, &nSampleRate); // Configure output port - setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, - nChannels, nSampleRate); + // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to + // configure output PCM port. The port undergoes auto configuration + // internally basing on parsed elementary stream information. + if (compName != vorbis && compName != opus && compName != raw) { + setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, + nChannels, nSampleRate); + } android::Vector<BufferInfo> iBuffer, oBuffer; @@ -995,11 +1027,11 @@ TEST_F(AudioDecHidlTest, SimpleEOSTest) { ASSERT_EQ(eleStream.is_open(), true); decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, - (int)Info.size()); + (int)Info.size(), compName, false); eleStream.close(); waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput); - testEOS(omxNode, observer, &iBuffer, &oBuffer, false, eosFlag); + testEOS(omxNode, observer, &iBuffer, &oBuffer, true, eosFlag); flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput, kPortIndexOutput); framesReceived = 0; @@ -1058,8 +1090,13 @@ TEST_F(AudioDecHidlTest, FlushTest) { getInputChannelInfo(omxNode, kPortIndexInput, eEncoding, &nChannels, &nSampleRate); // Configure output port - setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, - nChannels, nSampleRate); + // SPECIAL CASE: Soft Vorbis, Opus and Raw Decoders do not offer way to + // configure output PCM port. The port undergoes auto configuration + // internally basing on parsed elementary stream information. + if (compName != vorbis && compName != opus && compName != raw) { + setDefaultPortParam(omxNode, kPortIndexOutput, OMX_AUDIO_CodingPCM, + nChannels, nSampleRate); + } android::Vector<BufferInfo> iBuffer, oBuffer; @@ -1077,7 +1114,7 @@ TEST_F(AudioDecHidlTest, FlushTest) { ASSERT_EQ(eleStream.is_open(), true); decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, - nFrames, false); + nFrames, compName, false); // Note: Assumes 200 ms is enough to end any decode call that started flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput, kPortIndexOutput, 200000); @@ -1099,7 +1136,7 @@ TEST_F(AudioDecHidlTest, FlushTest) { if (keyFrame) { decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, eEncoding, kPortIndexInput, kPortIndexOutput, eleStream, &Info, - index, Info.size() - index, false); + index, Info.size() - index, compName, false); } // Note: Assumes 200 ms is enough to end any decode call that started flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput, diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp index 8ab01b537d..19c13b7820 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp @@ -1071,11 +1071,11 @@ TEST_F(VideoDecHidlTest, SimpleEOSTest) { ASSERT_EQ(eleStream.is_open(), true); decodeNFrames(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput, kPortIndexOutput, eleStream, &Info, 0, (int)Info.size(), - portMode[1]); + portMode[1], false); eleStream.close(); waitOnInputConsumption(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput, kPortIndexOutput, portMode[1]); - testEOS(omxNode, observer, &iBuffer, &oBuffer, false, eosFlag, portMode); + testEOS(omxNode, observer, &iBuffer, &oBuffer, true, eosFlag, portMode); flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput, kPortIndexOutput); framesReceived = 0; |