Home | History | Annotate | Download | only in dec
      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_Vdec.h
     20  * @brief
     21  * @author      SeungBeom Kim (sbcrux.kim (at) samsung.com)
     22  *              HyeYeon Chung (hyeon.chung (at) samsung.com)
     23  *              Yunji Kim (yunji.kim (at) samsung.com)
     24  * @version     1.0
     25  * @history
     26  *   2010.7.15 : Create
     27  */
     28 
     29 #ifndef SEC_OMX_VIDEO_DECODE
     30 #define SEC_OMX_VIDEO_DECODE
     31 
     32 #include "OMX_Component.h"
     33 #include "SEC_OMX_Def.h"
     34 #include "SEC_OSAL_Queue.h"
     35 #include "SEC_OMX_Baseport.h"
     36 
     37 #define MAX_VIDEO_INPUTBUFFER_NUM    5
     38 #define MAX_VIDEO_OUTPUTBUFFER_NUM   2
     39 
     40 #define DEFAULT_FRAME_WIDTH          176
     41 #define DEFAULT_FRAME_HEIGHT         144
     42 
     43 #define DEFAULT_VIDEO_INPUT_BUFFER_SIZE    ((DEFAULT_FRAME_WIDTH * DEFAULT_FRAME_HEIGHT) * 2)
     44 #define DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE   ((DEFAULT_FRAME_WIDTH * DEFAULT_FRAME_HEIGHT * 3) / 2)
     45 
     46 #define MFC_INPUT_BUFFER_NUM_MAX         2
     47 #define DEFAULT_MFC_INPUT_BUFFER_SIZE    ((1280 * 720 * 3) / 2)
     48 
     49 #define INPUT_PORT_SUPPORTFORMAT_NUM_MAX    1
     50 #define OUTPUT_PORT_SUPPORTFORMAT_NUM_MAX   3
     51 
     52 #ifdef USE_ANDROID_EXTENSION
     53 #define ANDROID_MAX_VIDEO_OUTPUTBUFFER_NUM   1
     54 #endif
     55 
     56 typedef struct
     57 {
     58     void *pAddrY;
     59     void *pAddrC;
     60 } MFC_DEC_ADDR_INFO;
     61 
     62 typedef struct _SEC_MFC_NBDEC_THREAD
     63 {
     64     OMX_HANDLETYPE  hNBDecodeThread;
     65     OMX_HANDLETYPE  hDecFrameStart;
     66     OMX_HANDLETYPE  hDecFrameEnd;
     67     OMX_BOOL        bExitDecodeThread;
     68     OMX_BOOL        bDecoderRun;
     69 
     70     OMX_U32         oneFrameSize;
     71 } SEC_MFC_NBDEC_THREAD;
     72 
     73 typedef struct _MFC_DEC_INPUT_BUFFER
     74 {
     75     void *PhyAddr;      // physical address
     76     void *VirAddr;      // virtual address
     77     int   bufferSize;   // input buffer alloc size
     78     int   dataSize;     // Data length
     79 } MFC_DEC_INPUT_BUFFER;
     80 
     81 #ifdef __cplusplus
     82 extern "C" {
     83 #endif
     84 
     85 OMX_ERRORTYPE SEC_OMX_UseBuffer(
     86     OMX_IN OMX_HANDLETYPE            hComponent,
     87     OMX_INOUT OMX_BUFFERHEADERTYPE **ppBufferHdr,
     88     OMX_IN OMX_U32                   nPortIndex,
     89     OMX_IN OMX_PTR                   pAppPrivate,
     90     OMX_IN OMX_U32                   nSizeBytes,
     91     OMX_IN OMX_U8                   *pBuffer);
     92 OMX_ERRORTYPE SEC_OMX_AllocateBuffer(
     93     OMX_IN OMX_HANDLETYPE            hComponent,
     94     OMX_INOUT OMX_BUFFERHEADERTYPE **ppBuffer,
     95     OMX_IN OMX_U32                   nPortIndex,
     96     OMX_IN OMX_PTR                   pAppPrivate,
     97     OMX_IN OMX_U32                   nSizeBytes);
     98 OMX_ERRORTYPE SEC_OMX_FreeBuffer(
     99     OMX_IN OMX_HANDLETYPE hComponent,
    100     OMX_IN OMX_U32        nPortIndex,
    101     OMX_IN OMX_BUFFERHEADERTYPE *pBufferHdr);
    102 OMX_ERRORTYPE SEC_OMX_AllocateTunnelBuffer(
    103     SEC_OMX_BASEPORT *pOMXBasePort,
    104     OMX_U32           nPortIndex);
    105 OMX_ERRORTYPE SEC_OMX_FreeTunnelBuffer(
    106     SEC_OMX_BASEPORT *pOMXBasePort,
    107     OMX_U32           nPortIndex);
    108 OMX_ERRORTYPE SEC_OMX_ComponentTunnelRequest(
    109     OMX_IN  OMX_HANDLETYPE hComp,
    110     OMX_IN OMX_U32         nPort,
    111     OMX_IN OMX_HANDLETYPE  hTunneledComp,
    112     OMX_IN OMX_U32         nTunneledPort,
    113     OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup);
    114 OMX_ERRORTYPE SEC_OMX_BufferProcess(OMX_HANDLETYPE hComponent);
    115 OMX_ERRORTYPE SEC_OMX_VideoDecodeGetParameter(
    116     OMX_IN OMX_HANDLETYPE hComponent,
    117     OMX_IN OMX_INDEXTYPE  nParamIndex,
    118     OMX_INOUT OMX_PTR     ComponentParameterStructure);
    119 OMX_ERRORTYPE SEC_OMX_VideoDecodeSetParameter(
    120     OMX_IN OMX_HANDLETYPE hComponent,
    121     OMX_IN OMX_INDEXTYPE  nIndex,
    122     OMX_IN OMX_PTR        ComponentParameterStructure);
    123 OMX_ERRORTYPE SEC_OMX_VideoDecodeComponentDeinit(OMX_IN OMX_HANDLETYPE hComponent);
    124 
    125 #ifdef __cplusplus
    126 }
    127 #endif
    128 
    129 #endif
    130