summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.ac4
-rwxr-xr-xopenmax/osal/Exynos_OSAL_Tizen.c22
-rwxr-xr-xopenmax/osal/Makefile.am3
-rwxr-xr-xpackaging/libomxil-e7270-v4l2.spec1
4 files changed, 21 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index efcad60..b3d65d4 100755
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,10 @@ PKG_CHECK_MODULES(EXYNOSCOMMON,exynos-common)
AC_SUBST(EXYNOSCOMMON_CFLAGS)
AC_SUBST(EXYNOSCOMMON_LIBS)
+PKG_CHECK_MODULES(TBM, libtbm)
+AC_SUBST(TBM_CFLAGS)
+AC_SUBST(TBM_LIBS)
+
dnl use dlog ------------------------------------------------------------------
AC_ARG_ENABLE(dlog, AC_HELP_STRING([--enable-dlog], [using dlog]),
[
diff --git a/openmax/osal/Exynos_OSAL_Tizen.c b/openmax/osal/Exynos_OSAL_Tizen.c
index 904762c..36dd86b 100755
--- a/openmax/osal/Exynos_OSAL_Tizen.c
+++ b/openmax/osal/Exynos_OSAL_Tizen.c
@@ -37,6 +37,7 @@
#include "ExynosVideoApi.h"
#include <mmf/mm_types.h>
+#include <tbm_bufmgr.h>
#undef EXYNOS_LOG_TAG
#define EXYNOS_LOG_TAG "Exynos_OSAL_Tizen"
@@ -200,7 +201,8 @@ OMX_ERRORTYPE Exynos_OSAL_GetParameter(
EXYNOS_OMX_BASEPORT *pExynosPort = &pExynosComponent->pExynosPort[pPortDef->nPortIndex];
if (pExynosPort->eMetaDataType == METADATA_TYPE_DATA)
- pPortDef->nBufferSize = sizeof(MMVideoBuffer);
+ pPortDef->nBufferSize = (ALIGN(pExynosPort->portDefinition.format.video.nFrameWidth, 16) *
+ ALIGN(pExynosPort->portDefinition.format.video.nFrameHeight, 16) * 3) / 2;
}
break;
default:
@@ -400,8 +402,8 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(
OMX_IN EXYNOS_METADATA_TYPE eMetaDataType)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- MMVideoBuffer *pMetaBuffer = NULL;
-
+ tbm_surface_h surface;
+ tbm_bo bo[2];
int i;
FunctionIn();
@@ -415,11 +417,14 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(
}
if (eMetaDataType == METADATA_TYPE_DATA) {
- pMetaBuffer = (MMVideoBuffer *)pBuffer;
+ surface = (tbm_surface_h)pBuffer;
+
+ bo[0] = tbm_surface_internal_get_bo(surface, 0);
+ bo[1] = tbm_surface_internal_get_bo(surface, 1);
- for (i = 0; i < pMetaBuffer->plane_num; i++) {
- pBufferInfo->fd[i] = (unsigned long)(pMetaBuffer->handle.dmabuf_fd[i]);
- pBufferInfo->addr[i] = (OMX_PTR)(pMetaBuffer->data[i]);
+ for (i = 0; i < 2; i++) {
+ pBufferInfo->fd[i] = (unsigned long)(tbm_bo_get_handle (bo[i], TBM_DEVICE_MM).u32);
+ pBufferInfo->addr[i] = (OMX_PTR)(tbm_bo_get_handle (bo[i], TBM_DEVICE_CPU).ptr);
Exynos_OSAL_Log(EXYNOS_LOG_ESSENTIAL, "[%s] Plane[%d]: FD(%u), VA(%p)",
__FUNCTION__, i, pBufferInfo->fd[i], pBufferInfo->addr[i]);
@@ -471,7 +476,8 @@ OMX_PTR Exynos_OSAL_AllocMetaDataBuffer(
FunctionIn();
if (eMetaDataType == METADATA_TYPE_DATA) {
- pBuffer = Exynos_OSAL_Malloc(sizeof(MMVideoBuffer));
+ pBuffer = Exynos_OSAL_Malloc(sizeof(tbm_surface_h));
+
if (pBuffer == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "[%s] Failed to allocate metadata buffer", __FUNCTION__);
goto EXIT;
diff --git a/openmax/osal/Makefile.am b/openmax/osal/Makefile.am
index 2dcd154..246aa58 100755
--- a/openmax/osal/Makefile.am
+++ b/openmax/osal/Makefile.am
@@ -12,7 +12,8 @@ libExynosOMX_OSAL_la_SOURCES = Exynos_OSAL_Event.c \
Exynos_OSAL_Tizen.c \
Exynos_OSAL_SharedMemory.c
-libExynosOMX_OSAL_la_LIBADD = $(top_builddir)/exynos/libvideocodec/libExynosVideoApi.la
+libExynosOMX_OSAL_la_LIBADD = $(top_builddir)/exynos/libvideocodec/libExynosVideoApi.la \
+ $(TBM_LIBS)
libExynosOMX_OSAL_la_CFLAGS = -I$(top_srcdir)/openmax/include/khronos \
-I$(top_srcdir)/openmax/include/exynos \
diff --git a/packaging/libomxil-e7270-v4l2.spec b/packaging/libomxil-e7270-v4l2.spec
index 9af6fb7..93fbab6 100755
--- a/packaging/libomxil-e7270-v4l2.spec
+++ b/packaging/libomxil-e7270-v4l2.spec
@@ -13,6 +13,7 @@ BuildRequires: kernel-headers-exynos7270-tw2
BuildRequires: pkgconfig(mm-common)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(exynos-common)
+BuildRequires: pkgconfig(libtbm)
BuildConflicts: linux-glibc-devel
%description