EXIT:
return ret;
}
-
-OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer)
-{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
- pUseBuffer->bufferHeader = pData->bufferHeader;
- pUseBuffer->allocSize = pData->allocSize;
- pUseBuffer->dataLen = pData->dataLen;
- pUseBuffer->usedDataLen = pData->usedDataLen;
- pUseBuffer->remainDataLen = pData->remainDataLen;
- pUseBuffer->timeStamp = pData->timeStamp;
- pUseBuffer->nFlags = pData->nFlags;
- pUseBuffer->pPrivate = pData->pPrivate;
-
- return ret;
-}
OMX_ERRORTYPE Exynos_ResetDataBuffer(EXYNOS_OMX_DATABUFFER *pDataBuffer);
OMX_ERRORTYPE Exynos_ResetCodecData(EXYNOS_OMX_DATA *pData);
OMX_ERRORTYPE Exynos_Shared_BufferToData(EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_PLANE nPlane);
-OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer);
#ifdef __cplusplus
};
return ret;
}
#endif
+
+OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer)
+{
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+
+ pUseBuffer->bufferHeader = pData->bufferHeader;
+ pUseBuffer->allocSize = pData->allocSize;
+ pUseBuffer->dataLen = pData->dataLen;
+ pUseBuffer->usedDataLen = pData->usedDataLen;
+ pUseBuffer->remainDataLen = pData->remainDataLen;
+ pUseBuffer->timeStamp = pData->timeStamp;
+ pUseBuffer->nFlags = pData->nFlags;
+ pUseBuffer->pPrivate = pData->pPrivate;
+
+ return ret;
+}
OMX_ERRORTYPE Exynos_Shared_DataToANBBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_BASEPORT *pExynosPort);
#endif
+OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer);
+
#ifdef __cplusplus
}
#endif
FunctionIn();
if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) {
- if (Exynos_Shared_DataToBuffer(dstOutputData, outputUseBuffer) == OMX_ErrorNone)
+ if (Exynos_Shared_DataToBuffer(dstOutputData, outputUseBuffer, OMX_FALSE) == OMX_ErrorNone)
outputUseBuffer->dataValid = OMX_TRUE;
}
Exynos_CodecBufferEnqueue(pExynosComponent, INPUT_PORT_INDEX, codecBuffer);
}
if (exynosInputPort->bufferProcessType & BUFFER_SHARE) {
- Exynos_Shared_DataToBuffer(&srcOutputData, srcOutputUseBuffer);
+ OMX_BOOL bNeedUnlock = OMX_FALSE;
+ OMX_COLOR_FORMATTYPE eColorFormat = exynosInputPort->portDefinition.format.video.eColorFormat;
+ if (eColorFormat == OMX_COLOR_FormatAndroidOpaque)
+ bNeedUnlock = OMX_TRUE;
+ Exynos_Shared_DataToBuffer(&srcOutputData, srcOutputUseBuffer, bNeedUnlock);
Exynos_InputBufferReturn(pOMXComponent);
}
Exynos_ResetCodecData(&srcOutputData);
if (pExynosPort->bufferProcessType & BUFFER_SHARE) {
if (pExynosPort->processData.bufferHeader != NULL) {
if (nPortIndex == INPUT_PORT_INDEX) {
+#ifdef USE_METADATABUFFERTYPE
+ if ((pExynosPort->bStoreMetaData == OMX_TRUE) &&
+ (pExynosPort->portDefinition.format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque)) {
+ OMX_PTR ppBuf[MAX_BUFFER_PLANE];
+ Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)pExynosPort->processData.bufferHeader->pBuffer, ppBuf);
+ Exynos_OSAL_UnlockANBHandle(ppBuf[0]);
+ }
+#endif
Exynos_OMX_InputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader);
} else if (nPortIndex == OUTPUT_PORT_INDEX) {
Exynos_OMX_OutputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader);
Exynos_OMX_OutputBufferReturn(pOMXComponent,
pExynosPort->extendBufferHeader[i].OMXBufferHeader);
} else if (nPortIndex == INPUT_PORT_INDEX) {
+#ifdef USE_METADATABUFFERTYPE
+ if ((pExynosPort->bStoreMetaData == OMX_TRUE) &&
+ (pExynosPort->portDefinition.format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque)) {
+ OMX_PTR ppBuf[MAX_BUFFER_PLANE];
+ Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)pExynosPort->extendBufferHeader[i].OMXBufferHeader->pBuffer, ppBuf);
+ Exynos_OSAL_UnlockANBHandle(ppBuf[0]);
+ }
+#endif
Exynos_OMX_InputBufferReturn(pOMXComponent,
pExynosPort->extendBufferHeader[i].OMXBufferHeader);
}
return ret;
}
+
+OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, OMX_BOOL bNeedUnlock)
+{
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+
+ pUseBuffer->bufferHeader = pData->bufferHeader;
+ pUseBuffer->allocSize = pData->allocSize;
+ pUseBuffer->dataLen = pData->dataLen;
+ pUseBuffer->usedDataLen = pData->usedDataLen;
+ pUseBuffer->remainDataLen = pData->remainDataLen;
+ pUseBuffer->timeStamp = pData->timeStamp;
+ pUseBuffer->nFlags = pData->nFlags;
+ pUseBuffer->pPrivate = pData->pPrivate;
+
+ if ((bNeedUnlock == OMX_TRUE) && (pUseBuffer->bufferHeader != NULL)) {
+ OMX_PTR ppBuf[MAX_BUFFER_PLANE];
+ Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)pUseBuffer->bufferHeader->pBuffer, ppBuf);
+ Exynos_OSAL_UnlockANBHandle(ppBuf[0]);
+ }
+
+ return ret;
+}
OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent);\r
OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *pDataBuffer);\r
OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *pDataBuffer);\r
+OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, OMX_BOOL bNeedUnlock);\r
+\r
#ifdef __cplusplus\r
}\r
#endif\r
extern "C" {
#endif
+static int lockCnt = 0;
OMX_ERRORTYPE Exynos_OSAL_LockANBHandle(
OMX_IN OMX_U32 handle,
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);