Home | History | Annotate | Download | only in osal
      1 /*
      2  * Copyright 2012 Samsung Electronics S.LSI Co. LTD
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 /*
     18  * @file        Exynos_OSAL_Android.h
     19  * @brief
     20  * @author      Seungbeom Kim (sbcrux.kim (at) samsung.com)
     21  * @author      Hyeyeon Chung (hyeon.chung (at) samsung.com)
     22  * @author      Yunji Kim (yunji.kim (at) samsung.com)
     23  * @author      Jinsung Yang (jsgood.yang (at) samsung.com)
     24  * @version     2.0.0
     25  * @history
     26  *   2012.02.20 : Create
     27  */
     28 
     29 #ifndef Exynos_OSAL_ANDROID
     30 #define Exynos_OSAL_ANDROID
     31 
     32 #include "OMX_Types.h"
     33 #include "OMX_Core.h"
     34 #include "OMX_Index.h"
     35 
     36 typedef struct _EXYNOS_OMX_SHARED_BUFFER {
     37     OMX_S32 BufferFd;
     38     OMX_S32 BufferFd1;
     39     OMX_S32 BufferFd2;
     40     unsigned long *pIonHandle;
     41     unsigned long *pIonHandle1;
     42     unsigned long *pIonHandle2;
     43     OMX_U32 cnt;
     44 } EXYNOS_OMX_SHARED_BUFFER;
     45 
     46 typedef struct _EXYNOS_OMX_REF_HANDLE {
     47     OMX_HANDLETYPE hMutex;
     48     OMX_PTR pGrallocModule;
     49     EXYNOS_OMX_SHARED_BUFFER SharedBuffer[MAX_BUFFER_REF];
     50 } EXYNOS_OMX_REF_HANDLE;
     51 
     52 
     53 #ifdef __cplusplus
     54 extern "C" {
     55 #endif
     56 
     57 OMX_COLOR_FORMATTYPE Exynos_OSAL_GetANBColorFormat(OMX_IN OMX_U32 handle);
     58 
     59 OMX_U32 Exynos_OSAL_GetANBStride(OMX_IN OMX_U32 handle);
     60 
     61 OMX_ERRORTYPE Exynos_OSAL_GetANBParameter(OMX_IN OMX_HANDLETYPE hComponent,
     62                                           OMX_IN OMX_INDEXTYPE nIndex,
     63                                           OMX_INOUT OMX_PTR ComponentParameterStructure);
     64 
     65 OMX_ERRORTYPE Exynos_OSAL_SetANBParameter(OMX_IN OMX_HANDLETYPE hComponent,
     66                                           OMX_IN OMX_INDEXTYPE nIndex,
     67                                           OMX_IN OMX_PTR ComponentParameterStructure);
     68 
     69 OMX_ERRORTYPE Exynos_OSAL_LockMetaData(OMX_IN OMX_PTR pBuffer,
     70                                        OMX_IN OMX_U32 width,
     71                                        OMX_IN OMX_U32 height,
     72                                        OMX_IN OMX_COLOR_FORMATTYPE format,
     73                                        OMX_OUT OMX_U32 *pStride,
     74                                        OMX_OUT OMX_PTR planes);
     75 
     76 OMX_ERRORTYPE Exynos_OSAL_UnlockMetaData(OMX_IN OMX_PTR pBuffer);
     77 
     78 OMX_ERRORTYPE Exynos_OSAL_LockANBHandle(OMX_IN OMX_U32 pBuffer,
     79                                         OMX_IN OMX_U32 width,
     80                                         OMX_IN OMX_U32 height,
     81                                         OMX_IN OMX_COLOR_FORMATTYPE format,
     82                                         OMX_OUT OMX_U32 *pStride,
     83                                         OMX_OUT OMX_PTR planes);
     84 
     85 OMX_ERRORTYPE Exynos_OSAL_UnlockANBHandle(OMX_IN OMX_U32 pBuffer);
     86 
     87 OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(OMX_IN OMX_BYTE pBuffer,
     88                                               OMX_OUT OMX_PTR *pOutBuffer);
     89 
     90 OMX_ERRORTYPE Exynos_OSAL_CheckANB(OMX_IN EXYNOS_OMX_DATA *pBuffer,
     91                                    OMX_OUT OMX_BOOL *bIsANBEnabled);
     92 
     93 OMX_ERRORTYPE Exynos_OSAL_SetPrependSPSPPSToIDR(OMX_PTR pComponentParameterStructure,
     94                                                 OMX_PTR pbPrependSpsPpsToIdr);
     95 OMX_COLOR_FORMATTYPE Exynos_OSAL_Hal2OMXPixelFormat(unsigned int hal_format);
     96 
     97 unsigned int Exynos_OSAL_OMX2HalPixelFormat(OMX_COLOR_FORMATTYPE omx_format);
     98 
     99 #ifdef __cplusplus
    100 }
    101 #endif
    102 
    103 #endif
    104