aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2017-11-01 22:07:12 +0000
committerandroid-build-prod (mdb) <android-build-team-robot@google.com>2017-11-01 22:07:12 +0000
commit803b9b2b7d0bafcef5cfe91aa9075bb9e1b84d53 (patch)
treec759b5cca033aea4b22e52a991a42d773aea91bf
parent760b9713c84566e6a3a39d114d346d20389f47a8 (diff)
parent689411deff0f97b7904e86a371a92dfd2605177c (diff)
downloadwrs_omxil_core-sdk-release.tar.gz
Snap for 4429331 from 689411deff0f97b7904e86a371a92dfd2605177c to sdk-releasesdk-release
Change-Id: I0aeb3469a2c49fe5d32d8fb0802dae2f6a127057
-rw-r--r--base/inc/componentbase.h2
-rwxr-xr-xbase/src/componentbase.cpp14
-rw-r--r--utils/src/thread.cpp2
3 files changed, 17 insertions, 1 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 47d9cb0..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;
@@ -1779,7 +1785,7 @@ OMX_ERRORTYPE ComponentBase::SetWorkingRole(const OMX_STRING role)
}
LOGE("%s: cannot find %s role\n", GetName(), role);
- return OMX_ErrorBadParameter;
+ return OMX_ErrorUnsupportedSetting;
}
/* apply a working role for a component having multiple roles */
@@ -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)
diff --git a/utils/src/thread.cpp b/utils/src/thread.cpp
index 22a4398..957e9bb 100644
--- a/utils/src/thread.cpp
+++ b/utils/src/thread.cpp
@@ -23,6 +23,7 @@ Thread::Thread()
{
r = NULL;
created = false;
+ id = 0;
pthread_mutex_init(&lock, NULL);
}
@@ -31,6 +32,7 @@ Thread::Thread(RunnableInterface *r)
{
this->r = r;
created = false;
+ id = 0;
pthread_mutex_init(&lock, NULL);
}