Home | History | Annotate | Download | only in common
      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     OMX_CONFIG_RECTTYPE            cropRectangle;
     66 
     67     /* Tunnel Info */
     68     OMX_HANDLETYPE                 tunneledComponent;
     69     OMX_U32                        tunneledPort;
     70     OMX_U32                        tunnelBufferNum;
     71     OMX_BUFFERSUPPLIERTYPE         bufferSupplier;
     72     OMX_U32                        tunnelFlags;
     73 
     74     OMX_VIDEO_CONTROLRATETYPE      eControlRate;
     75 
     76     /* For Android Native Buffer */
     77     OMX_BOOL                       bUseAndroidNativeBuffer;
     78     /* For Android Store Meta Data inBuffer */
     79     OMX_BOOL                       bStoreMetaDataInBuffer;
     80     OMX_PTR                        pIMGGrallocModule;
     81 } SEC_OMX_BASEPORT;
     82 
     83 
     84 #ifdef __cplusplus
     85 extern "C" {
     86 #endif
     87 
     88 OMX_ERRORTYPE SEC_OMX_PortEnableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex);
     89 OMX_ERRORTYPE SEC_OMX_PortDisableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex);
     90 OMX_ERRORTYPE SEC_OMX_BufferFlushProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex);
     91 OMX_ERRORTYPE SEC_OMX_BufferFlushProcessNoEvent(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex);
     92 
     93 #ifdef __cplusplus
     94 };
     95 #endif
     96 
     97 
     98 #endif
     99