aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Hu <austin.hu@intel.com>2017-04-18 15:57:03 +0800
committerDaniel Cardenas <danielcar@google.com>2017-04-20 17:42:05 -0700
commit6a3d9478ea33b4e734cbcbc88d3f258c2cac94bb (patch)
tree0fffefb0bff87f710789554dbf32b396ee257596
parent3b09ea8de3ecd7c28333b9f5f417f836bbefbcd0 (diff)
downloadwrs_omxil_core-6a3d9478ea33b4e734cbcbc88d3f258c2cac94bb.tar.gz
WRS: fixed the regression that black/green pixels appear during video playback.
BZ: IMINAN-51351 The regression happened since Android O release, because ACodec::configureCodec() is delayed to be invoked, so that the eColorFormat of output port definition couldn't be aligned with the updated video width & height. Fixed the issue by updating eColorFormat when setParameter() is triggered via libstagefright. And only update the eColorFormat for the Intel YUV formats, as some CTS video cases go through software renderer due to OMX_COLOR_FormatYUV420Flexible is pre-set. Bug: 37551461 Test: Netflix, play movies, youtube Change-Id: I4564e6f3bc49b9a029841d363e020a5a9c02b938 Signed-off-by: Austin Hu <austin.hu@intel.com> (cherry picked from commit 05fba040651f2a9f853c1b17cd0e8e2e3b88c9f3)
-rw-r--r--base/inc/componentbase.h2
-rwxr-xr-xbase/src/componentbase.cpp12
2 files changed, 14 insertions, 0 deletions
diff --git a/base/inc/componentbase.h b/base/inc/componentbase.h
index 3310f68..247439d 100644
--- a/base/inc/componentbase.h
+++ b/base/inc/componentbase.h
@@ -354,6 +354,8 @@ private:
ComponentSetConfig(OMX_INDEXTYPE nIndex,
OMX_PTR pComponentConfigStructure) = 0;
+ virtual OMX_COLOR_FORMATTYPE GetOutputColorFormat(int width);
+
/* buffer processing */
/* implement WorkableInterface */
virtual void Work(void); /* handle this->ports, hold ports_block */
diff --git a/base/src/componentbase.cpp b/base/src/componentbase.cpp
index f7ff029..fc8905b 100755
--- a/base/src/componentbase.cpp
+++ b/base/src/componentbase.cpp
@@ -29,6 +29,7 @@
#include <queue.h>
#include <workqueue.h>
#include <OMX_IndexExt.h>
+#include <OMX_IntelVideoExt.h>
#include <HardwareAPI.h>
//#define LOG_NDEBUG 0
@@ -589,6 +590,11 @@ OMX_ERRORTYPE ComponentBase::CBaseSetParameter(
p->nBufferSize = p->format.video.nFrameWidth * p->format.video.nFrameHeight *3/2;
}
+ if ((p->format.video.eColorFormat == OMX_COLOR_FormatUnused) ||
+ (p->format.video.eColorFormat == OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar) ||
+ (p->format.video.eColorFormat == OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled))
+ p->format.video.eColorFormat = GetOutputColorFormat(p->format.video.nFrameWidth);
+
ret = port->SetPortDefinition(p, false);
if (ret != OMX_ErrorNone) {
return ret;
@@ -1888,6 +1894,12 @@ OMX_ERRORTYPE ComponentBase::FreePorts(void)
return OMX_ErrorNone;
}
+OMX_COLOR_FORMATTYPE ComponentBase::GetOutputColorFormat(int width)
+{
+ LOGD("%s: width = %d", __func__, width);
+ return OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar;
+}
+
/* buffer processing */
/* implement WorkableInterface */
void ComponentBase::Work(void)