#include "Exynos_OSAL_ETC.h"
#include "ExynosVideoApi.h"
#include "csc.h"
+#include "Exynos_OSAL_SharedMemory.h"
#undef EXYNOS_LOG_TAG
#define EXYNOS_LOG_TAG "EXYNOS_VIDEO_ENC"
OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
CODEC_ENC_BUFFER *pInputCodecBuffer = (CODEC_ENC_BUFFER*)codecBuffer;
pData->buffer.multiPlaneBuffer.dataBuffer[0] = pInputCodecBuffer->pVirAddr[0];
void Exynos_Wait_ProcessPause(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex)
{
- EXYNOS_OMX_BASEPORT *exynosOMXInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *exynosOMXPort = NULL;
FunctionIn();
OMX_U32 nFrameHeight = exynosInputPort->portDefinition.format.video.nFrameHeight;
OMX_COLOR_FORMATTYPE eColorFormat = exynosInputPort->portDefinition.format.video.eColorFormat;
OMX_BYTE checkInputStream = NULL;
- OMX_BOOL flagEOS = OMX_FALSE;
FunctionIn();
csc_get_method(pVideoEnc->csc_handle, &csc_method);
if (csc_method == CSC_METHOD_HW) {
- pDstBuf[0] = srcInputData->buffer.multiPlaneBuffer.fd[0];
- pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.fd[1];
- pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.fd[2];
+ pDstBuf[0] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[0]);
+ pDstBuf[1] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[1]);
+ pDstBuf[2] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[2]);
}
#ifdef USE_METADATABUFFERTYPE
ret = OMX_TRUE;
-EXIT:
FunctionOut();
return ret;
{
OMX_BOOL ret = OMX_FALSE;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_DATABUFFER *inputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer;
- OMX_U32 nFrameWidth = exynosInputPort->portDefinition.format.video.nFrameWidth;
- OMX_U32 nFrameHeight = exynosInputPort->portDefinition.format.video.nFrameHeight;
- OMX_COLOR_FORMATTYPE eColorFormat = exynosInputPort->portDefinition.format.video.eColorFormat;
OMX_U32 copySize = 0;
- OMX_BYTE checkInputStream = NULL;
OMX_U32 checkInputStreamLen = 0;
- OMX_BOOL flagEOS = OMX_FALSE;
FunctionIn();
/* kMetadataBufferTypeCameraSource */
Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)inputUseBuffer->bufferHeader->pBuffer, ppBuf);
#ifdef USE_DMA_BUF
+ EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
+
srcInputData->buffer.multiPlaneBuffer.fd[0] = ppBuf[0];
srcInputData->buffer.multiPlaneBuffer.fd[1] = ppBuf[1];
allocSize[0] = nFrameWidth * nFrameHeight;
/* reset dataBuffer */
Exynos_ResetDataBuffer(inputUseBuffer);
} else if (exynosInputPort->bufferProcessType & BUFFER_COPY) {
- checkInputStream = inputUseBuffer->bufferHeader->pBuffer + inputUseBuffer->usedDataLen;
checkInputStreamLen = inputUseBuffer->remainDataLen;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
if (checkInputStreamLen == 0) {
inputUseBuffer->nFlags |= OMX_BUFFERFLAG_EOS;
- flagEOS = OMX_TRUE;
}
copySize = checkInputStreamLen;
EXYNOS_OMX_DATABUFFER *srcInputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer;
EXYNOS_OMX_DATA *pSrcInputData = &exynosInputPort->processData;
OMX_BOOL bCheckInputData = OMX_FALSE;
- OMX_BOOL bValidCodecData = OMX_FALSE;
FunctionIn();
ret = pVideoEnc->exynos_codec_srcInputProcess(pOMXComponent, pSrcInputData);
Exynos_ResetCodecData(pSrcInputData);
Exynos_OSAL_MutexUnlock(srcInputUseBuffer->bufferMutex);
- if (ret == OMX_ErrorCodecInit)
+ if (ret == (OMX_ERRORTYPE)OMX_ErrorCodecInit)
pVideoEnc->bExitBufferProcessThread = OMX_TRUE;
}
}
-EXIT:
-
FunctionOut();
return ret;
}
}
-EXIT:
-
FunctionOut();
return ret;
}
}
-EXIT:
-
FunctionOut();
return ret;
}
}
-EXIT:
-
FunctionOut();
return ret;
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_SrcInputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_SrcOutputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_DstInputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_DstOutputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
Exynos_OMX_SrcInputProcessThread,
pOMXComponent);
-EXIT:
FunctionOut();
return ret;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
OMX_S32 countValue = 0;
- unsigned int i = 0;
FunctionIn();
Exynos_OSAL_ThreadTerminate(pVideoEnc->hDstOutputThread);
pVideoEnc->hDstOutputThread = NULL;
-EXIT:
FunctionOut();
return ret;