xref: /utopia/UTPA2-700.0.x/projects/tmplib/include/apiVDEC_v2.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 
78 #ifndef _VDEC_V2_H_
79 #define _VDEC_V2_H_
80 
81 #ifdef __cplusplus
82 extern "C"
83 {
84 #endif
85 
86 
87 
88 typedef enum
89 {
90     //E_VDEC_V2_CMD_GET_FREE_STREAM_ID,
91 
92     E_VDEC_V2_CMD_GETLIBVER = 0,
93     E_VDEC_V2_CMD_GETINFO,
94     E_VDEC_V2_CMD_GETSTATUS,
95     E_VDEC_V2_CMD_CHECKCAPS,
96     E_VDEC_V2_CMD_ENABLETUEBOMODE,
97     E_VDEC_V2_CMD_INIT,
98     E_VDEC_V2_CMD_INIT_EX,
99     E_VDEC_V2_CMD_SET_CONTROL,
100     E_VDEC_V2_CMD_GET_CONTROL,
101     E_VDEC_V2_CMD_PRE_SET_CONTROL,
102     E_VDEC_V2_CMD_POST_SET_CONTROL,
103     E_VDEC_V2_CMD_RST,
104     E_VDEC_V2_CMD_EXIT,
105     E_VDEC_V2_CMD_CHECK_DISP_INFO_RDY,
106     E_VDEC_V2_CMD_SET_FRC_MODE,
107     E_VDEC_V2_CMD_SET_DYNSCALING_PARAMS,
108     E_VDEC_V2_CMD_PLAY,
109     E_VDEC_V2_CMD_PAUSE,
110     E_VDEC_V2_CMD_RESUME,
111     E_VDEC_V2_CMD_STEP_DISP,
112     E_VDEC_V2_CMD_IS_STEP_DISP_DONE,
113     E_VDEC_V2_CMD_SEEK_TO_PTS,
114     E_VDEC_V2_CMD_SKIP_TO_PTS,
115     E_VDEC_V2_CMD_STEP_DECODE,
116     E_VDEC_V2_CMD_IS_STEP_DECODE_DONE,
117     E_VDEC_V2_CMD_SET_TRICK_MODE,
118     E_VDEC_V2_CMD_PUSH_DECQ,
119     E_VDEC_V2_CMD_FIRE_DEC_CMD,
120     E_VDEC_V2_CMD_GET_DECQ_VACANCY,
121     E_VDEC_V2_CMD_IS_CC_AVAILABLE,
122     E_VDEC_V2_CMD_GET_CC_INFO,
123     E_VDEC_V2_CMD_FLUSH,
124     E_VDEC_V2_CMD_GET_ES_WRITE_PTR,
125     E_VDEC_V2_CMD_GET_ES_READ_PTR,
126     E_VDEC_V2_CMD_ENABLE_LAST_FRAME_SHOW,
127     E_VDEC_V2_CMD_IS_DISP_FINISH,
128     E_VDEC_V2_CMD_SET_SPEED,
129     E_VDEC_V2_CMD_IS_FRAME_RDY,
130     E_VDEC_V2_CMD_SET_FREEZE_DISP,
131     E_VDEC_V2_CMD_SET_BLUE_SCREEN,
132     E_VDEC_V2_CMD_RESET_PTS,
133     E_VDEC_V2_CMD_AVSYNC_ON,
134     E_VDEC_V2_CMD_SET_AVSYNC_FREERUN_THRESHOLD,
135     E_VDEC_V2_CMD_IS_AVSYNC_ON,
136     E_VDEC_V2_CMD_GET_PTS,
137     E_VDEC_V2_CMD_GET_NEXT_PTS,
138     E_VDEC_V2_CMD_IS_START_SYNC,
139     E_VDEC_V2_CMD_IS_REACH_SYNC,
140     E_VDEC_V2_CMD_IS_FREERUN,
141     E_VDEC_V2_CMD_MHEG_DECODE_I_FRAME,
142     E_VDEC_V2_CMD_MHEG_IS_I_FRAME_DECODING,
143     E_VDEC_V2_CMD_MHEG_RST_I_FRAME_DEC,
144     E_VDEC_V2_CMD_GET_ERR_CODE,
145     E_VDEC_V2_CMD_GET_ERR_CNT,
146     E_VDEC_V2_CMD_GET_ACTIVE_CODEC_TYPE,
147     E_VDEC_V2_CMD_GET_BITS_RATE,
148     E_VDEC_V2_CMD_IS_32PULLDOWN,
149     E_VDEC_V2_CMD_IS_ALIVE,
150     E_VDEC_V2_CMD_GET_VIDEO_PTS_STC_DELTA,
151     E_VDEC_V2_CMD_IS_WITH_VALID_STREAM,
152     E_VDEC_V2_CMD_IS_I_FRAME_FOUND,
153     E_VDEC_V2_CMD_IS_WITH_LOW_DELAY,
154     E_VDEC_V2_CMD_IS_ALL_BUFFER_EMPTY,
155     E_VDEC_V2_CMD_GET_GOP_CNT,
156     E_VDEC_V2_CMD_GET_FRAME_CNT,
157     E_VDEC_V2_CMD_GET_SKIP_CNT,
158     E_VDEC_V2_CMD_GET_DROP_CNT,
159     E_VDEC_V2_CMD_GET_DISP_INFO,
160     E_VDEC_V2_CMD_GET_TRICK_MODE,
161     E_VDEC_V2_CMD_GET_ACTIVE_FORMAT,
162     E_VDEC_V2_CMD_GET_COLOUR_PRIMARIES,
163     E_VDEC_V2_CMD_GET_HW_KEY,
164     E_VDEC_V2_CMD_IS_SEQ_CHG,
165     E_VDEC_V2_CMD_SET_DBG_LEVEL,
166     E_VDEC_V2_CMD_GET_DEC_FRAME_INFO,
167     E_VDEC_V2_CMD_GET_DISP_FRAME_INFO,
168     E_VDEC_V2_CMD_GET_EXT_DISP_INFO,
169     E_VDEC_V2_CMD_GET_DEC_TIME_CODE,
170     E_VDEC_V2_CMD_GET_DISP_TIME_CODE,
171     E_VDEC_V2_CMD_CC_STARTPARSING,
172     E_VDEC_V2_CMD_CC_STOPPARSING,
173     E_VDEC_V2_CMD_CC_GETWRITEPTR,
174     E_VDEC_V2_CMD_CC_GETREADPTR,
175     E_VDEC_V2_CMD_CC_UPDATEREADPTR,
176     E_VDEC_V2_CMD_CC_GETISOVERFLOW,
177     E_VDEC_V2_CMD_SETEVENT,
178     E_VDEC_V2_CMD_UNSETEVENT,
179     E_VDEC_V2_CMD_SETENVENT_EX,
180     E_VDEC_V2_CMD_UNSETEVENT_EX,
181     E_VDEC_V2_CMD_GETEVENTINFO,
182     E_VDEC_V2_CMD_GENPATTERN,
183     E_VDEC_V2_CMD_GENPATTERNLEASTLENGTH,
184     E_VDEC_V2_CMD_DISABLEDEBLOCKING,
185     E_VDEC_V2_CMD_DISABLEQUARTERPIXEL,
186     E_VDEC_V2_CMD_SETAUTORMLSTZEROBYTE,
187     E_VDEC_V2_CMD_SETBALANCEBW,
188     E_VDEC_V2_CMD_DBGDUMPSTATUS,
189     E_VDEC_V2_CMD_SETCONTROL,
190     E_VDEC_V2_CMD_GETCONTROL,
191     E_VDEC_V2_CMD_GETDISPCNT,
192     E_VDEC_V2_CMD_GETFWVERSION,
193     E_VDEC_V2_CMD_SETBLOCKDISPLAY,
194     E_VDEC_V2_CMD_ENABLEESBUFFMALLOC,
195     E_VDEC_V2_CMD_GETESBUFFVACANCY,
196     E_VDEC_V2_CMD_GETESBUFF,
197     E_VDEC_V2_CMD_GETNEXTDISPFRAME,
198     E_VDEC_V2_CMD_DISPLAYFRAME,
199     E_VDEC_V2_CMD_RELEASEFRAME,
200     E_VDEC_V2_CMD_FLUSHPTSBUF,
201     E_VDEC_V2_CMD_CAPTUREFRAME,
202     E_VDEC_V2_CMD_CC_INIT,
203     E_VDEC_V2_CMD_CC_SETCFG,
204     E_VDEC_V2_CMD_CC_SETBUFFSTARTADD,
205     E_VDEC_V2_CMD_CC_UPDATEWRITEADD,
206     E_VDEC_V2_CMD_CC_UPDATEREADADD,
207     E_VDEC_V2_CMD_CC_DISABLEPARSING,
208     E_VDEC_V2_CMD_CC_GETINFO,
209     E_VDEC_V2_CMD_CC_GETISRSTDONE,
210     E_VDEC_V2_CMD_CC_GETISBUFFOVERFLOW,
211     E_VDEC_V2_CMD_CC_GETWRITEADD,
212     E_VDEC_V2_CMD_CC_GETREADADD,
213     E_VDEC_V2_CMD_SYSTEMPRESETCONTROL,
214     E_VDEC_V2_CMD_PRESETCONTROL,
215 
216     E_VDEC_V2_CMD_NUM,
217     E_VDEC_V2_CMD_MAX = E_VDEC_V2_CMD_NUM,
218 } E_VDEC_V2_IOCTL_CMD;
219 
220 
221 //-------------------------------------------------------------------------------------------------
222 //  API for Upper layer
223 //-------------------------------------------------------------------------------------------------
224 
225 void VDEC_V2_RegisterToUtopia(void);
226 MS_U32 VDEC_V2_Open(void** ppInstance, MS_U32 u32ModuleVersion, void* pAttribute);
227 MS_U32 VDEC_V2_Close(void* pInstance);
228 MS_U32 VDEC_V2_Ioctl(void* pInstance, MS_U32 u32Cmd, void* pArgs);
229 
230 typedef struct
231 {
232     VDEC_User_Cmd eUserCmd;
233     void* param[8];  // at most 8 param
234     void* pRet;//johnny.ko
235 }VDEC_V2_IO_Param;
236 
237 #ifdef __cplusplus
238 }
239 #endif
240 
241 #undef _VDEC_V2_H_
242 #endif //_VDEC_V2_H_
243