#include "Exynos_OMX_Baseport.h"
#include "Exynos_OMX_Basecomponent.h"
#include "Exynos_OMX_Macros.h"
-#include "Exynos_OMX_Vdec.h"
-#include "Exynos_OMX_Venc.h"
#include "Exynos_OSAL_Android.h"
#include "exynos_format.h"
extern "C" {
#endif
+static int lockCnt = 0;
OMX_ERRORTYPE Exynos_OSAL_LockANBHandle(
OMX_IN OMX_U32 handle,
case OMX_SEC_COLOR_FormatNV12Tiled:
usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
break;
+ case OMX_COLOR_FormatAndroidOpaque:
+ {
+ OMX_COLOR_FORMATTYPE formatType;
+ formatType = Exynos_OSAL_GetANBColorFormat((OMX_U32)priv_hnd);
+ if ((formatType == OMX_COLOR_FormatYUV420SemiPlanar) ||
+ (formatType == OMX_SEC_COLOR_FormatNV12Tiled))
+ usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
+ else
+ usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_HW_VIDEO_ENCODER;
+ }
+ break;
default:
usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
break;
ret = OMX_ErrorUndefined;
goto EXIT;
}
+ lockCnt++;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: lockCnt:%d", __func__, lockCnt);
#ifdef USE_DMA_BUF
vplanes[0].fd = priv_hnd->fd;
ret = OMX_ErrorUndefined;
goto EXIT;
}
+ lockCnt--;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: lockCnt:%d", __func__, lockCnt);
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer unlocked: 0x%x", __func__, handle);
* modifications since currently not defined what the 'nUsage' is for.
*/
pANBParams->nUsage |= (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
+#if defined(USE_IMPROVED_BUFFER) && !defined(USE_CSC_HW)
+ pANBParams->nUsage |= (GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
+#endif
}
break;
switch (nIndex) {
case OMX_IndexParamEnableAndroidBuffers:
{
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EnableAndroidNativeBuffersParams *pANBParams = (EnableAndroidNativeBuffersParams *) ComponentParameterStructure;
OMX_U32 portIndex = pANBParams->nPortIndex;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
goto EXIT;
}
- /* ANB and DPB Buffer Sharing */
pExynosPort->bIsANBEnabled = pANBParams->enable;
+
+#ifdef USE_ANB_OUTBUF_SHARE
+ /* ANB and DPB Buffer Sharing */
if ((portIndex == OUTPUT_PORT_INDEX) &&
(pExynosPort->bIsANBEnabled == OMX_TRUE) &&
((pExynosPort->bufferProcessType & BUFFER_ANBSHARE) == BUFFER_ANBSHARE)) {
pExynosPort->bufferProcessType = BUFFER_SHARE;
pExynosPort->portDefinition.format.video.eColorFormat = (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12Tiled;
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "OMX_IndexParamEnableAndroidBuffers & bufferProcessType change to BUFFER_SHARE");
+ Exynos_OSAL_Log(EXYNOS_LOG_INFO, "output buffer sharing mode is on");
}
+#else
+ if ((portIndex == OUTPUT_PORT_INDEX) &&
+ (pExynosPort->bufferProcessType & BUFFER_COPY)) {
+ pExynosPort->bufferProcessType = BUFFER_COPY;
+ pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
+ }
+#endif
}
break;
case OMX_IndexParamUseAndroidNativeBuffer:
{
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
UseAndroidNativeBufferParams *pANBParams = (UseAndroidNativeBufferParams *) ComponentParameterStructure;
OMX_U32 portIndex = pANBParams->nPortIndex;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
case OMX_IndexParamStoreMetaDataBuffer:
{
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;;
StoreMetaDataInBuffersParams *pANBParams = (StoreMetaDataInBuffersParams *) ComponentParameterStructure;
OMX_U32 portIndex = pANBParams->nPortIndex;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
}
pExynosPort->bStoreMetaData = pANBParams->bStoreMetaData;
- pVideoEnc->bFirstInput = OMX_TRUE;
}
break;
return ret;
}
+OMX_ERRORTYPE Exynos_OSAL_SetPrependSPSPPSToIDR(
+ OMX_PTR pComponentParameterStructure,
+ OMX_PTR pbPrependSpsPpsToIdr)
+{
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ PrependSPSPPSToIDRFramesParams *pANBParams = (PrependSPSPPSToIDRFramesParams *)pComponentParameterStructure;
+ ret = Exynos_OMX_Check_SizeVersion(pANBParams, sizeof(PrependSPSPPSToIDRFramesParams));
+ if (ret != OMX_ErrorNone) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s: Exynos_OMX_Check_SizeVersion(PrependSPSPPSToIDRFramesParams) is failed", __func__);
+ goto EXIT;
+ }
+
+ (*((OMX_BOOL *)pbPrependSpsPpsToIdr)) = pANBParams->bEnable;
+
+EXIT:
+ return ret;
+}
+
OMX_COLOR_FORMATTYPE Exynos_OSAL_Hal2OMXPixelFormat(
unsigned int hal_format)
{
case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
omx_format = (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12Tiled;
break;
- case HAL_PIXEL_FORMAT_ARGB888:
+ case HAL_PIXEL_FORMAT_RGBA_8888:
omx_format = OMX_COLOR_Format32bitARGB8888;
break;
default:
hal_format = HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED;
break;
case OMX_COLOR_Format32bitARGB8888:
- hal_format = HAL_PIXEL_FORMAT_ARGB888;
+ hal_format = HAL_PIXEL_FORMAT_RGBA_8888;
break;
default:
hal_format = HAL_PIXEL_FORMAT_YCbCr_420_P;