summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-06-09 03:12:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-09 03:12:08 +0000
commit11e9b588c4e39481f44b53d9947440a08e836c02 (patch)
treeb09fb752d76fbe0c2325ee4b257ed4f8dbf07fb7
parent452fe6aef2d5ed164d3b28203fb82f42cddc45d7 (diff)
parent59197e8cf9b961b925d16ee913bdbf18b75850e5 (diff)
downloadplatform_hardware_interfaces-11e9b588c4e39481f44b53d9947440a08e836c02.tar.gz
platform_hardware_interfaces-11e9b588c4e39481f44b53d9947440a08e836c02.tar.bz2
platform_hardware_interfaces-11e9b588c4e39481f44b53d9947440a08e836c02.zip
Merge "AudioDec Test: Ignore output port configuration" into oc-dev
-rw-r--r--media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp83
-rw-r--r--media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp4
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 410dc510fc..fe67cb9b2e 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);
@@ -812,8 +829,13 @@ TEST_F(AudioDecHidlTest, DISABLED_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;
@@ -884,8 +906,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;
@@ -902,8 +929,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);
@@ -919,7 +946,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);
@@ -983,8 +1010,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;
@@ -999,11 +1031,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;
@@ -1062,8 +1094,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;
@@ -1081,7 +1118,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);
@@ -1103,7 +1140,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 9b0be51173..2ff8ed3be0 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -1062,11 +1062,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;