1 /* 2 * 3 * Copyright 2010 Samsung Electronics S.LSI Co. LTD 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 /* 19 * @file SEC_OMX_Baseport.h 20 * @brief 21 * @author SeungBeom Kim (sbcrux.kim (at) samsung.com) 22 * HyeYeon Chung (hyeon.chung (at) samsung.com) 23 * @version 1.0 24 * @history 25 * 2010.7.15 : Create 26 */ 27 28 #ifndef SEC_OMX_BASE_PORT 29 #define SEC_OMX_BASE_PORT 30 31 32 #include "OMX_Component.h" 33 #include "SEC_OMX_Def.h" 34 #include "SEC_OSAL_Queue.h" 35 36 37 #define BUFFER_STATE_ALLOCATED (1 << 0) 38 #define BUFFER_STATE_ASSIGNED (1 << 1) 39 #define HEADER_STATE_ALLOCATED (1 << 2) 40 #define BUFFER_STATE_FREE 0 41 42 #define MAX_BUFFER_NUM 20 43 44 #define INPUT_PORT_INDEX 0 45 #define OUTPUT_PORT_INDEX 1 46 #define ALL_PORT_INDEX -1 47 #define ALL_PORT_NUM 2 48 49 typedef struct _SEC_OMX_BASEPORT 50 { 51 OMX_BUFFERHEADERTYPE **bufferHeader; 52 OMX_U32 *bufferStateAllocate; 53 OMX_PARAM_PORTDEFINITIONTYPE portDefinition; 54 OMX_HANDLETYPE bufferSemID; 55 SEC_QUEUE bufferQ; 56 OMX_U32 assignedBufferNum; 57 OMX_STATETYPE portState; 58 OMX_HANDLETYPE loadedResource; 59 OMX_HANDLETYPE unloadedResource; 60 61 OMX_BOOL bIsPortFlushed; 62 OMX_BOOL bIsPortDisabled; 63 OMX_MARKTYPE markType; 64 65 /* Tunnel Info */ 66 OMX_HANDLETYPE tunneledComponent; 67 OMX_U32 tunneledPort; 68 OMX_U32 tunnelBufferNum; 69 OMX_BUFFERSUPPLIERTYPE bufferSupplier; 70 OMX_U32 tunnelFlags; 71 72 OMX_VIDEO_CONTROLRATETYPE eControlRate; 73 } SEC_OMX_BASEPORT; 74 75 76 #ifdef __cplusplus 77 extern "C" { 78 #endif 79 80 OMX_ERRORTYPE SEC_OMX_PortEnableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex); 81 OMX_ERRORTYPE SEC_OMX_PortDisableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex); 82 OMX_ERRORTYPE SEC_OMX_BufferFlushProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex); 83 OMX_ERRORTYPE SEC_OMX_BufferFlushProcessNoEvent(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex); 84 85 #ifdef __cplusplus 86 }; 87 #endif 88 89 90 #endif 91