Sync with tizen3.0
[platform/adaptation/ap_samsung/libomxil-e3250-v4l2.git] / openmax / component / video / dec / vc1 / Exynos_OMX_Wmvdec.c
old mode 100644 (file)
new mode 100755 (executable)
index b14d8e0..9b6663f
@@ -30,6 +30,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <mm_types.h>
 
 #include "Exynos_OMX_Macros.h"
 #include "Exynos_OMX_Basecomponent.h"
@@ -245,14 +246,14 @@ static OMX_BOOL Make_Stream_MetaData(
     OMX_U8    *pInputStream,
     OMX_U32   *pStreamSize,
     WMV_FORMAT wmvFormat
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
     , OMX_U32 width, OMX_U32 height
 #endif
     )
 {
     OMX_U8  *pCurrBuf = pInputStream;
     OMX_U32  currPos  = 0;
-#ifndef SLP_PLATFORM
+#ifndef TIZEN_FEATURE_E3250
     OMX_U32  width, height;
 #endif
     FunctionIn();
@@ -269,7 +270,7 @@ static OMX_BOOL Make_Stream_MetaData(
     switch (wmvFormat) {
     case WMV_FORMAT_WMV3:
         if (*pStreamSize >= BITMAPINFOHEADER_SIZE) {
-#ifndef SLP_PLATFORM
+#ifndef TIZEN_FEATURE_E3250
             BitmapInfoHhr *pBitmapInfoHeader;
             pBitmapInfoHeader = (BitmapInfoHhr *)pInputStream;
 
@@ -384,14 +385,14 @@ OMX_ERRORTYPE Process_Wmv_CodecConfigData(OMX_COMPONENTTYPE *pOMXComponent, void
     EXYNOS_OMX_BASEPORT      *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
     EXYNOS_WMVDEC_HANDLE          *pWmvDec           = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle;
     OMX_PTR                hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
     EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATA *)pConfig;
     OMX_U8 *pInputStream = pSrcInputData->bufferHeader->pBuffer;
 #endif
 
     FunctionIn();
 
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
     if (pWmvDec->wmvFormat == WMV_FORMAT_UNKNOWN) {
         Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Process_Wmv_CodecConfigData. dataLen = %d", pSrcInputData->dataLen);
         if (pSrcInputData->dataLen < 4) {
@@ -1177,7 +1178,7 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
     }
 
     bMetaData = Make_Stream_MetaData(pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, &oneFrameSize, pWmvDec->hMFCWmvHandle.wmvFormat
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
         , pExynosComponent->pExynosPort[INPUT_PORT_INDEX].portDefinition.format.video.nFrameWidth
         , pExynosComponent->pExynosPort[INPUT_PORT_INDEX].portDefinition.format.video.nFrameHeight
 #endif
@@ -1215,7 +1216,7 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
     ret = OMX_ErrorInputDataDecodeYet;
 
 #ifdef USE_IMMEDIATE_DISPLAY
-    /* Set Immediately display for I Frame*/   
+    /* Set Immediately display for I Frame*/
     pDecOps->Set_ImmediateDisplay(hMFCHandle);
 #endif
 EXIT:
@@ -1423,7 +1424,7 @@ OMX_ERRORTYPE WmvCodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent)
             if (pVideoDec->bDRCProcessing == OMX_TRUE) {
                 pVideoDec->nDRCSavedBufferCount = pExynosOutputPort->portDefinition.nBufferCountActual;
             }
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
             pExynosOutputPort->portDefinition.nBufferCountActual = pWmvDec->hMFCWmvHandle.maxDPBNum;
             pExynosOutputPort->portDefinition.nBufferCountMin = pWmvDec->hMFCWmvHandle.maxDPBNum;
 #else
@@ -1683,9 +1684,9 @@ OMX_ERRORTYPE Exynos_WmvDec_SetParameter(
             case OMX_COLOR_FormatYUV420SemiPlanar:
                 pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2;
                 break;
-#ifdef SLP_PLATFORM /* NV12T fd */
+#ifdef TIZEN_FEATURE_E3250 /* NV12T fd */
             case OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd:
-                pExynosOutputPort->portDefinition.nBufferSize = sizeof(SCMN_IMGB);
+                pExynosOutputPort->portDefinition.nBufferSize = sizeof(MMVideoBuffer);
                 break;
 #endif
             case OMX_SEC_COLOR_FormatNV12Tiled:
@@ -2140,7 +2141,7 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D
         pWmvDec->hMFCWmvHandle.indexTimestamp %= MAX_TIMESTAMP;
 
 #ifdef USE_IMMEDIATE_DISPLAY
-    /* Set Immediately display for I Frame*/   
+    /* Set Immediately display for I Frame*/
         if (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp == OMX_TRUE) {
             if ( pExynosComponent->checkTimeStamp.bImmediateDisplay == OMX_FALSE) {
                 /* Enable Immediately display After seek*/
@@ -2149,7 +2150,7 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D
             }
         }
 #endif
-       
+
         /* queue work for input buffer */
         Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d, bufferHeader: 0x%x, dataBuffer: 0x%x", oneFrameSize, pSrcInputData->bufferHeader, pSrcInputData->buffer.singlePlaneBuffer.dataBuffer);
         codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer,
@@ -2215,12 +2216,12 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
         if (pExynosInputPort->bufferProcessType & BUFFER_COPY) {
             int i = 0;
             while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) {
+                i++;
                 if (i >= MFC_INPUT_BUFFER_NUM_MAX) {
                     Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer");
                     ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
                     goto EXIT;
                 }
-                i++;
             }
             pVideoDec->pMFCDecInputBuffer[i]->dataSize = 0;
             pSrcOutputData->pPrivate = pVideoDec->pMFCDecInputBuffer[i];
@@ -2380,7 +2381,7 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
     pBufferInfo->imageHeight = bufferGeometry->nFrameHeight;
     switch (bufferGeometry->eColorFormat) {
     case VIDEO_COLORFORMAT_NV12:
-#ifdef SLP_PLATFORM /* NV12T fd */
+#ifdef TIZEN_FEATURE_E3250 /* NV12T fd */
         pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd;
 #else
         pBufferInfo->ColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
@@ -2409,7 +2410,7 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
         Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType);
 
 //#ifdef NEED_TIMESTAMP_REORDER
-        if (pVideoDec->bNeedTimestampReorder == OMX_TRUE) { /* SLP_PLATFORM */
+        if (pVideoDec->bNeedTimestampReorder == OMX_TRUE) { /* TIZEN_FEATURE_E3250 */
             if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) {
                 pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
                 pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
@@ -2699,13 +2700,13 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(
     Exynos_OSAL_Strcpy(pExynosPort->portDefinition.format.video.cMIMEType, "raw/video");
     pExynosPort->portDefinition.format.video.pNativeRender = 0;
     pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE;
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
     pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd;
 #else
     pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar;
 #endif
     pExynosPort->portDefinition.bEnabled = OMX_TRUE;
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
     pExynosPort->bufferProcessType = BUFFER_SHARE;
 #else
     pExynosPort->bufferProcessType = BUFFER_COPY;
@@ -2718,7 +2719,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(
         pWmvDec->WmvComponent[i].eFormat    = OMX_VIDEO_WMVFormat9;
     }
 
-#ifdef SLP_PLATFORM
+#ifdef TIZEN_FEATURE_E3250
     pWmvDec->wmvFormat = WMV_FORMAT_UNKNOWN;
 #endif
 
@@ -2750,7 +2751,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(
 
     pVideoDec->exynos_process_codecConfigData                 = &Process_Wmv_CodecConfigData;
 
-#ifndef SLP_PLATFORM /* do not use ion */
+#ifndef TIZEN_FEATURE_E3250 /* do not use ion */
     pVideoDec->hSharedMemory = Exynos_OSAL_SharedMemory_Open();
     if (pVideoDec->hSharedMemory == NULL) {
         Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "OMX_ErrorInsufficientResources, Line:%d", __LINE__);
@@ -2789,7 +2790,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(
     pOMXComponent = (OMX_COMPONENTTYPE *)hComponent;
     pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
     pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
-#ifndef SLP_PLATFORM /* do not use ion */
+#ifndef TIZEN_FEATURE_E3250 /* do not use ion */
     Exynos_OSAL_SharedMemory_Close(pVideoDec->hSharedMemory);
 #endif
     Exynos_OSAL_Free(pExynosComponent->componentName);