diff options
Diffstat (limited to 'openmax')
-rwxr-xr-x | openmax/osal/Exynos_OSAL_Tizen.c | 26 | ||||
-rwxr-xr-x | openmax/osal/Makefile.am | 11 |
2 files changed, 34 insertions, 3 deletions
diff --git a/openmax/osal/Exynos_OSAL_Tizen.c b/openmax/osal/Exynos_OSAL_Tizen.c index d959bc1..4aecf3c 100755 --- a/openmax/osal/Exynos_OSAL_Tizen.c +++ b/openmax/osal/Exynos_OSAL_Tizen.c @@ -36,9 +36,13 @@ #include "ExynosVideoApi.h" +#ifdef TIZEN_FEATURE_TIZEN_ALLOCATOR #include <tbm_bufmgr.h> #include <tbm_surface.h> #include <tbm_surface_internal.h> +#else +#include <mmf/mm_types.h> +#endif #undef EXYNOS_LOG_TAG #define EXYNOS_LOG_TAG "Exynos_OSAL_Tizen" @@ -161,8 +165,12 @@ OMX_ERRORTYPE Exynos_OSAL_GetParameter( EXYNOS_OMX_BASEPORT *pExynosPort = &pExynosComponent->pExynosPort[pPortDef->nPortIndex]; if (pExynosPort->eMetaDataType == METADATA_TYPE_DATA) +#ifdef TIZEN_FEATURE_TIZEN_ALLOCATOR pPortDef->nBufferSize = (ALIGN(pExynosPort->portDefinition.format.video.nFrameWidth, 16) * ALIGN(pExynosPort->portDefinition.format.video.nFrameHeight, 16) * 3) / 2; +#else + pPortDef->nBufferSize = sizeof(MMVideoBuffer); +#endif } break; default: @@ -361,8 +369,13 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData( OMX_IN EXYNOS_METADATA_TYPE eMetaDataType) { OMX_ERRORTYPE ret = OMX_ErrorNone; +#ifdef TIZEN_FEATURE_TIZEN_ALLOCATOR tbm_surface_h surface; tbm_bo bo[2]; +#else + MMVideoBuffer *pMetaBuffer = NULL; +#endif + int i; FunctionIn(); @@ -376,6 +389,7 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData( } if (eMetaDataType == METADATA_TYPE_DATA) { +#ifdef TIZEN_FEATURE_TIZEN_ALLOCATOR surface = (tbm_surface_h)pBuffer; bo[0] = tbm_surface_internal_get_bo(surface, 0); @@ -384,6 +398,13 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData( 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); +#else + pMetaBuffer = (MMVideoBuffer *)pBuffer; + + 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]); +#endif Exynos_OSAL_Log(EXYNOS_LOG_ESSENTIAL, "[%s] Plane[%d]: FD(%u), VA(%p)", __FUNCTION__, i, pBufferInfo->fd[i], pBufferInfo->addr[i]); @@ -436,8 +457,11 @@ OMX_PTR Exynos_OSAL_AllocMetaDataBuffer( FunctionIn(); if (eMetaDataType == METADATA_TYPE_DATA) { +#ifdef TIZEN_FEATURE_TIZEN_ALLOCATOR pBuffer = Exynos_OSAL_Malloc(sizeof(tbm_surface_h)); - +#else + pBuffer = Exynos_OSAL_Malloc(sizeof(MMVideoBuffer)); +#endif 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 ba32311..fd73153 100755 --- a/openmax/osal/Makefile.am +++ b/openmax/osal/Makefile.am @@ -12,8 +12,10 @@ 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 \ - $(TBM_LIBS) +libExynosOMX_OSAL_la_LIBADD = $(top_builddir)/exynos/libvideocodec/libExynosVideoApi.la +if TIZEN_ALLOCATOR +libExynosOMX_OSAL_la_LIBADD += $(TBM_LIBS) +endif libExynosOMX_OSAL_la_CFLAGS = -I$(top_srcdir)/openmax/include/khronos \ -I$(top_srcdir)/openmax/include/exynos \ @@ -28,3 +30,8 @@ if USE_DLOG libExynosOMX_OSAL_la_CFLAGS += $(DLOG_CFLAGS) -DUSE_DLOG libExynosOMX_OSAL_la_LIBADD += $(DLOG_LIBS) endif + +if TIZEN_ALLOCATOR +libExynosOMX_OSAL_la_CFLAGS += $(TBM_CFLAGS) -DTIZEN_FEATURE_TIZEN_ALLOCATOR +endif + |