From a7ea9ae197a22f90753bfc6f20de2ad94aea49f6 Mon Sep 17 00:00:00 2001 From: Ram Mohan M Date: Mon, 28 Aug 2017 16:45:19 +0530 Subject: [PATCH] bug fix: add missing color formats to the check for valid formats Component can support 420PackedPlanar and 420PackedSemiPlanar as their choice of color formats. The current test application can fail in this case. This is corrected. Test: make vts -j99 BUILD_GOOGLE_VTS=true TARGET_PRODUCT=aosp_arm64 \ && vts-tradefed run commandAndExit vts \ --skip-all-system-status-check --primary-abi-only \ --skip-preconditions --module VtsHalMediaOmxV1_0Test -l INFO Bug: 63796949 Change-Id: I38bbbb40b34dcdd4526e87708667dc116af900f1 --- .../video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 c75bd7c64c..248fd07544 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp @@ -814,7 +814,7 @@ void getDefaultColorFormat(sp omxNode, OMX_U32 kPortIndexOutput, OMX_VIDEO_PARAM_PORTFORMATTYPE portFormat; *eColorFormat = OMX_COLOR_FormatUnused; portFormat.nIndex = 0; - while (1) { + while (portFormat.nIndex < 512) { status = getPortParam(omxNode, OMX_IndexParamVideoPortFormat, kPortIndexOutput, &portFormat); if (status != ::android::hardware::media::omx::V1_0::Status::OK) break; @@ -828,7 +828,9 @@ void getDefaultColorFormat(sp omxNode, OMX_U32 kPortIndexOutput, break; } if (OMX_COLOR_FormatYUV420SemiPlanar == portFormat.eColorFormat || - OMX_COLOR_FormatYUV420Planar == portFormat.eColorFormat) { + OMX_COLOR_FormatYUV420Planar == portFormat.eColorFormat || + OMX_COLOR_FormatYUV420PackedPlanar == portFormat.eColorFormat || + OMX_COLOR_FormatYUV420PackedSemiPlanar == portFormat.eColorFormat) { *eColorFormat = portFormat.eColorFormat; break; }