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 EXYNOS_OMX_SHARED_BUFFER SharedBuffer[MAX_BUFFER_REF]; 49 } EXYNOS_OMX_REF_HANDLE; 50 51 52 #ifdef __cplusplus 53 extern "C" { 54 #endif 55 56 OMX_COLOR_FORMATTYPE Exynos_OSAL_GetANBColorFormat(OMX_IN OMX_U32 handle); 57 58 OMX_U32 Exynos_OSAL_GetANBStride(OMX_IN OMX_U32 handle); 59 60 OMX_ERRORTYPE Exynos_OSAL_GetANBParameter(OMX_IN OMX_HANDLETYPE hComponent, 61 OMX_IN OMX_INDEXTYPE nIndex, 62 OMX_INOUT OMX_PTR ComponentParameterStructure); 63 64 OMX_ERRORTYPE Exynos_OSAL_SetANBParameter(OMX_IN OMX_HANDLETYPE hComponent, 65 OMX_IN OMX_INDEXTYPE nIndex, 66 OMX_IN OMX_PTR ComponentParameterStructure); 67 68 OMX_ERRORTYPE Exynos_OSAL_LockANB(OMX_IN OMX_PTR pBuffer, 69 OMX_IN OMX_U32 width, 70 OMX_IN OMX_U32 height, 71 OMX_IN OMX_COLOR_FORMATTYPE format, 72 OMX_OUT OMX_U32 *pStride, 73 OMX_OUT OMX_PTR planes); 74 75 OMX_ERRORTYPE Exynos_OSAL_UnlockANB(OMX_IN OMX_PTR pBuffer); 76 77 OMX_ERRORTYPE Exynos_OSAL_LockMetaData(OMX_IN OMX_PTR pBuffer, 78 OMX_IN OMX_U32 width, 79 OMX_IN OMX_U32 height, 80 OMX_IN OMX_COLOR_FORMATTYPE format, 81 OMX_OUT OMX_U32 *pStride, 82 OMX_OUT OMX_PTR planes); 83 84 OMX_ERRORTYPE Exynos_OSAL_UnlockMetaData(OMX_IN OMX_PTR pBuffer); 85 86 OMX_ERRORTYPE Exynos_OSAL_LockANBHandle(OMX_IN OMX_U32 pBuffer, 87 OMX_IN OMX_U32 width, 88 OMX_IN OMX_U32 height, 89 OMX_IN OMX_COLOR_FORMATTYPE format, 90 OMX_OUT OMX_PTR planes); 91 92 OMX_ERRORTYPE Exynos_OSAL_UnlockANBHandle(OMX_IN OMX_U32 pBuffer); 93 94 OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(OMX_IN OMX_BYTE pBuffer, 95 OMX_OUT OMX_PTR *pOutBuffer); 96 97 OMX_ERRORTYPE Exynos_OSAL_CheckANB(OMX_IN EXYNOS_OMX_DATA *pBuffer, 98 OMX_OUT OMX_BOOL *bIsANBEnabled); 99 100 OMX_ERRORTYPE Exynos_OSAL_SetPrependSPSPPSToIDR(OMX_PTR pComponentParameterStructure, 101 OMX_PTR pbPrependSpsPpsToIdr); 102 OMX_COLOR_FORMATTYPE Exynos_OSAL_Hal2OMXPixelFormat(unsigned int hal_format); 103 104 unsigned int Exynos_OSAL_OMX2HalPixelFormat(OMX_COLOR_FORMATTYPE omx_format); 105 106 #ifdef __cplusplus 107 } 108 #endif 109 110 #endif 111