From 24ec2c82ee052fc55f2906d477d5db681fae0048 Mon Sep 17 00:00:00 2001 From: Jinsung Yang Date: Mon, 29 Oct 2012 11:45:44 +0900 Subject: [PATCH] video/common: Code cleanup for bitmask comparisons This patch cleans up the coding style of bitmask comparisons for easy understanding like below: - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) + if (pexynosOutputPort->bufferProcessType & BUFFER_SHARE) Change-Id: I43e0e216ac13e1e84dbe1822bc69984ad4ca4555 Signed-off-by: Jinsung Yang Signed-off-by: Huisung Kang --- component/common/Exynos_OMX_Basecomponent.c | 8 ++-- component/video/dec/Exynos_OMX_Vdec.c | 34 +++++++------- component/video/dec/Exynos_OMX_VdecControl.c | 22 +++++----- component/video/dec/h264/Exynos_OMX_H264dec.c | 44 +++++++++---------- .../video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 44 +++++++++---------- component/video/dec/vp8/Exynos_OMX_Vp8dec.c | 44 +++++++++---------- component/video/enc/Exynos_OMX_Venc.c | 32 +++++++------- component/video/enc/Exynos_OMX_VencControl.c | 20 ++++----- component/video/enc/h264/Exynos_OMX_H264enc.c | 44 +++++++++---------- .../video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 44 +++++++++---------- 10 files changed, 168 insertions(+), 168 deletions(-) diff --git a/component/common/Exynos_OMX_Basecomponent.c b/component/common/Exynos_OMX_Basecomponent.c index f9769ef..252cdb2 100644 --- a/component/common/Exynos_OMX_Basecomponent.c +++ b/component/common/Exynos_OMX_Basecomponent.c @@ -235,7 +235,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX for (i = 0; i < ALL_PORT_NUM; i++) { Exynos_OSAL_SignalTerminate(pExynosComponent->pExynosPort[i].pauseEvent); pExynosComponent->pExynosPort[i].pauseEvent = NULL; - if (pExynosComponent->pExynosPort[i].bufferProcessType == BUFFER_SHARE) { + if (pExynosComponent->pExynosPort[i].bufferProcessType & BUFFER_SHARE) { Exynos_OSAL_SignalTerminate(&pExynosComponent->pExynosPort[i].hAllCodecBufferReturnEvent); pExynosComponent->pExynosPort[i].hAllCodecBufferReturnEvent = NULL; } @@ -280,7 +280,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX for (i = 0; i < ALL_PORT_NUM; i++) { Exynos_OSAL_SignalTerminate(pExynosComponent->pExynosPort[i].pauseEvent); pExynosComponent->pExynosPort[i].pauseEvent = NULL; - if (pExynosComponent->pExynosPort[i].bufferProcessType == BUFFER_SHARE) { + if (pExynosComponent->pExynosPort[i].bufferProcessType & BUFFER_SHARE) { Exynos_OSAL_SignalTerminate(&pExynosComponent->pExynosPort[i].hAllCodecBufferReturnEvent); pExynosComponent->pExynosPort[i].hAllCodecBufferReturnEvent = NULL; } @@ -364,7 +364,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX } else { for (i = 0; i < ALL_PORT_NUM; i++) { Exynos_OSAL_SignalCreate(&pExynosComponent->pExynosPort[i].pauseEvent); - if (pExynosComponent->pExynosPort[i].bufferProcessType == BUFFER_SHARE) + if (pExynosComponent->pExynosPort[i].bufferProcessType & BUFFER_SHARE) Exynos_OSAL_SignalCreate(&pExynosComponent->pExynosPort[i].hAllCodecBufferReturnEvent); } } @@ -417,7 +417,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX for (i = 0; i < ALL_PORT_NUM; i++) { Exynos_OSAL_SignalTerminate(pExynosComponent->pExynosPort[i].pauseEvent); pExynosComponent->pExynosPort[i].pauseEvent = NULL; - if (pExynosComponent->pExynosPort[i].bufferProcessType == BUFFER_SHARE) { + if (pExynosComponent->pExynosPort[i].bufferProcessType & BUFFER_SHARE) { Exynos_OSAL_SignalTerminate(&pExynosComponent->pExynosPort[i].hAllCodecBufferReturnEvent); pExynosComponent->pExynosPort[i].hAllCodecBufferReturnEvent = NULL; } diff --git a/component/video/dec/Exynos_OMX_Vdec.c b/component/video/dec/Exynos_OMX_Vdec.c index 2f8b72c..b7e0980 100644 --- a/component/video/dec/Exynos_OMX_Vdec.c +++ b/component/video/dec/Exynos_OMX_Vdec.c @@ -329,7 +329,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ FunctionIn(); - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { if ((srcInputData->buffer.singlePlaneBuffer.dataBuffer == NULL) || (srcInputData->pPrivate == NULL)) { ret = OMX_FALSE; @@ -338,7 +338,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ } if (inputUseBuffer->dataValid == OMX_TRUE) { - if (exynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosInputPort->bufferProcessType & BUFFER_SHARE) { Exynos_Shared_BufferToData(inputUseBuffer, srcInputData, ONE_PLANE); if (pVideoDec->bDRMPlayerMode == OMX_TRUE) { @@ -356,7 +356,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ /* reset dataBuffer */ Exynos_ResetDataBuffer(inputUseBuffer); - } else if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + } else if (exynosInputPort->bufferProcessType & BUFFER_COPY) { checkInputStream = inputUseBuffer->bufferHeader->pBuffer + inputUseBuffer->usedDataLen; checkInputStreamLen = inputUseBuffer->remainDataLen; @@ -430,7 +430,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ FunctionIn(); - if (exynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) { if (exynosOutputPort->bIsANBEnabled == OMX_FALSE) { if (Exynos_Shared_DataToBuffer(dstOutputData, outputUseBuffer) == OMX_ErrorNone) outputUseBuffer->dataValid = OMX_TRUE; @@ -457,7 +457,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ pExynosComponent->checkTimeStamp.needCheckStartTimeStamp = OMX_FALSE; } else { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "drop frame after seeking", pExynosComponent); - if (exynosOutputPort->bufferProcessType == BUFFER_SHARE) + if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) Exynos_OMX_FillThisBuffer(pOMXComponent, outputUseBuffer->bufferHeader); ret = OMX_TRUE; goto EXIT; @@ -468,7 +468,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ goto EXIT; } - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { OMX_U32 width = 0, height = 0; int imageSize = 0; void *pOutputBuf = (void *)outputUseBuffer->bufferHeader->pBuffer; @@ -521,7 +521,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ OMX_EventError, OMX_ErrorUndefined, 0, NULL); ret = OMX_FALSE; } - } else if (exynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((outputUseBuffer->remainDataLen > 0) || ((outputUseBuffer->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) || (CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) @@ -568,7 +568,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_MutexLock(srcInputUseBuffer->bufferMutex); if (ret != OMX_ErrorInputDataDecodeYet) { - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; if ((pSrcInputData->buffer.singlePlaneBuffer.dataBuffer == NULL) || (pSrcInputData->pPrivate == NULL)) { Exynos_CodecBufferDeQueue(pExynosComponent, INPUT_PORT_INDEX, &codecBuffer); @@ -632,7 +632,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_SleepMillisec(0); while (!pVideoDec->bExitBufferProcessThread) { - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { if (Exynos_Check_BufferProcess_State(pExynosComponent, INPUT_PORT_INDEX) == OMX_FALSE) break; } @@ -645,13 +645,13 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent) ret = pVideoDec->exynos_codec_srcOutputProcess(pOMXComponent, &srcOutputData); if (ret == OMX_ErrorNone) { - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; codecBuffer = srcOutputData.pPrivate; if (codecBuffer != NULL) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, codecBuffer); } - if (exynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosInputPort->bufferProcessType & BUFFER_SHARE) { Exynos_Shared_DataToBuffer(&srcOutputData, srcOutputUseBuffer); Exynos_InputBufferReturn(pOMXComponent); } @@ -695,7 +695,7 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_MutexLock(dstInputUseBuffer->bufferMutex); if (ret != OMX_ErrorOutputBufferUseYet) { - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; ret = Exynos_CodecBufferDeQueue(pExynosComponent, OUTPUT_PORT_INDEX, &codecBuffer); if (ret != OMX_ErrorNone) { @@ -705,7 +705,7 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_Output_CodecBufferToData(pExynosComponent, codecBuffer, &dstInputData); } - if (exynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((dstInputUseBuffer->dataValid != OMX_TRUE) && (!CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) { ret = Exynos_OutputBufferGetQueue(pExynosComponent); @@ -772,7 +772,7 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent) break; Exynos_OSAL_MutexLock(dstOutputUseBuffer->bufferMutex); - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((dstOutputUseBuffer->dataValid != OMX_TRUE) && (!CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) { ret = Exynos_OutputBufferGetQueue(pExynosComponent); @@ -784,15 +784,15 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent) } if ((dstOutputUseBuffer->dataValid == OMX_TRUE) || - (exynosOutputPort->bufferProcessType == BUFFER_SHARE)) + (exynosOutputPort->bufferProcessType & BUFFER_SHARE)) ret = pVideoDec->exynos_codec_dstOutputProcess(pOMXComponent, pDstOutputData); if (((ret == OMX_ErrorNone) && (dstOutputUseBuffer->dataValid == OMX_TRUE)) || - (exynosOutputPort->bufferProcessType == BUFFER_SHARE)) { + (exynosOutputPort->bufferProcessType & BUFFER_SHARE)) { Exynos_Postprocess_OutputData(pOMXComponent, pDstOutputData); } - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; codecBuffer = pDstOutputData->pPrivate; if (codecBuffer != NULL) { diff --git a/component/video/dec/Exynos_OMX_VdecControl.c b/component/video/dec/Exynos_OMX_VdecControl.c index 432a4a7..0fe109b 100644 --- a/component/video/dec/Exynos_OMX_VdecControl.c +++ b/component/video/dec/Exynos_OMX_VdecControl.c @@ -196,7 +196,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) && (nPortIndex == INPUT_PORT_INDEX)) { mem_type = SECURE_MEMORY; - } else if (pExynosPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) { mem_type = NORMAL_MEMORY; } else { mem_type = SYSTEM_MEMORY; @@ -459,7 +459,7 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por } if (pExynosComponent->bMultiThreadProcess == OMX_TRUE) { - if (pExynosPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosPort->bufferProcessType & BUFFER_SHARE) { if (pExynosPort->processData.bufferHeader != NULL) { if (portIndex == INPUT_PORT_INDEX) { Exynos_OMX_InputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader); @@ -539,7 +539,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n pExynosPort = &pExynosComponent->pExynosPort[nPortIndex]; Exynos_OMX_GetFlushBuffer(pExynosPort, flushPortBuffer); - if ((pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) Exynos_OSAL_SemaphorePost(pExynosPort->codecSemID); Exynos_OSAL_SemaphorePost(pExynosPort->bufferSemID); @@ -548,7 +548,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n pVideoDec->exynos_codec_stop(pOMXComponent, nPortIndex); Exynos_OSAL_MutexLock(flushPortBuffer[1]->bufferMutex); ret = Exynos_OMX_FlushPort(pOMXComponent, nPortIndex); - if ((pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) pVideoDec->exynos_codec_enqueueAllBuffer(pOMXComponent, nPortIndex); Exynos_ResetCodecData(&pExynosPort->processData); @@ -598,9 +598,9 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent) FunctionIn(); - if ((exynosOMXInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOMXInputPort->bufferProcessType & BUFFER_COPY) { dataBuffer = &(exynosOMXInputPort->way.port2WayDataBuffer.inputDataBuffer); - } else if (exynosOMXInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (exynosOMXInputPort->bufferProcessType & BUFFER_SHARE) { dataBuffer = &(exynosOMXInputPort->way.port2WayDataBuffer.outputDataBuffer); } @@ -838,9 +838,9 @@ OMX_ERRORTYPE Exynos_OutputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompo FunctionIn(); - if ((pExynosPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosPort->bufferProcessType & BUFFER_COPY) { outputUseBuffer = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer); - } else if (pExynosPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) { outputUseBuffer = &(pExynosPort->way.port2WayDataBuffer.inputDataBuffer); } @@ -871,9 +871,9 @@ OMX_ERRORTYPE Exynos_OutputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompo /* dataBuffer->nFlags = dataBuffer->bufferHeader->nFlags; */ /* dataBuffer->nTimeStamp = dataBuffer->bufferHeader->nTimeStamp; */ /* - if (pExynosPort->bufferProcessType == BUFFER_SHARE) + if (pExynosPort->bufferProcessType & BUFFER_SHARE) outputUseBuffer->pPrivate = outputUseBuffer->bufferHeader->pOutputPortPrivate; - else if ((pExynosPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + else if (pExynosPort->bufferProcessType & BUFFER_COPY) { pExynosPort->processData.dataBuffer = outputUseBuffer->bufferHeader->pBuffer; pExynosPort->processData.allocSize = outputUseBuffer->bufferHeader->nAllocLen; } @@ -1312,7 +1312,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter( break; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { pExynosOutputPort->portDefinition.nBufferSize = calc_plane(pExynosPort->portDefinition.format.video.nFrameWidth, pExynosOutputPort->portDefinition.format.video.nFrameHeight) + calc_plane(pExynosPort->portDefinition.format.video.nFrameWidth, pExynosOutputPort->portDefinition.format.video.nFrameHeight >> 1); diff --git a/component/video/dec/h264/Exynos_OMX_H264dec.c b/component/video/dec/h264/Exynos_OMX_H264dec.c index d83e6b9..366c18f 100644 --- a/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -683,11 +683,11 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf)); bufferConf.eCompressionFormat = VIDEO_CODING_AVC; pInbufOps->Set_Shareable(hMFCHandle); - if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2; inputBufferNumber = MAX_VIDEO_INPUTBUFFER_NUM; - } else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE; inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX; } @@ -712,7 +712,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { /* Register input buffer */ for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { ExynosVideoPlane plane; @@ -725,7 +725,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT goto EXIT; } } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /* Register input buffer */ for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) { ExynosVideoPlane plane; @@ -792,7 +792,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT pExynosOutputPort->cropRectangle.nWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth; pExynosOutputPort->cropRectangle.nHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) || (pExynosInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight)) { pExynosInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth; @@ -812,7 +812,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT 0, NULL); } - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) || (pExynosInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight) || (pExynosOutputPort->portDefinition.nBufferCountActual != pH264Dec->hMFCH264Handle.maxDPBNum)) { @@ -887,7 +887,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) /* get dpb count */ nOutbufs = pH264Dec->hMFCH264Handle.maxDPBNum; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { /* should be done before prepare output buffer */ if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) { ret = OMX_ErrorInsufficientResources; @@ -912,7 +912,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) nAllocLen[1] = calc_plane(pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth, pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight >> 1); - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { MEMORY_TYPE memoryType; if (pVideoDec->bDRMPlayerMode == OMX_TRUE) memoryType = SECURE_MEMORY; @@ -950,7 +950,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /* Register output buffer */ /*************/ /* TBD */ @@ -988,7 +988,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { H264CodecStop(pOMXComponent, OUTPUT_PORT_INDEX); } pH264Dec->hMFCH264Handle.bConfiguredMFCDst = OMX_TRUE; @@ -1540,7 +1540,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1565,17 +1565,17 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosOutputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosOutputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1648,7 +1648,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) pH264Dec->hSourceStartEvent = NULL; pH264Dec->bSourceStart = OMX_FALSE; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecOutputBuffer[i] != NULL) { for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) { @@ -1663,14 +1663,14 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosOutputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosOutputPort->codecSemID); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecInputBuffer[i] != NULL) { for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { @@ -1684,7 +1684,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosInputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosInputPort->codecSemID); - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1796,7 +1796,7 @@ OMX_ERRORTYPE Exynos_H264Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX pSrcOutputData->buffer.singlePlaneBuffer.fd = pVideoBuffer->planes[0].fd; pSrcOutputData->allocSize = pVideoBuffer->planes[0].allocSize; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) { if (i >= MFC_INPUT_BUFFER_NUM_MAX) { @@ -2045,7 +2045,7 @@ OMX_ERRORTYPE Exynos_H264Dec_srcOutputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { if (OMX_FALSE == Exynos_Check_BufferProcess_State(pExynosComponent, INPUT_PORT_INDEX)) { ret = OMX_ErrorNone; goto EXIT; @@ -2087,7 +2087,7 @@ OMX_ERRORTYPE Exynos_H264Dec_dstInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon ret = OMX_ErrorNone; goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pH264Dec->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pH264Dec->hDestinationStartEvent, DEF_MAX_WAIT_TIME); @@ -2127,7 +2127,7 @@ OMX_ERRORTYPE Exynos_H264Dec_dstOutputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo goto EXIT; } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pH264Dec->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pH264Dec->hDestinationStartEvent, DEF_MAX_WAIT_TIME); diff --git a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 761b1d2..764901f 100644 --- a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -734,11 +734,11 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA bufferConf.eCompressionFormat = VIDEO_CODING_H263; pInbufOps->Set_Shareable(hMFCHandle); - if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2; inputBufferNumber = MAX_VIDEO_INPUTBUFFER_NUM; - } else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE; inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX; } @@ -763,7 +763,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { /* Register input buffer */ for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { ExynosVideoPlane plane; @@ -776,7 +776,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA goto EXIT; } } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /* Register input buffer */ for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) { ExynosVideoPlane plane; @@ -833,7 +833,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCSrc = OMX_TRUE; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth) || (pExynosInputPort->portDefinition.format.video.nFrameHeight != pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameHeight)) { pExynosInputPort->portDefinition.format.video.nFrameWidth = pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth; @@ -853,7 +853,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA 0, NULL); } - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth) || (pExynosInputPort->portDefinition.format.video.nFrameHeight != pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameHeight) || (pExynosOutputPort->portDefinition.nBufferCountActual != pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum)) { @@ -909,7 +909,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) /* get dpb count */ nOutbufs = pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { /* should be done before prepare output buffer */ if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) { ret = OMX_ErrorInsufficientResources; @@ -933,7 +933,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) nAllocLen[1] = calc_plane(pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth, pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameHeight >> 1); - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { /* Register output buffer */ for (i = 0; i < nOutbufs; i++) { pVideoDec->pMFCDecOutputBuffer[i] = (CODEC_DEC_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_DEC_BUFFER)); @@ -965,7 +965,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /* Register output buffer */ /*************/ /* TBD */ @@ -1003,7 +1003,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { Mpeg4CodecStop(pOMXComponent, OUTPUT_PORT_INDEX); } pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCDst = OMX_TRUE; @@ -1600,7 +1600,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1625,17 +1625,17 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosOutputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosOutputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1701,7 +1701,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) pMpeg4Dec->hSourceStartEvent = NULL; pMpeg4Dec->bSourceStart = OMX_FALSE; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecOutputBuffer[i] != NULL) { for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) { @@ -1716,14 +1716,14 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosOutputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosOutputPort->codecSemID); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecInputBuffer[i] != NULL) { for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { @@ -1738,7 +1738,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosInputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosInputPort->codecSemID); - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1849,7 +1849,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM pSrcOutputData->buffer.singlePlaneBuffer.fd = pVideoBuffer->planes[0].fd; pSrcOutputData->allocSize = pVideoBuffer->planes[0].allocSize; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) { if (i >= MFC_INPUT_BUFFER_NUM_MAX) { @@ -2089,7 +2089,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_srcOutputBufferProcess(OMX_COMPONENTTYPE *pOMXComp goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { if (OMX_FALSE == Exynos_Check_BufferProcess_State(pExynosComponent, INPUT_PORT_INDEX)) { ret = OMX_ErrorNone; goto EXIT; @@ -2132,7 +2132,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_dstInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo ret = OMX_ErrorNone; goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pMpeg4Dec->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pMpeg4Dec->hDestinationStartEvent, DEF_MAX_WAIT_TIME); @@ -2172,7 +2172,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_dstOutputBufferProcess(OMX_COMPONENTTYPE *pOMXComp goto EXIT; } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pMpeg4Dec->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pMpeg4Dec->hDestinationStartEvent, DEF_MAX_WAIT_TIME); diff --git a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index e8690e1..247e322 100644 --- a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -545,11 +545,11 @@ OMX_ERRORTYPE VP8CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf)); bufferConf.eCompressionFormat = VIDEO_CODING_VP8; pInbufOps->Set_Shareable(hMFCHandle); - if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2; inputBufferNumber = MAX_VIDEO_INPUTBUFFER_NUM; - } else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE; inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX; } @@ -574,7 +574,7 @@ OMX_ERRORTYPE VP8CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { /* Register input buffer */ for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { ExynosVideoPlane plane; @@ -587,7 +587,7 @@ OMX_ERRORTYPE VP8CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA goto EXIT; } } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /* Register input buffer */ for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) { ExynosVideoPlane plane; @@ -644,7 +644,7 @@ OMX_ERRORTYPE VP8CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pVp8Dec->hMFCVp8Handle.bConfiguredMFCSrc = OMX_TRUE; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth) || (pExynosInputPort->portDefinition.format.video.nFrameHeight != pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight)) { pExynosInputPort->portDefinition.format.video.nFrameWidth = pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth; @@ -664,7 +664,7 @@ OMX_ERRORTYPE VP8CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA 0, NULL); } - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth) || (pExynosInputPort->portDefinition.format.video.nFrameHeight != pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight) || (pExynosOutputPort->portDefinition.nBufferCountActual != pVp8Dec->hMFCVp8Handle.maxDPBNum)) { @@ -720,7 +720,7 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) /* get dpb count */ nOutbufs = pVp8Dec->hMFCVp8Handle.maxDPBNum; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { /* should be done before prepare output buffer */ if (pOutbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) { ret = OMX_ErrorInsufficientResources; @@ -745,7 +745,7 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) nAllocLen[1] = calc_plane(pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth, pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight >> 1); - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { /* Register output buffer */ for (i = 0; i < nOutbufs; i++) { pVideoDec->pMFCDecOutputBuffer[i] = (CODEC_DEC_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_DEC_BUFFER)); @@ -777,7 +777,7 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /* Register output buffer */ /*************/ /* TBD */ @@ -815,7 +815,7 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { VP8CodecStop (pOMXComponent, OUTPUT_PORT_INDEX); } pVp8Dec->hMFCVp8Handle.bConfiguredMFCDst = OMX_TRUE; @@ -1192,7 +1192,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pInbufOps = pVp8Dec->hMFCVp8Handle.pInbufOps; pOutbufOps = pVp8Dec->hMFCVp8Handle.pOutbufOps; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1217,17 +1217,17 @@ OMX_ERRORTYPE Exynos_VP8Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosOutputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosOutputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1293,7 +1293,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) pVp8Dec->hSourceStartEvent = NULL; pVp8Dec->bSourceStart = OMX_FALSE; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecOutputBuffer[i] != NULL) { for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) { @@ -1308,14 +1308,14 @@ OMX_ERRORTYPE Exynos_VP8Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosOutputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosOutputPort->codecSemID); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecInputBuffer[i] != NULL) { for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { @@ -1330,7 +1330,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosInputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosInputPort->codecSemID); - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1441,7 +1441,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ pSrcOutputData->buffer.singlePlaneBuffer.fd = pVideoBuffer->planes[0].fd; pSrcOutputData->allocSize = pVideoBuffer->planes[0].allocSize; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) { if (i >= MFC_INPUT_BUFFER_NUM_MAX) { @@ -1681,7 +1681,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_srcOutputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { if (OMX_FALSE == Exynos_Check_BufferProcess_State(pExynosComponent, INPUT_PORT_INDEX)) { ret = OMX_ErrorNone; goto EXIT; @@ -1724,7 +1724,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_dstInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompone ret = OMX_ErrorNone; goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pVp8Dec->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pVp8Dec->hDestinationStartEvent, DEF_MAX_WAIT_TIME); @@ -1764,7 +1764,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_dstOutputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon goto EXIT; } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pVp8Dec->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pVp8Dec->hDestinationStartEvent, DEF_MAX_WAIT_TIME); diff --git a/component/video/enc/Exynos_OMX_Venc.c b/component/video/enc/Exynos_OMX_Venc.c index b3b2eb9..14a2f65 100644 --- a/component/video/enc/Exynos_OMX_Venc.c +++ b/component/video/enc/Exynos_OMX_Venc.c @@ -324,7 +324,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ FunctionIn(); - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { if ((srcInputData->buffer.multiPlaneBuffer.dataBuffer[0] == NULL) || (srcInputData->pPrivate == NULL)) { ret = OMX_FALSE; @@ -333,7 +333,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ } if (inputUseBuffer->dataValid == OMX_TRUE) { - if (exynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosInputPort->bufferProcessType & BUFFER_SHARE) { Exynos_Shared_BufferToData(inputUseBuffer, srcInputData, ONE_PLANE); #ifdef USE_METADATABUFFERTYPE if (exynosInputPort->bStoreMetaData == OMX_TRUE) { @@ -388,7 +388,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ #endif /* reset dataBuffer */ Exynos_ResetDataBuffer(inputUseBuffer); - } else if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + } else if (exynosInputPort->bufferProcessType & BUFFER_COPY) { checkInputStream = inputUseBuffer->bufferHeader->pBuffer + inputUseBuffer->usedDataLen; checkInputStreamLen = inputUseBuffer->remainDataLen; @@ -467,7 +467,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ FunctionIn(); - if (exynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) { if (Exynos_Shared_DataToBuffer(dstOutputData, outputUseBuffer) == OMX_ErrorNone) outputUseBuffer->dataValid = OMX_TRUE; } @@ -490,7 +490,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ goto EXIT; } - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { if (dstOutputData->remainDataLen <= (outputUseBuffer->allocSize - outputUseBuffer->dataLen)) { copySize = dstOutputData->remainDataLen; if (copySize > 0) @@ -515,7 +515,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ OMX_EventError, OMX_ErrorUndefined, 0, NULL); ret = OMX_FALSE; } - } else if (exynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((outputUseBuffer->remainDataLen > 0) || ((outputUseBuffer->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) || (CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) @@ -640,7 +640,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_MutexLock(srcInputUseBuffer->bufferMutex); if (pVideoEnc->bFirstInput == OMX_FALSE) { - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; if ((pSrcInputData->buffer.multiPlaneBuffer.dataBuffer[0] == NULL) || (pSrcInputData->pPrivate == NULL)) { Exynos_CodecBufferDeQueue(pExynosComponent, INPUT_PORT_INDEX, &codecBuffer); @@ -708,7 +708,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_SleepMillisec(0); while (!pVideoEnc->bExitBufferProcessThread) { - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { if (Exynos_Check_BufferProcess_State(pExynosComponent, INPUT_PORT_INDEX) == OMX_FALSE) break; } @@ -721,13 +721,13 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent) ret = pVideoEnc->exynos_codec_srcOutputProcess(pOMXComponent, &srcOutputData); if (ret == OMX_ErrorNone) { - if ((exynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosInputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; codecBuffer = srcOutputData.pPrivate; if (codecBuffer != NULL) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, codecBuffer); } - if (exynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosInputPort->bufferProcessType & BUFFER_SHARE) { Exynos_Shared_DataToBuffer(&srcOutputData, srcOutputUseBuffer); Exynos_InputBufferReturn(pOMXComponent); } @@ -770,7 +770,7 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) break; Exynos_OSAL_MutexLock(dstInputUseBuffer->bufferMutex); - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; ret = Exynos_CodecBufferDeQueue(pExynosComponent, OUTPUT_PORT_INDEX, &codecBuffer); if (ret != OMX_ErrorNone) { @@ -780,7 +780,7 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_Output_CodecBufferToData(pExynosComponent, codecBuffer, &dstInputData); } - if (exynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((dstInputUseBuffer->dataValid != OMX_TRUE) && (!CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) { ret = Exynos_OutputBufferGetQueue(pExynosComponent); @@ -835,7 +835,7 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent) break; Exynos_OSAL_MutexLock(dstOutputUseBuffer->bufferMutex); - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((dstOutputUseBuffer->dataValid != OMX_TRUE) && (!CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) { ret = Exynos_OutputBufferGetQueue(pExynosComponent); @@ -847,15 +847,15 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent) } if ((dstOutputUseBuffer->dataValid == OMX_TRUE) || - (exynosOutputPort->bufferProcessType == BUFFER_SHARE)) + (exynosOutputPort->bufferProcessType & BUFFER_SHARE)) ret = pVideoEnc->exynos_codec_dstOutputProcess(pOMXComponent, pDstOutputData); if (((ret == OMX_ErrorNone) && (dstOutputUseBuffer->dataValid == OMX_TRUE)) || - (exynosOutputPort->bufferProcessType == BUFFER_SHARE)) { + (exynosOutputPort->bufferProcessType & BUFFER_SHARE)) { Exynos_Postprocess_OutputData(pOMXComponent, pDstOutputData); } - if ((exynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; codecBuffer = pDstOutputData->pPrivate; if (codecBuffer != NULL) { diff --git a/component/video/enc/Exynos_OMX_VencControl.c b/component/video/enc/Exynos_OMX_VencControl.c index e8c8647..8606943 100644 --- a/component/video/enc/Exynos_OMX_VencControl.c +++ b/component/video/enc/Exynos_OMX_VencControl.c @@ -192,7 +192,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( goto EXIT; } - if (pExynosPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosPort->bufferProcessType & BUFFER_SHARE) { mem_type = NORMAL_MEMORY; } else { mem_type = SYSTEM_MEMORY; @@ -447,7 +447,7 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por } if (pExynosComponent->bMultiThreadProcess == OMX_TRUE) { - if (pExynosPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosPort->bufferProcessType & BUFFER_SHARE) { if (pExynosPort->processData.bufferHeader != NULL) { if (portIndex == INPUT_PORT_INDEX) { Exynos_OMX_InputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader); @@ -527,7 +527,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n pExynosPort = &pExynosComponent->pExynosPort[nPortIndex]; Exynos_OMX_GetFlushBuffer(pExynosPort, flushPortBuffer); - if ((pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) Exynos_OSAL_SemaphorePost(pExynosPort->codecSemID); Exynos_OSAL_SemaphorePost(pExynosPort->bufferSemID); @@ -536,7 +536,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n pVideoEnc->exynos_codec_stop(pOMXComponent, nPortIndex); Exynos_OSAL_MutexLock(flushPortBuffer[1]->bufferMutex); ret = Exynos_OMX_FlushPort(pOMXComponent, nPortIndex); - if ((pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) pVideoEnc->exynos_codec_enqueueAllBuffer(pOMXComponent, nPortIndex); Exynos_ResetCodecData(&pExynosPort->processData); @@ -586,9 +586,9 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent) FunctionIn(); - if ((exynosOMXInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosPort->bufferProcessType & BUFFER_COPY) { dataBuffer = &(exynosOMXInputPort->way.port2WayDataBuffer.inputDataBuffer); - } else if (exynosOMXInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) { dataBuffer = &(exynosOMXInputPort->way.port2WayDataBuffer.outputDataBuffer); } @@ -826,9 +826,9 @@ OMX_ERRORTYPE Exynos_OutputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompo FunctionIn(); - if ((pExynosPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosPort->bufferProcessType & BUFFER_COPY) { outputUseBuffer = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer); - } else if (pExynosPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) { outputUseBuffer = &(pExynosPort->way.port2WayDataBuffer.inputDataBuffer); } @@ -859,9 +859,9 @@ OMX_ERRORTYPE Exynos_OutputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompo /* dataBuffer->nFlags = dataBuffer->bufferHeader->nFlags; */ /* dataBuffer->nTimeStamp = dataBuffer->bufferHeader->nTimeStamp; */ /* - if (pExynosPort->bufferProcessType == BUFFER_SHARE) + if (pExynosPort->bufferProcessType & BUFFER_SHARE) outputUseBuffer->pPrivate = outputUseBuffer->bufferHeader->pOutputPortPrivate; - else if ((pExynosPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + else if (pExynosPort->bufferProcessType & BUFFER_COPY) { pExynosPort->processData.dataBuffer = outputUseBuffer->bufferHeader->pBuffer; pExynosPort->processData.allocSize = outputUseBuffer->bufferHeader->nAllocLen; } diff --git a/component/video/enc/h264/Exynos_OMX_H264enc.c b/component/video/enc/h264/Exynos_OMX_H264enc.c index 1e110b0..689e990 100644 --- a/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -794,13 +794,13 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT bufferConf.nFrameWidth = pExynosInputPort->portDefinition.format.video.nFrameWidth; bufferConf.nFrameHeight = pExynosInputPort->portDefinition.format.video.nFrameHeight; pInbufOps->Set_Shareable(hMFCHandle); - if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { inputBufferNumber = MAX_INPUTBUFFER_NUM_DYNAMIC; - } else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { /* should be done before prepare input buffer */ if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) { ret = OMX_ErrorInsufficientResources; @@ -827,7 +827,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT ExynosVideoPlane planes[MFC_INPUT_BUFFER_PLANE]; int plane; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { /* Register input buffer */ for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { @@ -841,7 +841,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT goto EXIT; } } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { if (pExynosInputPort->bStoreMetaData == OMX_TRUE) { /*************/ /* TBD */ @@ -903,7 +903,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Set_Shareable(hMFCHandle); int SetupBufferNumber = 0; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) SetupBufferNumber = MFC_OUTPUT_BUFFER_NUM_MAX; else SetupBufferNumber = pExynosOutputPort->portDefinition.nBufferCountActual; @@ -916,7 +916,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) } OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0}; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { /* Register input buffer */ for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { ExynosVideoPlane plane; @@ -944,7 +944,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } - } else if ((pExynosOutputPort->bufferProcessType & BUFFER_SHARE) == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /* Register input buffer */ /*************/ /* TBD */ @@ -971,7 +971,7 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { OMX_BUFFERHEADERTYPE *OMXBuffer = NULL; ExynosVideoBuffer *pVideoBuffer = NULL; @@ -1559,7 +1559,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) if ((pExynosInputPort->bStoreMetaData != OMX_TRUE) && (eColorFormat != OMX_COLOR_FormatAndroidOpaque)) { - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1595,7 +1595,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoEnc->pMFCEncInputBuffer[i]); } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1603,10 +1603,10 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) } } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosOutputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosOutputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1672,7 +1672,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) pH264Enc->hSourceStartEvent = NULL; pH264Enc->bSourceStart = OMX_FALSE; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncOutputBuffer[i] != NULL) { if (pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0] != NULL) @@ -1684,14 +1684,14 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosOutputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosOutputPort->codecSemID); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) { for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { @@ -1705,7 +1705,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosInputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosInputPort->codecSemID); - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1771,7 +1771,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ nAllocLen[1] = ALIGN(nAllocLen[0]/2,256); if ((pExynosInputPort->bStoreMetaData == OMX_TRUE) && - (pExynosInputPort->bufferProcessType == BUFFER_SHARE)) { + (pExynosInputPort->bufferProcessType & BUFFER_SHARE)) { codecReturn = pInbufOps->ExtensionEnqueue(hMFCHandle, (unsigned char **)pSrcInputData->buffer.multiPlaneBuffer.dataBuffer, (unsigned char **)pSrcInputData->buffer.multiPlaneBuffer.fd, @@ -1857,7 +1857,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX pVideoBuffer->planes[1].allocSize + pVideoBuffer->planes[2].allocSize; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.multiPlaneBuffer.dataBuffer[0] != pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[0]) { if (i >= MFC_INPUT_BUFFER_NUM_MAX) { @@ -2058,7 +2058,7 @@ OMX_ERRORTYPE Exynos_H264Enc_srcOutputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { if (OMX_FALSE == Exynos_Check_BufferProcess_State(pExynosComponent, INPUT_PORT_INDEX)) { ret = OMX_ErrorNone; goto EXIT; @@ -2101,7 +2101,7 @@ OMX_ERRORTYPE Exynos_H264Enc_dstInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon ret = OMX_ErrorNone; goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pH264Enc->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pH264Enc->hDestinationStartEvent, DEF_MAX_WAIT_TIME); @@ -2142,7 +2142,7 @@ OMX_ERRORTYPE Exynos_H264Enc_dstOutputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo goto EXIT; } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pH264Enc->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pH264Enc->hDestinationStartEvent, DEF_MAX_WAIT_TIME); diff --git a/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index 0299b43..5b7ab78 100644 --- a/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -920,13 +920,13 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA bufferConf.nFrameWidth = pExynosInputPort->portDefinition.format.video.nFrameWidth; bufferConf.nFrameHeight = pExynosInputPort->portDefinition.format.video.nFrameHeight; pInbufOps->Set_Shareable(hMFCHandle); - if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { inputBufferNumber = MAX_INPUTBUFFER_NUM_DYNAMIC; - } else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { /* should be done before prepare input buffer */ if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) { ret = OMX_ErrorInsufficientResources; @@ -953,7 +953,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA ExynosVideoPlane planes[MFC_INPUT_BUFFER_PLANE]; int plane; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { /* Register input buffer */ for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { @@ -967,7 +967,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA goto EXIT; } } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { if (pExynosInputPort->bStoreMetaData == OMX_TRUE) { /*************/ /* TBD */ @@ -1036,7 +1036,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Set_Shareable(hMFCHandle); } int SetupBufferNumber = 0; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) SetupBufferNumber = MFC_OUTPUT_BUFFER_NUM_MAX; else SetupBufferNumber = pExynosOutputPort->portDefinition.nBufferCountActual; @@ -1049,7 +1049,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) } OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0}; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { /* Register input buffer */ for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { ExynosVideoPlane plane; @@ -1077,7 +1077,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } - } else if ((pExynosOutputPort->bufferProcessType & BUFFER_SHARE) == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /* Register input buffer */ /*************/ /* TBD */ @@ -1106,7 +1106,7 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) } } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { OMX_BUFFERHEADERTYPE *OMXBuffer = NULL; ExynosVideoBuffer *pVideoBuffer = NULL; @@ -1769,7 +1769,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) if ((pExynosInputPort->bStoreMetaData != OMX_TRUE) && (eColorFormat != OMX_COLOR_FormatAndroidOpaque)) { - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1805,7 +1805,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoEnc->pMFCEncInputBuffer[i]); } - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1813,10 +1813,10 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) } } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosOutputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosOutputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1882,7 +1882,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) pMpeg4Enc->hSourceStartEvent = NULL; pMpeg4Enc->bSourceStart = OMX_FALSE; - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncOutputBuffer[i] != NULL) { if (pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0] != NULL) @@ -1894,14 +1894,14 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosOutputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosOutputPort->codecSemID); - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ /* Does not require any actions. */ } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) { for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { @@ -1915,7 +1915,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_QueueTerminate(&pExynosInputPort->codecBufferQ); Exynos_OSAL_SemaphoreTerminate(pExynosInputPort->codecSemID); - } else if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) { + } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { /*************/ /* TBD */ /*************/ @@ -1981,7 +1981,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX nAllocLen[1] = ALIGN(nAllocLen[0]/2,256); if ((pExynosInputPort->bStoreMetaData == OMX_TRUE) && - (pExynosInputPort->bufferProcessType == BUFFER_SHARE)) { + (pExynosInputPort->bufferProcessType & BUFFER_SHARE)) { codecReturn = pInbufOps->ExtensionEnqueue(hMFCHandle, (unsigned char **)pSrcInputData->buffer.multiPlaneBuffer.dataBuffer, (unsigned char **)pSrcInputData->buffer.multiPlaneBuffer.fd, @@ -2067,7 +2067,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM pVideoBuffer->planes[1].allocSize + pVideoBuffer->planes[2].allocSize; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.multiPlaneBuffer.dataBuffer[0] != pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[0]) { if (i >= MFC_INPUT_BUFFER_NUM_MAX) { @@ -2252,7 +2252,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_srcOutputBufferProcess(OMX_COMPONENTTYPE *pOMXComp goto EXIT; } - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { if (OMX_FALSE == Exynos_Check_BufferProcess_State(pExynosComponent, INPUT_PORT_INDEX)) { ret = OMX_ErrorNone; goto EXIT; @@ -2295,7 +2295,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_dstInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo ret = OMX_ErrorNone; goto EXIT; } - if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { + if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { if ((pMpeg4Enc->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pMpeg4Enc->hDestinationStartEvent, DEF_MAX_WAIT_TIME); @@ -2336,7 +2336,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_dstOutputBufferProcess(OMX_COMPONENTTYPE *pOMXComp goto EXIT; } - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { + if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { if ((pMpeg4Enc->bDestinationStart == OMX_FALSE) && (!CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { Exynos_OSAL_SignalWait(pMpeg4Enc->hDestinationStartEvent, DEF_MAX_WAIT_TIME); -- 2.20.1