} else {
exynosInputPort->bufferProcessType = BUFFER_COPY;
}
-
- if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
- OMX_U32 nPlaneSize[MFC_INPUT_BUFFER_PLANE] = {0, };
- nPlaneSize[0] = DEFAULT_MFC_INPUT_YBUFFER_SIZE;
- nPlaneSize[1] = DEFAULT_MFC_INPUT_CBUFFER_SIZE;
-
- Exynos_OSAL_SemaphoreCreate(&exynosInputPort->codecSemID);
- Exynos_OSAL_QueueCreate(&exynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
-
- ret = Exynos_Allocate_CodecBuffers(pOMXComponent, INPUT_PORT_INDEX, MFC_INPUT_BUFFER_NUM_MAX, nPlaneSize);
- if (ret != OMX_ErrorNone)
- goto EXIT;
-
- for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++)
- Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoEnc->pMFCEncInputBuffer[i]);
- } else if (exynosInputPort->bufferProcessType == BUFFER_SHARE) {
- /*************/
- /* TBD */
- /*************/
- /* Does not require any actions. */
- }
}
}
+ if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
+ OMX_U32 nPlaneSize[MFC_INPUT_BUFFER_PLANE] = {0, };
+ nPlaneSize[0] = ALIGN_TO_16B(exynosInputPort->portDefinition.format.video.nFrameWidth)
+ * ALIGN_TO_16B(exynosInputPort->portDefinition.format.video.nFrameHeight);
+ nPlaneSize[1] = ALIGN((nPlaneSize[0] / 2), 256);
+
+ Exynos_OSAL_SemaphoreCreate(&exynosInputPort->codecSemID);
+ Exynos_OSAL_QueueCreate(&exynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
+
+ ret = Exynos_Allocate_CodecBuffers(pOMXComponent, INPUT_PORT_INDEX, MFC_INPUT_BUFFER_NUM_MAX, nPlaneSize);
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++)
+ Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoEnc->pMFCEncInputBuffer[i]);
+ } else if (exynosInputPort->bufferProcessType == BUFFER_SHARE) {
+ /*************/
+ /* TBD */
+ /*************/
+ /* Does not require any actions. */
+ }
+
EXIT:
return ret;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
pExynosComponent->bBehaviorEOS = OMX_FALSE;
- pVideoEnc->bFirstInput = OMX_FALSE;
+ pVideoEnc->bFirstInput = OMX_TRUE;
pVideoEnc->bFirstOutput = OMX_FALSE;
pVideoEnc->configChange = OMX_FALSE;
pVideoEnc->quantization.nQpI = 4; // I frame quantization parameter
pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
- if ((pExynosInputPort->bStoreMetaData != OMX_TRUE) &&
- (eColorFormat != OMX_COLOR_FormatAndroidOpaque)) {
- if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
- OMX_U32 nPlaneSize[MFC_INPUT_BUFFER_PLANE] = {0, };
- nPlaneSize[0] = DEFAULT_MFC_INPUT_YBUFFER_SIZE;
- nPlaneSize[1] = DEFAULT_MFC_INPUT_CBUFFER_SIZE;
-
- Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
- Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
-
- ret = Exynos_Allocate_CodecBuffers(pOMXComponent, INPUT_PORT_INDEX, MFC_INPUT_BUFFER_NUM_MAX, nPlaneSize);
- if (ret != OMX_ErrorNone)
- goto EXIT;
-
- for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++)
- Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoEnc->pMFCEncInputBuffer[i]);
- } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
- /*************/
- /* TBD */
- /*************/
- /* Does not require any actions. */
- }
- }
-
if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosOutputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosOutputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
Exynos_Free_CodecBuffers(pOMXComponent, INPUT_PORT_INDEX);
Exynos_OSAL_QueueTerminate(&pExynosInputPort->codecBufferQ);
Exynos_OSAL_SemaphoreTerminate(pExynosInputPort->codecSemID);
+ pVideoEnc->bFirstInput = OMX_TRUE;
} else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
/*************/
/* TBD */
pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
- if ((pExynosInputPort->bStoreMetaData != OMX_TRUE) &&
- (eColorFormat != OMX_COLOR_FormatAndroidOpaque)) {
- if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
- OMX_U32 nPlaneSize[MFC_INPUT_BUFFER_PLANE] = {0, };
- nPlaneSize[0] = DEFAULT_MFC_INPUT_YBUFFER_SIZE;
- nPlaneSize[1] = DEFAULT_MFC_INPUT_CBUFFER_SIZE;
-
- Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
- Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
-
- ret = Exynos_Allocate_CodecBuffers(pOMXComponent, INPUT_PORT_INDEX, MFC_INPUT_BUFFER_NUM_MAX, nPlaneSize);
- if (ret != OMX_ErrorNone)
- goto EXIT;
-
- for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++)
- Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoEnc->pMFCEncInputBuffer[i]);
- } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
- /*************/
- /* TBD */
- /*************/
- /* Does not require any actions. */
- }
- }
-
if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosOutputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosOutputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
Exynos_Free_CodecBuffers(pOMXComponent, INPUT_PORT_INDEX);
Exynos_OSAL_QueueTerminate(&pExynosInputPort->codecBufferQ);
Exynos_OSAL_SemaphoreTerminate(pExynosInputPort->codecSemID);
+ pVideoEnc->bFirstInput = OMX_TRUE;
} else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
/*************/
/* TBD */
pExynosPort->bStoreMetaData = pANBParams->bStoreMetaData;
if (pExynosComponent->codecType == HW_VIDEO_ENC_CODEC) {
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;;
- pVideoEnc->bFirstInput = OMX_TRUE;
} else if (pExynosComponent->codecType == HW_VIDEO_DEC_CODEC) {
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;;
if ((portIndex == OUTPUT_PORT_INDEX) &&