/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*
*
* $Author: zhipeng.dong $
* $Modtime: $
* $Revision: #3 $
*
*/

// *********************************************************************
// Memo
// *********************************************************************
/*
*/

#ifndef _VDECOMX_MOD_H_
#define _VDECOMX_MOD_H_


#ifdef __cplusplus
extern "C" {
#endif

/*=============================================================================
 *                              Definition
 *===========================================================================*/

#define VDECOMX_LOG_ERROR    (1<<0)
#define VDECOMX_LOG_WARNING  (1<<1)
#define VDECOMX_LOG_DEBUG    (1<<2)
#define VDECOMX_LOG_INFO     (1<<3)
#define VDECOMX_LOG_VERBOS   (1<<4)

#define VDECOMX_VFIFO_SIZE (0xCFFD20)    // smaller than (FEEDER BUFFER SIZE/2) => 1 instance, each has 2 buffers
#define VDECOMX_MAX_BUFFER_SIZE (21)
#define VDECOMX_MAX_DECODER (4)
#define VDECOMX_INPUT_BUF_MAX  (20)

//cli types
typedef enum {
    VDEXOMX_CLI_TYPE_IN = 0,
    VDEXOMX_CLI_TYPE_OUT,
    VDEXOMX_CLI_TYPE_DEBUG,
    VDEXOMX_CLI_TYPE_VERBOSE,
    VDEXOMX_CLI_TYPE_FREEZE
} VDEXOMX_CLI_TYPE;

typedef enum {
    VDEXOMX_UNKNOWN,
    
    VDEXOMX_CREATE      = _IOWR('c', 0, long),
    VDEXOMX_INIT        = _IOWR('c', 1, long),
    VDEXOMX_DECODE      = _IOWR('c', 2, long),
    VDEXOMX_GETPARAM    = _IOWR('c', 3, long),
    VDEXOMX_SETPARAM    = _IOWR('c', 4, long),
    VDEXOMX_DEINIT      = _IOWR('c', 5, long),
    VDEXOMX_RELEASE     = _IOWR('c', 6, long),
    VDEXOMX_GETLOGMASK  = _IOWR('c', 7, long),
    VDEXOMX_GETEVENT    = _IOWR('c', 8, long),
    VDEXOMX_COMMAND_MAX = _IOWR('c', 53, long)
} VDEXOMX_COMMAND;


typedef enum
{
    VDECOMX_GET_TYPE_QUERY_REF_POOL_SIZE,      ///< how many buffer size of the reference pool needs in driver
    VDECOMX_GET_TYPE_QUERY_DISP_POOL_SIZE,     ///< how many buffer size of the display pool needs in driver
    VDECOMX_GET_TYPE_DISP_FRAME_BUFFER,        ///< return a P_VDECOMX_FRAMEBUF_T address (especially in display order != decode order)
    VDECOMX_GET_TYPE_FREE_FRAME_BUFFER,        ///< return a frame didn't be a reference more (when buffer_mode = REF_IS_DISP_EXT, REF_INT_DISP_EXT or REF_INT_POOL_DISP_EXT)
    VDECOMX_GET_TYPE_GET_PICTURE_INFO,         ///< return a pointer address point to P_VDECOMX_PICINFO_T
    VDECOMX_GET_TYPE_GET_STATISTIC_INFO,       ///< return statistic information.
    VDECOMX_GET_TYPE_GET_FRAME_MODE,           ///< return frame mode parameter.
    VDECOMX_GET_TYPE_GET_FRAME_CROP_INFO,      ///< return frame crop information.
    VDECOMX_GET_TYPE_QUERY_REORDER_ABILITY,    ///< query if driver can re-order the decode order to display order
    VDECOMX_GET_TYPE_QUERY_DOWNSIZE_ABILITY,   ///< query if driver can downsize decoded frame
    VDECOMX_GET_TYPE_QUERY_RESIZE_ABILITY,     ///< query if driver can resize decoded frame
    VDECOMX_GET_TYPE_QUERY_DEBLOCK_ABILITY,    ///< query if driver can do deblocking
    VDECOMX_GET_TYPE_QUERY_DEINTERLACE_ABILITY,///< query if driver can do deinterlace
    VDECOMX_GET_TYPE_QUERY_DROPFRAME_ABILITY,  ///< query if driver can drop frame
    VDECOMX_GET_TYPE_GET_DECODE_STATUS_INFO,   ///< query if driver finish decode one frame but no output (main profile with B frame case.)
    VDECOMX_GET_TYPE_GET_PIXEL_FORMAT,          ///< query the driver output pixel format
    VDECOMX_GET_TYPE_GET_CPU_LOADING_INFO,       ///< query the cpu loading info from kernel driver
    VDECOMX_GET_TYPE_NEED_FRAME_BUFFER,         ///< query the decoder need more output buffer.
    VDECOMX_GET_TYPE_GET_SEQUENCE_INFO,
    VDECOMX_GET_TYPE_ALLOCATE_BUFFER,           ///< allocate buffer from feeder.
    VDECOMX_GET_TYPE_QUERY_FEEDER_INFO,          //< allocate single input buffer size from feeder.
    VDECOMX_GET_TYPE_GET_KMEM_HANDLER,          // < allocate a kmem handler for a kernal space address.    
    VDECOMX_GET_TYPE_QUERY_HW_ABILITY,                // < query if hw vdec is enough to play
    VDECOMX_GET_TYPE_GET_VDEC_CNT              =64,  ///< query the max decoder cnt.
                                                   //resource manger will use hard code 64 to get vdec cnt when call ioctl
    VDECOMX_GET_TYPE_GET_COLOR_CONVERT_BUFFER,
    VDECOMX_GET_TYPE_HDR10_INFO,
    VDECOMX_GET_TYPE_HDR10_METADATA_INFO,
} VDECOMX_GET_TYPE_T;

typedef enum
{
    VDECOMX_VIDEO_FORMAT_UNKNOWN_VIDEO_FORMAT  = 0,       ///< Unknown video format
    VDECOMX_VIDEO_FORMAT_DIVX311               = (1<<0),  ///< Divix 3.11
    VDECOMX_VIDEO_FORMAT_DIVX4                 = (1<<1),  ///< Divix 4
    VDECOMX_VIDEO_FORMAT_DIVX5                 = (1<<2),  ///< Divix 5
    VDECOMX_VIDEO_FORMAT_XVID                  = (1<<3),  ///< Xvid
    VDECOMX_VIDEO_FORMAT_MPEG1                 = (1<<4),  ///< MPEG-1
    VDECOMX_VIDEO_FORMAT_MPEG2                 = (1<<5),  ///< MPEG-2
    VDECOMX_VIDEO_FORMAT_MPEG4                 = (1<<6),  ///< MPEG-4
    VDECOMX_VIDEO_FORMAT_H263                  = (1<<7),  ///< H263
    VDECOMX_VIDEO_FORMAT_H264                  = (1<<8),  ///< H264
    VDECOMX_VIDEO_FORMAT_H265                  = (1<<9),  ///< H265
    VDECOMX_VIDEO_FORMAT_WMV                   = (1<<10), ///< WMV
    VDECOMX_VIDEO_FORMAT_RV                    = (1<<11), ///< RV
    VDECOMX_VIDEO_FORMAT_VP6                   = (1<<12), ///< VP6
    VDECOMX_VIDEO_FORMAT_VP7                   = (1<<13), ///< VP7
    VDECOMX_VIDEO_FORMAT_VP8                   = (1<<14), ///< VP8
    VDECOMX_VIDEO_FORMAT_VP9                   = (1<<15),  //VP9
    VDECOMX_VIDEO_FORMAT_AVS                   = (1<<16), ///< AVS
    VDECOMX_VIDEO_FORMAT_MJPEG                 = (1<<17), ///< Motion JPEG
    VDECOMX_VIDEO_FORMAT_S263                  = (1<<18),  ///< Sorenson Spark
    VDECOMX_VIDEO_FORMAT_H264HP                = (1<<19)
} VDECOMX_VIDEO_FORMAT_T;

typedef enum
{
    VDECOMX_DECODE_MODE_UNKNOWN = 0,       ///< Unknown
    VDECOMX_DECODE_MODE_NORMAL,            ///< decode all frames (no drop)
    VDECOMX_DECODE_MODE_I_ONLY,            ///< skip P and B frame 
    VDECOMX_DECODE_MODE_B_SKIP,            ///< skip B frame 
    VDECOMX_DECODE_MODE_DROPFRAME,         ///< display param1 frames & drop param2 frames
    VDECOMX_DECODE_MODE_NO_REORDER         ///< output display ASAP without reroder
} VDECOMX_DECODE_MODE_T;

typedef enum
{
    VDECOMX_NFY_TYPE_FORCE_STOP = 0,
    VDECOMX_NFY_TYPE_INPUT_USED,
    VDECOMX_NFY_TYPE_FRAME_DECODED,
    VDECOMX_NFY_TYPE_ASYNC_CVT,    
    VDECOMX_NFY_TYPE_DECODER_ERROR,
    VDECOMX_NFY_TYPE_LAST_EVENT,
    VDECOMX_NFY_TYPE_FRAME_RENDERED,
    VDECOMX_NFY_TYPE_INSUFFICIENT_RESOURCE,
    VDECOMX_NFY_TYPE_HDR10INFO_CHG,
    VDECOMX_NFY_TYPE_MAX
} VDECOMX_NFY_TYPE_T;

typedef struct _VDECOMX_NFY_T
{
    VDECOMX_NFY_TYPE_T  eType;
    unsigned long long  u8Data1;
    unsigned long long  u8Data2;
} VDECOMX_NFY_T;

typedef struct _VDECOMX_SET_DECODE_MODE_T
{
    VDECOMX_DECODE_MODE_T  eDecodeMode;       ///< one of VDECOMX_DECODE_MODE
    unsigned int            u4DisplayFrameNum; ///< 0  8  7  6  5  4  3  2  1  1  1  1  1  1  1  1 
    unsigned int            u4DropFrameNum;    ///< 0  1  1  1  1  1  1  1  1  2  3  4  5  6  7  8
} VDECOMX_SET_DECODE_MODE_T;

typedef struct _VDECOMX_SET_COLOR_CVT_T
{
   unsigned int u4OmxBufferHead;
   unsigned int u4DstAddr;   
   unsigned int u4SrcBufIndex;
   unsigned int  u4AddrY;
   unsigned int  u4AddrC;
   unsigned short u2LineSize;
   unsigned short u2HSize;
   unsigned short u2HTGSize;
   unsigned short u2VTGSize;
   unsigned short u2VSize;
   unsigned short u2TGStride;
   unsigned short u2SliceHeight;
   BOOL fgNV21;
   BOOL fgAsync;
   BOOL fgRasterIn;
} VDECOMX_SET_COLOR_CVT_T;

typedef struct
{
    unsigned int   u4Width;           //Full size 16 byte align
    unsigned int   u4Height;          //Full size 16 byte align
    unsigned short  u2CropX;
    unsigned short  u2CropY;
    unsigned short  u2CropWidth;
    unsigned short  u2CropHeight;
    unsigned int   u4Offset;          //Offset of YUV buffer start address
} VDECOMX_FRAMEBUF_FORMAT_T;

typedef struct _VDECOMX_MEM_ADDR_T
{
    unsigned int    u4VA;      ///< [IN/OUT] virtual address   
    unsigned int    u4PA;       ///< [IN/OUT] physical address   
    unsigned int    u4Size;     ///< [IN/OUT] size   
} VDECOMX_MEM_ADDR_T;

typedef enum
{
    VDECOMX_FBSTATUS_NORMAL        = 0,            ///< normal type
    VDECOMX_FBSTATUS_REPEAT_LAST   = (1 << 0),     ///< 
    VDECOMX_FBSTATUS_NOT_DISPLAY   = (1 << 1),     ///< YCbCr 420 block in three planar
    VDECOMX_FBSTATUS_NOT_USED      = (1 << 2)     ///< for H.264 multi-slice
} VDECOMX_FBSTATUS_T;

typedef struct _VDECOMX_FRAMEBUF_T
{
    unsigned int u4AddressY;        ///< [IN/OUT]Buffer width
    unsigned int u4AddressC;        ///< [IN/OUT]Buffer height
    unsigned int u4Size;            ///< [OUT]Display width
    unsigned int u4BufWidth;        ///< [IN/OUT]Buffer width
    unsigned int u4BufHeight;       ///< [IN/OUT]Buffer height
    unsigned int u4DispWidth;       ///< [OUT]Display width
    unsigned int u4DispHeight;      ///< [OUT]Display width
    unsigned int u4DispPitch;       ///< [OUT]Display pitch
    unsigned int u4Timestamp;       ///< [IN/OUT]Timestamp for last decode picture
    unsigned long long u8Timestamp;
    unsigned int u4AspectRatioW;    ///< [OUT]The horizontal size of the sample aspect ratio.
    unsigned int u4AspectRatioH;    ///< [OUT]The vertical size of the sample aspect ratio.
    unsigned int u4FrameBufferType; ///< [OUT]One of VDECOMX_FBTYPE
    unsigned int u4PictureStructure;///< [OUT]One of VDECOMX_PIC_STRUCT
    unsigned int u4FrameBufferStatus;///< [OUT] One of VDECOMX_FBSTSTUS
    unsigned int u4MemHeaderY;         /// < [OUT] kmem map handler
    unsigned int u4MemHeaderC;         /// < [OUT] kmem map handler
    unsigned int u4Eos;             ///< [OUT] Eos    
    BOOL            fgCropping;
    unsigned int  u4CropX;
    unsigned int  u4CropY;
    unsigned int  u4CropWidth;
    unsigned int  u4CropHeight;
    unsigned int u4Reserved1;       ///< Reserved
    unsigned int u4Reserved2;       ///< Reserved
    unsigned int u4Reserved3;       ///< Reserved
} VDECOMX_FRAMEBUF_T;

typedef struct
{
    VDECOMX_FRAMEBUF_FORMAT_T  rFrameFormat;
    VDECOMX_FRAMEBUF_T         rFrameBuf;
} VDECOMX_FRAME_T;


// VDECOMX_SET_TYPE_SET_DECODE_MODE
typedef struct
{
    VDECOMX_FRAME_T            rFrame;
    char                       bDisplay;
    char                       bFree;
} VDECOMX_SET_TYPE_DECODE_MODE_T;

typedef struct
{    
    VDECOMX_VIDEO_FORMAT_T     eVideoFormat;
    unsigned int u4Width;
    unsigned int u4Height;
    unsigned int u4FrameRate;
} VDECOMX_SET_TYPE_PICTURE_INFO_T;

typedef struct _VDECOMX_RINGBUF_T
{
    VDECOMX_MEM_ADDR_T  rBase;      ///< [IN]Base address of ring buffer
    unsigned int    u4Read;     ///< [IN/OUT]Virtual address of read pointer.
    unsigned int    u4Write;    ///< [IN]Virtual address of write pointer.
    unsigned int u4Timestamp;   ///< store timestamp
    unsigned long long u8Timestamp;
    unsigned int    u4BufHandle;
    unsigned int    u4VAddr;     ///< [IN/OUT]Virtual address of read pointer.
    unsigned int    u4Offset;    
    unsigned int    u4Size;
    char fgEos;
} VDECOMX_RINGBUF_T;

typedef struct _VDECOMX_SEQINFO_T
{
    unsigned int u4Width;      ///< Sequence buffer width
    unsigned int u4Height;     ///< Sequence buffer height
    unsigned int u4PicWidth;   ///< Sequence display width
    unsigned int u4PicHeight;  ///< Sequence display height
    BOOL         bCropping;    
    unsigned int u4CropX;
    unsigned int u4CropY;
    unsigned int u4CropWidth;
    unsigned int u4CropHeight;
} VDECOMX_SEQINFO_T;

typedef struct
{
    BOOL                       fgseamless;         //IN
    unsigned int               u4MaxWidth;
    unsigned int               u4MaxHeight;
    unsigned int               u4ResizerId;
} VDECOMX_SET_TYPE_SEAMLESS_INFO_T;

typedef struct _VDECOMX_FEEDER_INFO_T
{
    UINT32 u4TotalSize;
    UINT32 u4BufferCount;    
    UINT32 u4BufferSize;
} VDECOMX_FEEDER_INFO_T;

typedef struct
{
    unsigned int               u4Id;
} VDECOMX_SET_TYPE_VDP_INFO_T;

typedef struct
{
    UINT32 u4AudioHwSync;
} VDECOMX_SET_TYPE_TUNNEL_T;

typedef struct
{
    UINT32 u4HdrType;                      ///< HDR type
    UINT32 u4VdoHdrChange;                 ///< HDR type change
    UINT32 u4VdoGamma;                     ///< Gamma type
    UINT32 u4ColorSpaceTypeDef;            ///< ColorSpace type
    UINT32 u4VdoColorSpaceChange;          ///< ColorSpace type change
    UINT32 u4TV_MaxLuma;                   ///< TV_MaxLuma
    UINT32 u4TypeMatrixCoefficients;       ///< TV MatrixCoefficients type
    UINT32 u4TypeRange;                    ///< Range type
} VDECOMX_HDR10_INFO_T;

typedef struct
{
    UINT16 ui2DisplayPrimaries_x[3];
    UINT16 ui2DisplayPrimaries_y[3];
    UINT16 ui2WhitePoint_x;
    UINT16 ui2WhitePoint_y;
    UINT16 ui2MaxDisplayMasteringLum;
    UINT16 ui2MinDisplayMasteringLum;
    UINT16 ui2MaxCll;
    UINT16 ui2MaxFall;
} VDECOMX_HDR10_METADATA_INFO_T;

typedef enum
{
    VDECOMX_SET_TYPE_USE_EXT_TIMESTAMP,        ///< =1, use timestamp in sVDECOMX_FRAMEBUF_T for the picture
    VDECOMX_SET_TYPE_SET_BUFFER_MODE,          ///< value is one of VDECOMX_BUFFER_MODE
    VDECOMX_SET_TYPE_SET_FRAME_BUFFER_TYPE,    ///< one of VDECOMX_FBTYPE, if output type is the same as decode type, buffer mode can be REF_IS_DISP
    VDECOMX_SET_TYPE_FREE_FRAME_BFFER,         ///< release buffer if DISP BUFFER is allocated from driver
    VDECOMX_SET_TYPE_SET_REF_EXT_POOL_ADDR,    ///< if use REF_EXT_POOL in SET_BUFFER_MODE
    VDECOMX_SET_TYPE_SET_DISP_EXT_POOL_ADDR,   ///< if use DISP_EXT_POOL in SET_BUFFER_MODE
    VDECOMX_SET_TYPE_SET_DECODE_MODE,          ///< set if drop frame
    VDECOMX_SET_TYPE_SET_POST_PROC,            ///< buffer mode cannot set to REF_IS_DISP when using post-processing
    VDECOMX_SET_TYPE_SET_STATISTIC_ON,         ///< enable statistic function.
    VDECOMX_SET_TYPE_SET_STATISTIC_OFF,        ///< disable statistic function.
    VDECOMX_SET_TYPE_SET_FRAME_MODE,           ///< set frame mode
    VDECOMX_SET_TYPE_SET_BUF_STATUS_FOR_SPEEDY,///< set buffer status for speedy mode
    VDECOMX_SET_TYPE_SET_LAST_DISPLAY_TIME,    ///< set the last display time
    VDECOMX_SET_TYPE_SET_CURRENT_PLAY_TIME,    ///< set the current play time
    VDECOMX_SET_TYPE_SET_CONCEAL_LEVEL,        ///< error conceal level for decoder
    VDECOMX_SET_TYPE_SET_PICTURE_INFO,         ///< pictue width/height/frame rate
#if 1//1//defined(VDEC_YUV_CVT_IMG)
    VDECOMX_SET_TYPE_SET_COLOR_CONVERT,       ///< set for color format b2r to yu420 >
#endif
    VDECOMX_SET_TYPE_SET_OMX_TIDS,
    VDECOMX_SET_TYPE_SET_BUFTAG,
    VDECOMX_SET_TYPE_SET_DROP_TAGBUFFER,
    VDECOMX_SET_TYPE_SET_DROP_UNTAGBUFFER,
    VDECOMX_SET_TYPE_FREE_BUFFER,
    VDECOMX_SET_TYPE_FLUSH_DEOCDER,
    VDECOMX_SET_TYPE_SET_SEAMLESS_INFO,
    VDECOMX_SET_TYPE_SET_VDP_ID,
    VDECOMX_SET_TYPE_SET_TUNNEL, // tunneled video playback support
    VDECOMX_SET_TYPE_VDEC_PAUSE,
    VDECOMX_SET_TYPE_VDEC_RESUME,
    VDECOMX_SET_TYPE_SET_IMGRZ_ID,
    VDECOMX_SET_TYPE_SET_GAMEMODEL,
    VDECOMX_SET_TYPE_SEND_LAST_EVENT,
    VDECOMX_SET_TYPE_HDR10_INFO,
    VDECOMX_SET_TYPE_HDR10_METADATA_INFO,
} VDECOMX_SET_TYPE_T;

typedef enum _VDECOMX_MODE_T
{
    VDECOMX_MODE_ASYNC = 0,
    VDECOMX_MODE_TUNNEL
} VDECOMX_MODE_T;

typedef enum _VDECOMX_MRESULT_T
{
    VDECOMX_MRESULT_OK = 0,           ///< OK
    VDECOMX_MRESULT_FAIL,             ///< Fail
    VDECOMX_MRESULT_FATAL,            ///< Fatal error to stop.
    VDECOMX_MRESULT_MAX = 0x0FFFFFFF
} VDECOMX_MRESULT_T;

/*=============================================================================
 *                             Function Declaration
 *===========================================================================*/

typedef struct _PAR_VDECOMX_CREATE {
    VDECOMX_MRESULT_T          eRet;               // OUT
    VDECOMX_VIDEO_FORMAT_T     eVideoFormat;       // IN    
    VDECOMX_MODE_T             eMode;
    UINT8 uVdecId;
    BOOL                       fgSecurePlay;         //IN
} PAR_VDECOMX_CREATE;

typedef struct _PAR_VDECOMX_INIT {
    VDECOMX_MRESULT_T          eRet;               // OUT
    VDECOMX_RINGBUF_T          *prBitstream;       // IN
    VDECOMX_SEQINFO_T          *prSeqinfo;         // OUT
} PAR_VDECOMX_INIT;

typedef struct _PAR_VDECOMX_DECODE {
    VDECOMX_MRESULT_T          eRet;               // OUT
    VDECOMX_RINGBUF_T          *prBitstream;       // IN
    VDECOMX_FRAMEBUF_T         *prFramebuf;        // IN
    unsigned int               pHeader;           // IN
} PAR_VDECOMX_DECODE;

typedef struct _PAR_VDECOMX_GETPARAM {
    VDECOMX_MRESULT_T          eRet;               // OUT
    VDECOMX_GET_TYPE_T         eType;              // IN
    void                       *pvInParam;         // IN
    void                       *pvOutParam;        // OUT
} PAR_VDECOMX_GETPARAM;

typedef struct _PAR_VDECOMX_SETPARAM {
    VDECOMX_MRESULT_T          eRet;               // OUT
    VDECOMX_SET_TYPE_T         eType;              // IN
    void                       *pvInParam;         // IN
    void                       *pvOutParam;        // OUT
} PAR_VDECOMX_SETPARAM;

typedef struct _PAR_VDECOMX_GETEVENT {
    VDECOMX_MRESULT_T          eRet;               // OUT
    VDECOMX_NFY_T*   prOutOmxEvent;
} PAR_VDECOMX_GETEVENT;

#ifdef __cplusplus
}
#endif

#endif //#ifndef _VDECOMX_MOD_H_




