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 81a05cae96..b8a1634414 100644 --- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp +++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp @@ -220,7 +220,7 @@ class AudioDecHidlTest : public ::testing::VtsHalHidlTargetTestBase { framesReceived = 0; timestampUs = 0; timestampDevTest = false; - if (disableTest) std::cerr << "[ ] Warning ! Test Disabled\n"; + if (disableTest) std::cout << "[ WARN ] Test Disabled \n"; } virtual void TearDown() override { @@ -264,9 +264,8 @@ class AudioDecHidlTest : public ::testing::VtsHalHidlTargetTestBase { EXPECT_EQ(tsHit, true) << "TimeStamp not recognized"; } else { - std::cerr - << "[ ] Warning ! Received non-zero " - "output / TimeStamp not recognized \n"; + std::cout << "[ INFO ] Received non-zero " + "output / TimeStamp not recognized \n"; } } } @@ -714,7 +713,7 @@ TEST_F(AudioDecHidlTest, SetRole) { } // port format enumeration -TEST_F(AudioDecHidlTest, DISABLED_EnumeratePortFormat) { +TEST_F(AudioDecHidlTest, EnumeratePortFormat) { description("Test Component on Mandatory Port Parameters (Port Format)"); if (disableTest) return; android::hardware::media::omx::V1_0::Status status; @@ -820,11 +819,7 @@ TEST_F(AudioDecHidlTest, DecodeTest) { } // end of sequence test -// SPECIAL CASE; Sending Empty input EOS buffer is not supported across all -// components. For instance soft vorbis and soft opus expects CSD buffers at -// the start. Disabling this test for now. We shall revisit this at a later -// stage -TEST_F(AudioDecHidlTest, DISABLED_EOSTest_M) { +TEST_F(AudioDecHidlTest, EOSTest_M) { description("Test end of stream monkeying"); if (disableTest) return; android::hardware::media::omx::V1_0::Status status; diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp index 278e196299..dd5f16afad 100644 --- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp +++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp @@ -206,7 +206,7 @@ class AudioEncHidlTest : public ::testing::VtsHalHidlTargetTestBase { } if (i == kNumCompToCoding) disableTest = true; eosFlag = false; - if (disableTest) std::cerr << "[ ] Warning ! Test Disabled\n"; + if (disableTest) std::cout << "[ WARN ] Test Disabled \n"; } virtual void TearDown() override { @@ -437,7 +437,7 @@ TEST_F(AudioEncHidlTest, SetRole) { } // port format enumeration -TEST_F(AudioEncHidlTest, DISABLED_EnumeratePortFormat) { +TEST_F(AudioEncHidlTest, EnumeratePortFormat) { description("Test Component on Mandatory Port Parameters (Port Format)"); if (disableTest) return; android::hardware::media::omx::V1_0::Status status; diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp index 2ec86b2adc..381a1b94f7 100644 --- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp +++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp @@ -181,7 +181,7 @@ class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase { strlen(gEnv->getComponent().c_str()) - suffixLen, ".secure"); } - if (disableTest) std::cerr << "[ ] Warning ! Test Disabled\n"; + if (disableTest) std::cout << "[ WARN ] Test Disabled \n"; } virtual void TearDown() override { @@ -290,7 +290,7 @@ TEST_F(ComponentHidlTest, DISABLED_GetPortIndices) { } // port format enumeration -TEST_F(ComponentHidlTest, DISABLED_EnumeratePortFormat) { +TEST_F(ComponentHidlTest, EnumeratePortFormat) { description("Test Component on Mandatory Port Parameters (Port Format)"); if (disableTest) return; android::hardware::media::omx::V1_0::Status status; @@ -397,14 +397,44 @@ TEST_F(ComponentHidlTest, DISABLED_SetDefaultPortParams) { EXPECT_NE(status, ::android::hardware::media::omx::V1_0::Status::OK); - // Edit Read-Only fields. + // Port Direction - Read Only portDef = mirror; portDef.eDir = static_cast(RANDOM_INDEX); setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); - EXPECT_EQ(portDef.eDir, mirror.eDir); + if (portDef.eDir != mirror.eDir) { + std::cerr << "[ ERROR ] port direction has to be read only " + "but is changeable \n"; + } setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &mirror); + // Port Min BufferCount - Read Only + portDef = mirror; + portDef.nBufferCountMin += 1; + setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); + getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); + if (portDef.nBufferCountMin != mirror.nBufferCountMin) { + std::cerr << "[ ERROR ] port Min BufferCount has to be " + "read only but is changeable \n"; + } + EXPECT_EQ(portDef.nBufferCountMin, mirror.nBufferCountMin); + setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &mirror); + + // Port Actual BufferCount + portDef = mirror; + portDef.nBufferCountActual += 1; + status = setPortParam(omxNode, OMX_IndexParamPortDefinition, i, + &portDef); + if (status == ::android::hardware::media::omx::V1_0::Status::OK) { + status = getPortParam(omxNode, OMX_IndexParamPortDefinition, i, + &portDef); + EXPECT_EQ(portDef.nBufferCountActual, + mirror.nBufferCountActual + 1); + } + + // Port BufferSize is although read only as per OMX-IL 1.2, android + // doesnt abide by this. + // Decrease buffer size portDef = mirror; OMX_U32 nBufferSize = portDef.nBufferSize >> 1; if (nBufferSize != 0) { @@ -428,43 +458,21 @@ TEST_F(ComponentHidlTest, DISABLED_SetDefaultPortParams) { (compClass == video_decoder && i == kPortIndexInput)) { double dev = (portDef.nBufferSize / (double)nBufferSize); dev -= 1; - if (dev < 0 || dev > 0.1) EXPECT_TRUE(false); + if (dev < 0 || dev > 0.1) { + std::cerr << "[ ERROR ] port buffer size deviation " + "larger than expected \n"; + } } else { EXPECT_EQ(portDef.nBufferSize, mirror.nBufferSize); } setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &mirror); - portDef = mirror; - portDef.nBufferCountMin += 1; - setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); - getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); - EXPECT_EQ(portDef.nBufferCountMin, mirror.nBufferCountMin); - setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &mirror); - - portDef = mirror; - portDef.nBufferCountActual += 1; - status = setPortParam(omxNode, OMX_IndexParamPortDefinition, i, - &portDef); - if (status == ::android::hardware::media::omx::V1_0::Status::OK) { - status = getPortParam(omxNode, OMX_IndexParamPortDefinition, i, - &portDef); - EXPECT_EQ(portDef.nBufferCountActual, - mirror.nBufferCountActual + 1); - } - + // Increase buffer size portDef = mirror; portDef.nBufferSize = mirror.nBufferSize << 1; - status = setPortParam(omxNode, OMX_IndexParamPortDefinition, i, - &portDef); - if (status == ::android::hardware::media::omx::V1_0::Status::OK) { - status = getPortParam(omxNode, OMX_IndexParamPortDefinition, i, - &portDef); - if (portDef.nBufferSize != mirror.nBufferSize) { - std::cout - << "[ ] Warning ! Component input port does " - "not preserve Read-Only fields \n"; - } - } + setPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); + getPortParam(omxNode, OMX_IndexParamPortDefinition, i, &portDef); + EXPECT_EQ(portDef.nBufferSize, (mirror.nBufferSize << 1)); } } } 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 2ea970165d..6b012858fd 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp @@ -222,7 +222,7 @@ class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase { ".secure"); } if (isSecure) disableTest = true; - if (disableTest) std::cout << "[ ] Warning ! Test Disabled\n"; + if (disableTest) std::cout << "[ WARN ] Test Disabled \n"; } virtual void TearDown() override { @@ -266,9 +266,8 @@ class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase { EXPECT_EQ(tsHit, true) << "TimeStamp not recognized"; } else { - std::cout - << "[ ] Warning ! Received non-zero " - "output / TimeStamp not recognized \n"; + std::cout << "[ INFO ] Received non-zero " + "output / TimeStamp not recognized \n"; } } } @@ -538,14 +537,14 @@ void portReconfiguration(sp omxNode, sp observer, } } else if (msg.data.eventData.data2 == OMX_IndexConfigCommonOutputCrop) { - std::cout << "[ ] Warning ! OMX_EventPortSettingsChanged/ " + std::cout << "[ INFO ] OMX_EventPortSettingsChanged/ " "OMX_IndexConfigCommonOutputCrop not handled \n"; } else if (msg.data.eventData.data2 == OMX_IndexVendorStartUnused + 3) { - std::cout << "[ ] Warning ! OMX_EventPortSettingsChanged/ " + std::cout << "[ INFO ] OMX_EventPortSettingsChanged/ " "kDescribeColorAspectsIndex not handled \n"; } } else if (msg.data.eventData.event == OMX_EventError) { - std::cout << "[ ] Warning ! OMX_EventError/ " + std::cerr << "[ ERROR ] OMX_EventError/ " "Decode Frame Call might be failed \n"; return; } else { diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp index 74b995b9f7..df90ccce59 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp @@ -237,7 +237,7 @@ class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase { ".secure"); } if (isSecure) disableTest = true; - if (disableTest) std::cerr << "[ ] Warning ! Test Disabled\n"; + if (disableTest) std::cout << "[ WARN ] Test Disabled \n"; } virtual void TearDown() override { @@ -278,9 +278,8 @@ class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase { EXPECT_EQ(tsHit, true) << "TimeStamp not recognized"; } else { - std::cerr - << "[ ] Warning ! Received non-zero " - "output / TimeStamp not recognized \n"; + std::cout << "[ INFO ] Received non-zero " + "output / TimeStamp not recognized \n"; } } } @@ -442,7 +441,7 @@ void requestIDR(sp omxNode, OMX_U32 portIndex) { status = setPortConfig(omxNode, OMX_IndexConfigVideoIntraVOPRefresh, portIndex, ¶m); if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr << "[ ] Warning ! unable to request IDR \n"; + std::cout << "[ INFO ] unable to request IDR \n"; } // modify bitrate @@ -453,7 +452,7 @@ void changeBitrate(sp omxNode, OMX_U32 portIndex, uint32_t nBitrate) { status = setPortConfig(omxNode, OMX_IndexConfigVideoBitrate, portIndex, ¶m); if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr << "[ ] Warning ! unable to change Bitrate \n"; + std::cout << "[ INFO ] unable to change Bitrate \n"; } // modify framerate @@ -465,7 +464,7 @@ Return changeFrameRate( status = setPortConfig(omxNode, OMX_IndexConfigVideoFramerate, portIndex, ¶m); if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr << "[ ] Warning ! unable to change Framerate \n"; + std::cout << "[ INFO ] unable to change Framerate \n"; return status; } @@ -479,7 +478,7 @@ void changeRefreshPeriod(sp omxNode, OMX_U32 portIndex, (OMX_INDEXTYPE)OMX_IndexConfigAndroidIntraRefresh, portIndex, ¶m); if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr << "[ ] Warning ! unable to change Refresh Period\n"; + std::cout << "[ INFO ] unable to change Refresh Period\n"; } // set intra refresh interval @@ -505,7 +504,7 @@ void setRefreshPeriod(sp omxNode, OMX_U32 portIndex, status = setPortParam(omxNode, OMX_IndexParamVideoIntraRefresh, portIndex, ¶m); if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr << "[ ] Warning ! unable to set Refresh Period \n"; + std::cout << "[ INFO ] unable to set Refresh Period \n"; } void setLatency(sp omxNode, OMX_U32 portIndex, uint32_t latency) { @@ -515,7 +514,7 @@ void setLatency(sp omxNode, OMX_U32 portIndex, uint32_t latency) { status = setPortConfig(omxNode, (OMX_INDEXTYPE)OMX_IndexConfigLatency, portIndex, ¶m); if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr << "[ ] Warning ! unable to set latency\n"; + std::cout << "[ INFO ] unable to set latency\n"; } void getLatency(sp omxNode, OMX_U32 portIndex, uint32_t* latency) { @@ -524,7 +523,7 @@ void getLatency(sp omxNode, OMX_U32 portIndex, uint32_t* latency) { status = getPortConfig(omxNode, (OMX_INDEXTYPE)OMX_IndexConfigLatency, portIndex, ¶m); if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr << "[ ] Warning ! unable to get latency\n"; + std::cout << "[ INFO ] unable to get latency\n"; else *latency = param.nU32; } @@ -1013,7 +1012,7 @@ void encodeNFrames(sp omxNode, sp observer, break; } else if (msg.data.eventData.event == OMX_EventDataSpaceChanged) { // TODO: how am i supposed to respond now? - std::cout << "[ ] Info ! OMX_EventDataSpaceChanged \n"; + std::cout << "[ INFO ] OMX_EventDataSpaceChanged \n"; } else { ASSERT_TRUE(false); } @@ -1237,8 +1236,7 @@ TEST_F(VideoEncHidlTest, EncodeTest) { status = setParam(omxNode, static_cast(index), ¶m); } if (status != ::android::hardware::media::omx::V1_0::Status::OK) - std::cerr - << "[ ] Warning ! unable to prependSPSPPSToIDRFrames\n"; + std::cout << "[ INFO ] unable to prependSPSPPSToIDRFrames\n"; else prependSPSPPS = true;