fix build warning
[platform/adaptation/ap_samsung/libomxil-e3250-v4l2.git] / openmax / component / video / dec / Exynos_OMX_VdecControl.c
old mode 100644 (file)
new mode 100755 (executable)
index b6db0e5..130bf11
@@ -38,6 +38,7 @@
 #include "Exynos_OSAL_Mutex.h"
 #include "Exynos_OSAL_ETC.h"
 #include "Exynos_OSAL_SharedMemory.h"
+#include "Exynos_OMX_Baseport.h"
 
 #ifdef USE_PB
 #include "Exynos_OSAL_Platform_Specific.h"
@@ -144,7 +145,7 @@ OMX_ERRORTYPE Exynos_OMX_UseBuffer(
                 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "\nPlatformBuffer: buf %d pYUVBuf[0]:0x%x , pYUVBuf[1]:0x%x ",
                         i, pExynosPort->extendBufferHeader[i].pYUVBuf[0], pExynosPort->extendBufferHeader[i].pYUVBuf[1]);
             } else if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) && (nPortIndex == INPUT_PORT_INDEX)) {
-                pExynosPort->extendBufferHeader[i].buf_fd[0] = pBuffer;
+                pExynosPort->extendBufferHeader[i].buf_fd[0] = (int)pBuffer;
             } else if(nPortIndex == INPUT_PORT_INDEX){
                 MMVideoBuffer * pSlpOutBuf = (MMVideoBuffer *)pBuffer;
                 temp_bufferHeader->pBuffer  = pSlpOutBuf->data[0];
@@ -270,7 +271,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer(
             pExynosPort->bufferStateAllocate[i] = (BUFFER_STATE_ALLOCATED | HEADER_STATE_ALLOCATED);
             INIT_SET_SIZE_VERSION(temp_bufferHeader, OMX_BUFFERHEADERTYPE);
             if (mem_type == SECURE_MEMORY)
-                temp_bufferHeader->pBuffer = temp_buffer_fd;
+                temp_bufferHeader->pBuffer = (OMX_U8 *)temp_buffer_fd;
             else
                 temp_bufferHeader->pBuffer        = temp_buffer;
             temp_bufferHeader->nAllocLen      = nSizeBytes;
@@ -313,8 +314,6 @@ OMX_ERRORTYPE Exynos_OMX_FreeBuffer(
     EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
     EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
     EXYNOS_OMX_BASEPORT      *pExynosPort = NULL;
-    OMX_BUFFERHEADERTYPE  *temp_bufferHeader = NULL;
-    OMX_U8                *temp_buffer = NULL;
     OMX_U32                i = 0;
 
     FunctionIn();
@@ -396,29 +395,13 @@ EXIT:
 
 OMX_ERRORTYPE Exynos_OMX_AllocateTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex)
 {
-    OMX_ERRORTYPE                 ret = OMX_ErrorNone;
-    EXYNOS_OMX_BASEPORT             *pExynosPort = NULL;
-    OMX_BUFFERHEADERTYPE         *temp_bufferHeader = NULL;
-    OMX_U8                       *temp_buffer = NULL;
-    OMX_U32                       bufferSize = 0;
-    OMX_PARAM_PORTDEFINITIONTYPE  portDefinition;
-
-    ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
-    return ret;
+
+    return OMX_ErrorTunnelingUnsupported;
 }
 
 OMX_ERRORTYPE Exynos_OMX_FreeTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex)
 {
-    OMX_ERRORTYPE ret = OMX_ErrorNone;
-    EXYNOS_OMX_BASEPORT* pExynosPort = NULL;
-    OMX_BUFFERHEADERTYPE* temp_bufferHeader = NULL;
-    OMX_U8 *temp_buffer = NULL;
-    OMX_U32 bufferSize = 0;
-
-    ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
-    return ret;
+    return OMX_ErrorTunnelingUnsupported;
 }
 
 OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
@@ -428,11 +411,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
     OMX_IN OMX_U32        nTunneledPort,
     OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup)
 {
-    OMX_ERRORTYPE ret = OMX_ErrorNone;
-
-    ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
-    return ret;
+    return OMX_ErrorTunnelingUnsupported;
 }
 
 OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_DATABUFFER *pDataBuffer[])
@@ -450,7 +429,6 @@ OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS
             pDataBuffer[1] = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer);
     }
 
-EXIT:
     FunctionOut();
 
     return ret;
@@ -465,7 +443,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por
     OMX_BUFFERHEADERTYPE     *bufferHeader = NULL;
     EXYNOS_OMX_DATABUFFER    *pDataPortBuffer[2] = {NULL, NULL};
     EXYNOS_OMX_MESSAGE       *message = NULL;
-    OMX_U32                flushNum = 0;
     OMX_S32                semValue = 0;
     int i = 0, maxBufferNum = 0;
     FunctionIn();
@@ -548,7 +525,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por
     }
     Exynos_OSAL_ResetQueue(&pExynosPort->bufferQ);
 
-EXIT:
     FunctionOut();
 
     return ret;
@@ -561,7 +537,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n
     EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
     EXYNOS_OMX_BASEPORT      *pExynosPort = NULL;
     EXYNOS_OMX_DATABUFFER    *flushPortBuffer[2] = {NULL, NULL};
-    OMX_U32                   i = 0, cnt = 0;
+
 
     FunctionIn();
 #ifdef TIZEN_FEATURE_E3250
@@ -700,7 +676,6 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
     /* reset dataBuffer */
     Exynos_ResetDataBuffer(dataBuffer);
 
-EXIT:
     FunctionOut();
 
     return ret;
@@ -745,7 +720,6 @@ OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EX
     /* reset dataBuffer */
     Exynos_ResetDataBuffer(dataBuffer);
 
-EXIT:
     FunctionOut();
 
     return ret;
@@ -856,7 +830,6 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
     /* reset dataBuffer */
     Exynos_ResetDataBuffer(dataBuffer);
 
-EXIT:
     FunctionOut();
 
     return ret;
@@ -866,7 +839,6 @@ OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, E
 {
     OMX_ERRORTYPE          ret = OMX_ErrorNone;
     EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
-    EXYNOS_OMX_BASEPORT      *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
     OMX_BUFFERHEADERTYPE     *bufferHeader = NULL;
 
     FunctionIn();
@@ -901,7 +873,6 @@ OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, E
     /* reset dataBuffer */
     Exynos_ResetDataBuffer(dataBuffer);
 
-EXIT:
     FunctionOut();
 
     return ret;
@@ -1043,13 +1014,13 @@ OMX_ERRORTYPE Exynos_CodecBufferDeQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompone
 {
     OMX_ERRORTYPE       ret = OMX_ErrorNone;
     EXYNOS_OMX_BASEPORT   *pExynosPort = NULL;
-    OMX_U32 tempData;
+    void *tempData;
 
     FunctionIn();
 
     pExynosPort = &pExynosComponent->pExynosPort[PortIndex];
     Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID);
-    tempData = (OMX_U32)Exynos_OSAL_Dequeue(&pExynosPort->codecBufferQ);
+    tempData = Exynos_OSAL_Dequeue(&pExynosPort->codecBufferQ);
     if (tempData == NULL) {
         *data = NULL;
         ret = OMX_ErrorUndefined;
@@ -1080,7 +1051,7 @@ OMX_ERRORTYPE Exynos_CodecBufferReset(EXYNOS_OMX_BASECOMPONENT *pExynosComponent
         goto EXIT;
     }
     while (1) {
-        int cnt = 0;
+        OMX_S32 cnt = 0;
         Exynos_OSAL_Get_SemaphoreCount(pExynosPort->codecSemID, &cnt);
         if (cnt > 0)
             Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID);
@@ -1103,7 +1074,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter(
     OMX_ERRORTYPE          ret = OMX_ErrorNone;
     OMX_COMPONENTTYPE     *pOMXComponent = NULL;
     EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
-    EXYNOS_OMX_BASEPORT      *pExynosPort = NULL;
 
     FunctionIn();
 
@@ -1133,7 +1103,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter(
         goto EXIT;
     }
 
-    switch (nParamIndex) {
+    switch ((int)nParamIndex) {
     case OMX_IndexParamVideoInit:
     {
         OMX_PORT_PARAM_TYPE *portParam = (OMX_PORT_PARAM_TYPE *)ComponentParameterStructure;
@@ -1245,7 +1215,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter(
     OMX_ERRORTYPE          ret = OMX_ErrorNone;
     OMX_COMPONENTTYPE     *pOMXComponent = NULL;
     EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
-    EXYNOS_OMX_BASEPORT      *pExynosPort = NULL;
 
     FunctionIn();
 
@@ -1275,15 +1244,13 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter(
         goto EXIT;
     }
 
-    switch (nIndex) {
+    switch ((int)nIndex) {
     case OMX_IndexParamVideoPortFormat:
     {
         OMX_VIDEO_PARAM_PORTFORMATTYPE *portFormat = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)ComponentParameterStructure;
         OMX_U32                         portIndex = portFormat->nPortIndex;
-        OMX_U32                         index    = portFormat->nIndex;
         EXYNOS_OMX_BASEPORT               *pExynosPort = NULL;
         OMX_PARAM_PORTDEFINITIONTYPE   *portDefinition = NULL;
-        OMX_U32                         supportFormatNum = 0;
 
         ret = Exynos_OMX_Check_SizeVersion(portFormat, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
         if (ret != OMX_ErrorNone) {
@@ -1417,7 +1384,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetConfig(
         goto EXIT;
     }
 
-    switch (nIndex) {
+    switch ((EXYNOS_OMX_INDEXTYPE)nIndex) {
     case OMX_IndexVendorThumbnailMode:
     {
         EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;