xref: /utopia/UTPA2-700.0.x/modules/vdec_lite/drv/mvd_lite/drvMVD_EX.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 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 ///
97 /// @file  drvMVD.h
98 /// @brief MPEG-2/4 Video Decoder header file
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 #ifndef _DRV_MVD_H_
103 #define _DRV_MVD_H_
104 
105 
106 
107 
108 ////////////////////////////////////////////////////////////////////////////////
109 // Include List
110 ////////////////////////////////////////////////////////////////////////////////
111 
112 #ifdef __cplusplus
113 extern "C"
114 {
115 #endif
116 
117 #if (!defined(MSOS_TYPE_NUTTX) && !defined(MSOS_TYPE_OPTEE)) || defined(SUPPORT_X_MODEL_FEATURE)
118 
119 #include "drvmvd_cc.h"
120 ////////////////////////////////////////////////////////////////////////////////
121 // Constant & Macro Definition
122 ////////////////////////////////////////////////////////////////////////////////
123 /// Version string.
124 #define MVD_DRV_VERSION                 /* Character String for DRV/API version             */  \
125     MSIF_TAG,                           /* 'MSIF'                                           */  \
126     MSIF_CLASS,                         /* '00'                                             */  \
127     MSIF_CUS,                           /* 0x0000                                           */  \
128     MSIF_MOD,                           /* 0x0000                                           */  \
129     MSIF_CHIP,                                                                                  \
130     MSIF_CPU,                                                                                   \
131     {'M','V','D','_'},                  /* IP__                                             */  \
132     {'0','A'},                          /* 0.0 ~ Z.Z                                        */  \
133     {'0','1'},                          /* 00 ~ 99                                          */  \
134     {'0','0','6','4','1','6','6','7'},  /* CL#                                              */  \
135     MSIF_OS
136 
137 #define MIU_SEL_0         0
138 #define MIU_SEL_1         1
139 #define MIU_SEL_2         2
140 #define MIU_SEL_3         3
141 
142 
143 #define MST_MODE_TRUE     1
144 #define MST_MODE_FALSE    0
145 
146 #ifndef ANDROID
147     #if defined(MSOS_TYPE_ECOS)
148         #define MVD_PRINT   diag_printf
149         #define MVD_ERR     diag_printf
150     #else
151         #define MVD_PRINT  printf
152         #define MVD_ERR     printf
153     #endif
154 #else
155     #include <sys/mman.h>
156     #include <cutils/ashmem.h>
157     #include <cutils/log.h>
158     #ifndef LOGI // android 4.1 rename LOGx to ALOGx
159         #define MVD_PRINT ALOGI
160     #else
161         #define MVD_PRINT LOGI
162     #endif
163     #ifndef LOGE // android 4.1 rename LOGx to ALOGx
164         #define MVD_ERR ALOGE
165     #else
166         #define MVD_ERR LOGE
167     #endif
168 #endif
169 
170 
171 #ifndef ANDROID
172     #if defined(MSOS_TYPE_ECOS)
173         #define VPRINTF diag_printf
174     #else
175         #define VPRINTF printf
176     #endif
177 #else
178     #define VPRINTF ALOGD
179 #endif
180 
181 ////////////////////////////////////////////////////////////////////////////////
182 // Type & Structure Declaration
183 ////////////////////////////////////////////////////////////////////////////////
184 /// MVD's capability
185 typedef struct _MVD_Caps
186 {
187     MS_BOOL bMPEG2;
188     MS_BOOL bMPEG4;
189     MS_BOOL bVC1;
190 } MVD_Caps;
191 
192 /// MVD driver info.
193 typedef struct _MVD_DrvInfo
194 {
195     MS_U32 u32Resource;
196     MS_U32 u32DeviceNum;
197     MS_U32 u32FWVersion;
198     MVD_Caps stCaps;
199 } MVD_DrvInfo;
200 
201 /// Firmware status
202 typedef enum _MVD_DecStat
203 {
204     E_MVD_STAT_IDLE             = 0x00,
205     E_MVD_STAT_FIND_STARTCODE   = 0x01,//start code
206     E_MVD_STAT_FIND_SPECIALCODE = 0x11,//special code [00_00_01_C5_ab_08_06_27]
207                                        //for flush data using
208     E_MVD_STAT_FIND_FRAMEBUFFER = 0x02,
209     //fw is trying to find empty FB to continue decoding.
210     //if hang in this state, please check "vsync" or AVSync.
211     E_MVD_STAT_WAIT_DECODEDONE  = 0x03,
212     E_MVD_STAT_DECODE_DONE      = 0x04,
213     E_MVD_STAT_WAIT_VDFIFO      = 0x05,
214     E_MVD_STAT_INIT_SUCCESS     = 0x06,
215     E_MVD_STAT_UNKNOWN          = 0xff,
216 } MVD_DecStat;
217 
218 /// MVD driver status
219 typedef struct _MVD_DrvStatus
220 {
221 //    MS_U32      u32FWVer;
222     MVD_DecStat eDecStat;
223 //    MS_BOOL     bIsBusy;
224     MS_U8       u8LastFWCmd;
225 } MVD_DrvStatus;
226 
227 /// MVD stream types for dual decoders
228 typedef enum
229 {
230     E_MVD_DRV_STREAM_NONE = 0,
231     E_MVD_DRV_MAIN_STREAM,
232     E_MVD_DRV_SUB_STREAM,
233 #ifdef VDEC3
234     E_MVD_DRV_N_STREAM,
235 #else
236     E_MVD_DRV_STREAM_MAX = E_MVD_DRV_SUB_STREAM,
237 #endif
238 } MVD_DRV_StreamType;
239 
240 /// Enumerate CodecType that MVD supports
241 typedef enum _MVD_CodecType
242 {
243     E_MVD_CODEC_MPEG2                    = 0x10,
244     E_MVD_CODEC_MPEG4                    = 0x00,
245     E_MVD_CODEC_MPEG4_SHORT_VIDEO_HEADER = 0x01,
246     E_MVD_CODEC_DIVX311                  = 0x02,
247     E_MVD_CODEC_FLV                      = 0x03,
248     E_MVD_CODEC_VC1_ADV                  = 0x04,
249     E_MVD_CODEC_VC1_MAIN                 = 0x05,
250     E_MVD_CODEC_UNKNOWN                  = 0xff
251 } MVD_CodecType;
252 
253 /// Mode of MVD input source
254 typedef enum _MVD_SrcMode
255 {
256     E_MVD_FILE_MODE       = 0x00,
257     E_MVD_SLQ_MODE        = 0x01,
258     E_MVD_TS_MODE         = 0x02,
259     E_MVD_SLQ_TBL_MODE    = 0x03,
260     E_MVD_TS_FILE_MODE    = 0x04,
261     E_MVD_SRC_UNKNOWN     = 0x05
262 } MVD_SrcMode;
263 
264 /// AVSync mode for file playback
265 typedef enum
266 {
267     E_MVD_TIMESTAMP_FREERUN  = 0,  ///Player didn't set PTS/DTS, so display freerun
268     E_MVD_TIMESTAMP_PTS      = 1,  ///Player set PTS to MVD decoder
269     E_MVD_TIMESTAMP_DTS      = 2,  ///Player set DTS to MVD decoder
270     E_MVD_TIMESTAMP_STS      = 3,  ///SortedTimeStamp means decoder should sort timestamp
271     E_MVD_TIMESTAMP_PTS_RVU  = 4,  ///Player set PTS to MVD decoder
272     E_MVD_TIMESTAMP_DTS_RVU  = 5,  ///Player set DTS to MVD decoder
273     E_MVD_TIMESTAMP_NEW_STS  = 6,  ///Player set PTS to MVD decoder
274 } MVD_TIMESTAMP_TYPE;
275 
276 /// ErrCode obtained from firmware
277 typedef enum _MVD_ErrCode
278 {
279     E_MVD_ERR_UNKNOWN            = 0,
280     E_MVD_ERR_SHAPE              = 1,
281     E_MVD_ERR_USED_SPRITE        = 2,
282     E_MVD_ERR_NOT_8_BIT          = 3,   //error_status : bits per pixel
283     E_MVD_ERR_NERPRED_ENABLE     = 4,
284     E_MVD_ERR_REDUCED_RES_ENABLE = 5,
285     E_MVD_ERR_SCALABILITY        = 6,
286     E_MVD_ERR_OTHER              = 7,
287     E_MVD_ERR_H263_ERROR         = 8,
288     E_MVD_ERR_RES_NOT_SUPPORT    = 9,   //error_status : none
289     E_MVD_ERR_MPEG4_NOT_SUPPORT  = 10,  //error_status : none
290     E_MVD_ERR_PROFILE_NOT_SUPPORT= 11,   //error_status : none
291     E_MVD_ERR_RCV_ERROR_OCCUR= 12   //error_status : none
292 } MVD_ErrCode;
293 
294 /// Detailed error status when error occurs
295 typedef enum _MVD_ErrStatus
296 {
297     //error_status for E_MVD_ERR_SHAPE
298     E_MVD_ERR_SHAPE_RECTANGULAR    = 0x10,
299     E_MVD_ERR_SHAPE_BINARY         = 0x11,
300     E_MVD_ERR_SHAPE_BINARY_ONLY    = 0x12,
301     E_MVD_ERR_SHAPE_GRAYSCALE      = 0x13,
302 
303     //error_status for E_MVD_ERR_USED_SPRITE
304     E_MVD_ERR_USED_SPRITE_UNUSED   = 0x20, //sprite not used
305     E_MVD_ERR_USED_SPRITE_STATIC   = 0x21,
306     E_MVD_ERR_USED_SPRITE_GMC      = 0x22,
307     E_MVD_ERR_USED_SPRITE_RESERVED = 0x23,
308 
309     E_MVD_ERR_STATUS_NONE          = 0x77,
310     E_MVD_ERR_STATUS_UNKOWN        = 0x00,
311 } MVD_ErrStatus;
312 
313 /// Picture type of MPEG video
314 typedef enum _MVD_PicType
315 {
316     E_MVD_PIC_I = 0,
317     E_MVD_PIC_P = 1,
318     E_MVD_PIC_B = 2,
319     E_MVD_PIC_UNKNOWN = 0xf,
320 } MVD_PicType;
321 
322 /// Mode of frame rate conversion
323 typedef enum _MVD_FrcMode {
324     E_MVD_FRC_NORMAL = 0,
325     E_MVD_FRC_DISP_TWICE = 1,
326     E_MVD_FRC_3_2_PULLDOWN = 2,
327     E_MVD_FRC_PAL_TO_NTSC = 3,
328     E_MVD_FRC_NTSC_TO_PAL = 4,
329     E_MVD_FRC_DISP_ONEFIELD = 5,//Removed, call MDrv_MVD_EnableDispOneField() instead.
330 } MVD_FrcMode;
331 
332 /// MVD play mode
333 typedef enum
334 {
335     E_MVD_PLAY          = 0x00,
336     E_MVD_STEPDISP      = 0x01,
337     E_MVD_PAUSE         = 0x02,
338     E_MVD_FASTFORWARD   = 0x03,
339     E_MVD_BACKFORWARD   = 0x04,
340     E_MVD_UNKNOWMODE    = 0xff
341 } MVD_PlayMode;
342 
343 /// Store the packet information used for SLQ table file mode
344 typedef struct
345 {
346     MS_VIRT u32StAddr;    ///< Packet offset from bitstream buffer base address. unit: byte.
347     MS_U32 u32Length;    ///< Packet size. unit: byte.
348     MS_U32 u32TimeStamp; ///< Packet time stamp. unit: ms.
349     MS_U32 u32ID_L;      ///< Packet ID low part.
350     MS_U32 u32ID_H;      ///< Packet ID high part.
351 } MVD_PacketInfo;
352 
353 ///MVD frame info data structure
354 typedef struct
355 {
356     MS_U16  u16HorSize;
357     MS_U16  u16VerSize;
358     MS_U32  u32FrameRate;
359     MS_U8   u8AspectRate;
360     MS_U8   u8Interlace;
361     MS_U8   u8AFD;
362     MS_U16  u16par_width;
363     MS_U16  u16par_height;
364     MS_U16  u16SarWidth;
365     MS_U16  u16SarHeight;
366     MS_U16  u16CropRight;
367     MS_U16  u16CropLeft;
368     MS_U16  u16CropBottom;
369     MS_U16  u16CropTop;
370     MS_U16  u16Pitch;
371     MS_U16  u16PTSInterval;
372     MS_U8   u8MPEG1;
373     MS_U8   u8PlayMode;
374     MS_U8   u8FrcMode;
375     MS_VIRT  u32DynScalingAddr;    ///Dynamic scaling address
376     MS_U8   u8DynScalingDepth;    ///Dynamic scaling depth
377     MS_U32  u32DynScalingBufSize;    ///Dynamic scaling BufSize
378     MS_BOOL bEnableMIUSel;        ///Dynamic scaling DS buffer on miu1 or miu0
379 } MVD_FrameInfo;
380 
381 /// MVD AVSync Configuration
382 typedef struct
383 {
384     MS_U32  u32Delay;       //unit: ms
385     MS_U16  u16Tolerance;   //unit: ms
386     MS_BOOL bEnable;
387     MS_U8   u8Rsvd;         //reserved
388 } MVD_AVSyncCfg;
389 
390 /// MVD Command arguments
391 typedef struct
392 {
393     MS_U8 Arg0;    ///< argument 0
394     MS_U8 Arg1;    ///< argument 1
395     MS_U8 Arg2;    ///< argument 2
396     MS_U8 Arg3;    ///< argument 3
397     MS_U8 Arg4;    ///< argument 4
398     MS_U8 Arg5;    ///< argument 5
399 } MVD_CmdArg;
400 
401 /// MVD commands needing handshake
402 typedef enum
403 {
404     MVD_HANDSHAKE_PAUSE,
405     MVD_HANDSHAKE_SLQ_RST,
406     MVD_HANDSHAKE_STOP,
407     MVD_HANDSHAKE_SKIP_DATA,
408     MVD_HANDSHAKE_SKIP_TO_PTS,
409     MVD_HANDSHAKE_SINGLE_STEP,
410     MVD_HANDSHAKE_SCALER_INFO,
411     MVD_HANDSHAKE_GET_NXTDISPFRM,
412     MVD_HANDSHAKE_PARSER_RST,
413     MVD_HANDSHAKE_RST_CC608,
414     MVD_HANDSHAKE_RST_CC708,
415     MVD_HANDSHAKE_VIRTUAL_COMMAND,
416     MVD_HANDSHAKE_FLUSHQUEUE_COMMAND
417 } MVD_HANDSHAKE_CMD;
418 
419 
420 
421 typedef enum
422 {
423     E_MVD_FB_REDUCTION_NONE = 0,        ///< FB reduction disable
424     E_MVD_FB_REDUCTION_1_2 = 1,         ///< FB reduction 1/2
425     E_MVD_FB_REDUCTION_1_4 = 2,         ///< FB reduction 1/4
426 } MVD_FB_Reduction_Type;
427 
428 typedef struct
429 {
430     MVD_FB_Reduction_Type LumaFBReductionMode;     ///< Luma frame buffer reduction mode.
431     MVD_FB_Reduction_Type ChromaFBReductionMode;   ///< Chroma frame buffer reduction mode.
432     MS_U8                 u8EnableAutoMode;        /// 0: Disable, 1: Enable
433     MS_U8                 u8ReservedByte;          /// Reserved byte
434 } MVD_FB_Reduction;
435 
436 /// Configuration of MVD firmware
437 typedef struct
438 {
439     MVD_CodecType    eCodecType;        ///< Specify the active codec type
440     MVD_SrcMode      eSrcMode;          ///< Specify the input source
441     MS_U8            bDisablePESParsing;///< MVD parser enable/disable
442     MS_BOOL          bNotReload;        ///< TRUE to not allow loading f/w after the 1st init to speed up.
443     MVD_FB_Reduction stFBReduction;     ///< MVD Frame buffer reduction type
444     MS_U16           u16FBReduceValue;
445     MS_U8            u8FBMode;          ///driver internal attribute: SD or HD
446     MS_U8            u8FBNum;           ///driver internal attribute: # of frames in FB
447     MS_VIRT           u32FBUsedSize;     ///driver internal attribute: used size
448 } MVD_FWCfg;
449 
450 /// The type of fw binary input source
451 typedef enum
452 {
453     E_MVD_FW_SOURCE_NONE,       ///< No input fw.
454     E_MVD_FW_SOURCE_DRAM,       ///< input source from DRAM.
455     E_MVD_FW_SOURCE_FLASH,      ///< input source from FLASH.
456 } MVD_FWSrcType;
457 
458 /// Configuration of memory layout
459 typedef struct
460 {
461     MVD_FWSrcType eFWSrcType;         //!< the input FW source type.
462     MS_VIRT     u32FWSrcVAddr;         //!< virtual address of input FW binary in DRAM
463     MS_PHY u32FWBinAddr;          //!< physical address in Flash/DRAM of FW code
464     MS_SIZE     u32FWBinSize;
465     MS_PHY u32FWCodeAddr;
466     MS_SIZE     u32FWCodeSize;
467     MS_PHY u32FBAddr;
468     MS_SIZE     u32FBSize;
469     MS_PHY u32BSAddr;
470     MS_SIZE     u32BSSize;
471     MS_PHY u32DrvBufAddr;
472     MS_SIZE     u32DrvBufSize;
473     MS_PHY u32DynSacalingBufAddr;
474     MS_SIZE     u32DynSacalingBufSize;
475     MS_PHY u32Miu1BaseAddr;
476     MS_PHY u32Miu2BaseAddr;
477     MS_PHY u32Miu3BaseAddr;
478     MS_BOOL    bFWMiuSel;
479     MS_BOOL    bHWMiuSel;
480     MS_U8      u8FWMiuSel;
481     MS_U8      u8HWMiuSel;
482     MS_U8      u8FBMiuSel;
483     MS_BOOL    bEnableDynScale;       /// dynamic scaling control bit
484     MS_BOOL    bSupportSDModeOnly;    /// Config from IP Check
485 } MVD_MEMCfg;
486 
487 /// Return value of MVD driver
488 typedef enum
489 {
490     E_MVD_RET_OK            = 1,
491     E_MVD_RET_FAIL          = 0,
492     E_MVD_RET_INVALID_PARAM = 2,
493     E_MVD_RET_QUEUE_FULL    = 3,
494     E_MVD_RET_TIME_OUT      = 4
495 } E_MVD_Result;
496 
497 /// Mode of trick decoding
498 typedef enum
499 {
500     E_MVD_TRICK_DEC_ALL = 0,
501     E_MVD_TRICK_DEC_IP,
502     E_MVD_TRICK_DEC_I,
503     E_MVD_TRICK_DEC_UNKNOWN
504 } MVD_TrickDec;
505 
506 /// Speed type of playing
507 typedef enum
508 {
509     E_MVD_SPEED_DEFAULT = 0,
510     E_MVD_SPEED_FAST,
511     E_MVD_SPEED_SLOW,
512     E_MVD_SPEED_TYPE_UNKNOWN
513 } MVD_SpeedType;
514 
515 /// MVD pattern type
516 typedef enum
517 {
518     E_MVD_PATTERN_FLUSH = 0,           ///< Used after MDrv_MVD_Flush().
519     E_MVD_PATTERN_FILEEND,             ///< Used for file end.
520 } MVD_PatternType;
521 
522 /// MVD frame info structure
523 typedef struct
524 {
525     MS_PHY u32LumaAddr;    ///< The start physical of luma data. Unit: byte.
526     MS_PHY u32ChromaAddr;  ///< The start physcal of chroma data. Unit: byte.
527     MS_U32 u32TimeStamp;       ///< Time stamp(DTS, PTS) of current displayed frame. Unit: 90khz.
528     MS_U32 u32ID_L;            ///< low part of ID number set by MDrv_MVD_PushQueue().
529     MS_U32 u32ID_H;            ///< high part of ID number set by MDrv_MVD_PushQueue().
530     MS_U16 u16Pitch;           ///< The pitch of current frame.
531     MS_U16 u16Width;           ///< pixel width of current frame.
532     MS_U16 u16Height;          ///< pixel height of current frame.
533     MS_U16 u16FrmIdx;          ///< index of current frame.
534     MVD_PicType eFrmType;     ///< picture type: I, P, B frame
535 } MVD_FrmInfo;
536 
537 /// MVD extension display info structure
538 typedef struct
539 {
540     MS_U16 u16VSize;         /// vertical size from sequene_display_extension
541     MS_U16 u16HSize;         /// horizontal size from sequene_display_extension
542     MS_U16 u16VOffset;       /// vertical offset from picture_display_extension
543     MS_U16 u16HOffset;       /// horizontal offset from picture_display_extension
544 } MVD_ExtDispInfo;
545 
546 /// Type of frame info that can be queried
547 typedef enum
548 {
549     E_MVD_FRMINFO_DISPLAY=0,   ///< Displayed frame.
550     E_MVD_FRMINFO_DECODE =1,   ///< Decoded frame.
551     E_MVD_FRMINFO_NEXT_DISPLAY =2,///< Next frame to be displayed.
552 } MVD_FrmInfoType;
553 
554 typedef enum
555 {
556     E_MVD_PTS_DISP = 0,          ///< Displayed frame pts.
557     E_MVD_PTS_PRE_PAS = 1,      ///< Pre-parsing pts.
558 } MVD_PtsType;
559 
560 typedef enum {
561     E_MVD_FRAME_FLIP    = 0,
562     E_MVD_FRAME_RELEASE = 1,
563 } MVD_FrmOpt;
564 
565 ///MVD set debug mode
566 typedef enum
567 {
568     E_MVD_EX_DBG_MODE_ORI = 0,
569     E_MVD_EX_DBG_MODE_BYPASS_INSERT_START_CODE ,     /// for UT
570     E_MVD_EX_DBG_MODE_BYPASS_DIVX_MC_PATCH,            /// for UT
571     E_MVD_EX_DBG_MODE_NUM
572 } MVD_DbgMode;
573 
574 typedef struct
575 {
576     union
577     {
578         struct
579         {
580             MS_U32 bBypassInsertStartCode : 1;  // TRUE: for bypass insert start code for UT...
581             MS_U32 bBypassDivxMCPatch : 1;      // TRUE: for bypass divx MC patch for UT...
582         };
583         MS_U32 value;
584     };
585 }MVD_DbgModeCfg;
586 
587 /// Attributes used by drvMVD & halMVD
588 /// Updated by halMVD, read-only for drvMVD
589 typedef struct
590 {
591     MS_BOOL         bAVSyncOn;
592     MS_BOOL         bDropErrFrm;
593     MS_BOOL         bDropDispfrm;
594     MS_BOOL         bDecodeIFrame;
595     MS_BOOL         bStepDecode;
596     MS_BOOL         bStepDisp;
597     MS_BOOL         bStep2Pts;
598     MS_BOOL         bSkip2Pts;
599     MS_BOOL         bEnableLastFrmShow;
600     MS_BOOL         bSlqTblSync;
601     MS_U8           u8MstMode; //MStreamer mode=1; Non-MSt mode=0.
602     MS_U8           u8McuMode; //MCU mode=1;
603     MS_U8           u8DynScalingDepth;
604     MVD_TrickDec    eTrickMode;
605     MVD_FrcMode     eFrcMode;
606     MVD_TIMESTAMP_TYPE eFileSyncMode;
607     MVD_SpeedType   ePreSpeedType;
608     MS_VIRT          u32UsrDataRd;
609     MS_U32          u32IntCnt;      /// interrupt ocurred counter
610     MVD_AVSyncCfg   stSyncCfg;
611     MVD_DbgModeCfg  stDbgModeCfg;
612     MS_BOOL         bExternalDSBuf;
613 } MVD_CtrlCfg;
614 
615 /// MVD time code structure
616 typedef struct
617 {
618     MS_U8   u8TimeCodeHr;   ///<  time_code_hours
619     MS_U8   u8TimeCodeMin;  ///<  time_code_minutes
620     MS_U8   u8TimeCodeSec;  ///<  time_code_seconds
621     MS_U8   u8TimeCodePic;  ///<  time_code_pictures
622 
623     MS_U8   u8DropFrmFlag;  ///<  drop_frame_flag
624     MS_U8   u8Reserved[3];  ///<  reserved fields for 4-byte alignment
625 } MVD_TimeCode;
626 
627 /// Format of CC (Closed Caption)
628 typedef enum _MVD_CCFormat
629 {
630     E_MVD_CC_NONE       = 0x00,
631     E_MVD_CC_608        = 0x01, //For CC608 or 157
632     E_MVD_CC_708        = 0x02, //For CC708
633     E_MVD_CC_UNPACKED   = 0x03,
634 } MVD_CCFormat;
635 
636 /// Type of CC
637 typedef enum _MVD_CCType
638 {
639     E_MVD_CC_TYPE_NONE = 0,
640     E_MVD_CC_TYPE_NTSC_FIELD1 = 1,
641     E_MVD_CC_TYPE_NTSC_FIELD2 = 2,
642     E_MVD_CC_TYPE_DTVCC = 3,
643     E_MVD_CC_TYPE_NTSC_TWOFIELD = 4,
644 } MVD_CCType;
645 
646 /// Data structure of CC Configuration
647 typedef struct
648 {
649     MVD_CCFormat eFormat;
650     MVD_CCType   eType;
651     MS_VIRT       u32BufStAdd;
652     MS_U32       u32BufSize;
653 } MVD_CCCfg;
654 
655 /// Info. of user data
656 typedef struct
657 {
658     MS_U32 u32Pts;
659     MS_U8  u8PicStruct;           /* picture_structure*/
660     MS_U8  u8PicType;             /* picture type: 1->I picture, 2->P,3->B */
661     MS_U8  u8TopFieldFirst;       /* Top field first: 1 if top field first*/
662     MS_U8  u8RptFirstField;       /* Repeat first field: 1 if repeat field first*/
663 
664     MS_U16 u16TmpRef;            /* Temporal reference of the picture*/
665     MS_U8  u8ByteCnt;
666     MS_U8  u8Reserve;
667 
668     MS_U32 u32DataBuf;
669 } MVD_UsrDataInfo;
670 
671 /// MVD interrupt events
672 typedef enum
673 {
674     E_MVD_EVENT_DISABLE_ALL    = 0,           ///< unregister all events notification
675     E_MVD_EVENT_USER_DATA      = BIT(0),      ///< found user data
676     E_MVD_EVENT_DISP_VSYNC     = BIT(1),      ///< vsync interrupt
677     E_MVD_EVENT_PIC_FOUND      = BIT(2),      ///<
678     E_MVD_EVENT_FIRST_FRAME    = BIT(3),      ///< first frame decoded
679     E_MVD_EVENT_DISP_RDY       = BIT(4),      ///< MVD ready to display.
680     E_MVD_EVENT_SEQ_FOUND      = BIT(5),      ///< found sequence header
681     //E_MVD_EVENT_DEC_CC_FOUND = BIT(6),      ///< MVD found one user data with decoded frame.
682     E_MVD_EVENT_DEC_DATA_ERR   = BIT(7),      ///< ES Data error.
683     E_MVD_EVENT_UNMUTE         = BIT(8),      ///< video unmute
684     E_MVD_EVENT_USER_DATA_DISP = BIT(9),      ///< found user data in display order
685     E_MVD_EVENT_DEC_ERR        = BIT(10),     ///< MVD HW found decode error.
686     E_MVD_EVENT_DEC_I          = BIT(11),     ///< MVD HW decode I frame.
687     E_MVD_EVENT_DEC_ONE_FRAME  = BIT(15),     ///< Decode one frame done
688     E_MVD_EVENT_XC_LOW_DEALY   = BIT(16),     ///< speed up the un-mute screen on XC.
689 } MVD_Event;
690 
691 /// MVD clock speed
692 typedef enum
693 {
694     E_MVD_EX_CLOCK_SPEED_NONE = 0,
695     E_MVD_EX_CLOCK_SPEED_HIGHEST,
696     E_MVD_EX_CLOCK_SPEED_HIGH,
697     E_MVD_EX_CLOCK_SPEED_MEDIUM,
698     E_MVD_EX_CLOCK_SPEED_LOW,
699     E_MVD_EX_CLOCK_SPEED_LOWEST,
700     E_MVD_EX_CLOCK_SPEED_DEFAULT,
701 } MVD_EX_ClockSpeed;
702 
703 //MVD CRC value
704 typedef struct
705 {
706     MS_U32 u32HSize;
707     MS_U32 u32VSize;
708     MS_U32 u32Strip;
709     MS_VIRT u32YStartAddr;
710     MS_VIRT u32UVStartAddr;
711 }MVD_CrcIn;
712 
713 typedef struct
714 {
715     MS_U32 u32YCrc;
716     MS_U32 u32UVCrc;
717 }MVD_CrcOut;
718 
719 typedef struct
720 {
721     MS_VIRT  u32DSBufAddr;       // Buffer Address
722     MS_U32  u32DSBufSize;       // Buffer Size
723 }MVD_EX_ExternalDSBuf;
724 
725 
726 typedef struct
727 {
728     MS_BOOL bHWBufferReMapping;
729 } MVD_Pre_Ctrl;
730 
731 typedef struct
732 {
733     MS_BOOL bColor_Descript;
734     MS_U8 u8Color_Primaries;
735     MS_U8 u8Transfer_Char;
736     MS_U8 u8Matrix_Coef;
737 } MVD_Color_Info;
738 
739 typedef void (*MVD_InterruptCb)(MS_U32 u32CbData);
740 
741 ////////////////////////////////////////////////////////////////////////////////
742 // Function Prototype Declaration
743 ////////////////////////////////////////////////////////////////////////////////
744 E_MVD_Result MDrv_MVD_SetCfg(MS_U32 u32Id, MVD_FWCfg* fwCfg, MVD_MEMCfg* memCfg);
745 MS_U32 MDrv_MVD_GetFWVer(MS_U32 u32Id);
746 void MDrv_MVD_SetDbgLevel(MS_U8 level);
747 const MVD_DrvInfo* MDrv_MVD_GetInfo(void);
748 E_MVD_Result MDrv_MVD_GetLibVer(const MSIF_Version **ppVersion);
749 
750 MS_BOOL MDrv_MVD_SetCodecInfo(MS_U32 u32Id, MVD_CodecType u8CodecType, MVD_SrcMode u8BSProviderMode, MS_U8 bDisablePESParsing);
751 void MDrv_MVD_SetDivXCfg(MS_U32 u32Id, MS_U8 u8MvAdjust, MS_U8 u8IdctSel);
752 
753 void MDrv_MVD_SetFrameBuffAddr(MS_U32 u32Id, MS_VIRT u32addr);
754 void MDrv_MVD_GetFrameInfo(MS_U32 u32Id, MVD_FrameInfo *pinfo );
755 void MDrv_MVD_SetOverflowTH(MS_U32 u32Id, MS_U32 u32Threshold);
756 void MDrv_MVD_SetUnderflowTH(MS_U32 u32Id, MS_U32 u32Threshold);
757 
758 void MDrv_MVD_RstIFrameDec(MS_U32 u32Id,MVD_CodecType eCodecType);
759 MS_BOOL MDrv_MVD_GetIsIFrameDecoding(MS_U32 u32Id);
760 
761 MS_U8 MDrv_MVD_GetSyncStatus(MS_U32 u32Id);
762 MS_BOOL MDrv_MVD_GetIsFreerun(MS_U32 u32Id);
763 MS_U8 MDrv_MVD_GetIsIPicFound(MS_U32 u32Id);
764 
765 MS_BOOL MDrv_MVD_DecodeIFrame(MS_U32 u32Id, MS_PHY u32FrameBufAddr, MS_PHY u32StreamBufAddr, MS_PHY u32StreamBufEndAddr );
766 MS_BOOL MDrv_MVD_GetValidStreamFlag(MS_U32 u32Id);
767 MS_U32 MDrv_MVD_GetChromaFormat(MS_U32 u32Id);
768 //for MM
769 void MDrv_MVD_SetFrameInfo(MS_U32 u32Id, MVD_FrameInfo *pinfo );
770 void MDrv_MVD_GetErrInfo(MS_U32 u32Id, MVD_ErrCode *errCode, MVD_ErrStatus *errStatus);
771 MS_U32 MDrv_MVD_GetSkipPicCounter(MS_U32 u32Id);
772 
773 void MDrv_MVD_SetSLQWritePtr(MS_U32 u32Id, MS_BOOL bCheckData);
774 MS_U32 MDrv_MVD_GetSLQReadPtr(MS_U32 u32Id);
775 MVD_PicType MDrv_MVD_GetPicType(MS_U32 u32Id);
776 MS_U32 MDrv_MVD_GetBitsRate(MS_U32 u32Id);
777 MS_U8 MDrv_MVD_GetVideoRange(MS_U32 u32Id);
778 MS_BOOL MDrv_MVD_GetLowDelayFlag(MS_U32 u32Id);
779 MS_BOOL MDrv_MVD_GetIs32PullDown(MS_U32 u32Id);
780 MS_BOOL MDrv_MVD_GetIsDynScalingEnabled(MS_U32 u32Id);
781 MS_S32 MDrv_MVD_GetPtsStcDiff(MS_U32 u32Id);
782 MS_U32 MDrv_MVD_GetVpuStreamId(MS_U32 u32Id);
783 
784 void MDrv_MVD_Pause(MS_U32 u32Id);
785 void MDrv_MVD_Resume(MS_U32 u32Id);
786 MS_BOOL MDrv_MVD_StepDisp(MS_U32 u32Id);
787 MS_BOOL MDrv_MVD_IsStepDispDone(MS_U32 u32Id);
788 MS_BOOL MDrv_MVD_StepDecode(MS_U32 u32Id);
789 MS_BOOL MDrv_MVD_IsStepDecodeDone(MS_U32 u32Id);
790 MS_BOOL MDrv_MVD_SeekToPTS(MS_U32 u32Id, MS_U32 u32Pts);
791 MS_BOOL MDrv_MVD_IsStep2PtsDone(MS_U32 u32Id);
792 MS_BOOL MDrv_MVD_SkipToPTS(MS_U32 u32Id, MS_U32 u32Pts);
793 MS_BOOL MDrv_MVD_TrickPlay(MS_U32 u32Id, MVD_TrickDec trickDec, MS_U8 u8DispDuration);
794 void MDrv_MVD_EnableForcePlay(MS_U32 u32Id);
795 
796 void MDrv_MVD_RegSetBase(MS_VIRT u32RegBaseAddr);
797 #ifdef VDEC3
798 E_MVD_Result MDrv_MVD_GetFreeStream(MS_U32 *pu32Id, MVD_DRV_StreamType eStreamType, MS_BOOL bIsNStreamMode);
799 #else
800 E_MVD_Result MDrv_MVD_GetFreeStream(MS_U32 *pu32Id, MVD_DRV_StreamType eStreamType);
801 #endif
802 MS_BOOL MDrv_MVD_Init(MS_U32 u32Id,MVD_CodecType eCodecType);
803 MS_BOOL MDrv_MVD_Exit(MS_U32 u32Id);
804 E_MVD_Result MDrv_MVD_Rst(MS_U32 u32Id,MVD_CodecType eCodecType);
805 
806 void MDrv_MVD_Play(MS_U32 u32Id);
807 void MDrv_MVD_SetAVSync(MS_U32 u32Id, MS_BOOL bEnable, MS_U32 u32Delay);
808 void MDrv_MVD_SetAVSyncThreshold(MS_U32 u32Id, MS_U32 u32Th);
809 void MDrv_MVD_SetAVSyncFreerunThreshold(MS_U32 u32Id, MS_U32 u32Th);
810 MS_U32 MDrv_MVD_GetAVSyncDelay(MS_U32 u32Id);
811 MS_BOOL MDrv_MVD_GetIsAVSyncOn(MS_U32 u32Id);
812 MS_BOOL MDrv_MVD_GetIsSyncRep(MS_U32 u32Id);
813 MS_BOOL MDrv_MVD_GetIsSyncSkip(MS_U32 u32Id);
814 MS_BOOL MDrv_MVD_ChangeAVsync(MS_U32 u32Id, MS_BOOL bEnable, MS_U16 u16PTS);
815 MS_BOOL MDrv_MVD_DispCtrl(MS_U32 u32Id, MS_BOOL bDecOrder, MS_BOOL bDropErr, MS_BOOL bDropDisp, MVD_FrcMode eFrcMode);
816 MS_BOOL MDrv_MVD_DispRepeatField(MS_U32 u32Id, MS_BOOL bEnable);
817 MS_U8 MDrv_MVD_GetColorFormat(MS_U32 u32Id);
818 MS_U8 MDrv_MVD_GetMatrixCoef(MS_U32 u32Id);
819 MS_U8 MDrv_MVD_GetActiveFormat(MS_U32 u32Id);
820 MS_U8 MDrv_MVD_GetDispRdy(MS_U32 u32Id);
821 MS_BOOL MDrv_MVD_Is1stFrmRdy(MS_U32 u32Id);
822 MS_U32 MDrv_MVD_GetGOPCount(MS_U32 u32Id);
823 MS_U32 MDrv_MVD_GetPicCounter(MS_U32 u32Id);
824 MS_U32 MDrv_MVD_GetParserByteCnt(MS_U32 u32Id);
825 MVD_DecStat MDrv_MVD_GetDecodeStatus(MS_U32 u32Id);
826 MS_U8 MDrv_MVD_GetLastCmd(MS_U32 u32Id);
827 MS_U32 MDrv_MVD_GetVldErrCount(MS_U32 u32Id);
828 MS_BOOL MDrv_MVD_DropErrorFrame(MS_U32 u32Id, MS_BOOL bDrop);
829 MS_BOOL MDrv_MVD_MVDCommand ( MS_U8 u8cmd, MVD_CmdArg *pstCmdArg );
830 MS_BOOL MDrv_MVD_SkipData(MS_U32 u32Id);
831 MS_BOOL MDrv_MVD_SkipToIFrame(MS_U32 u32Id);
832 MS_BOOL MDrv_MVD_GetCaps(MVD_Caps* pCaps);
833 MS_U32 MDrv_MVD_GetMaxPixel(MS_U32 u32Id);
834 MS_BOOL MDrv_MVD_GetFrmRateIsSupported(MS_U32 u32Id);
835 
836 E_MVD_Result MDrv_MVD_DisableErrConceal(MS_U32 u32Id, MS_BOOL bDisable);
837 E_MVD_Result MDrv_MVD_PushQueue(MS_U32 u32Id, MVD_PacketInfo* pInfo);
838 E_MVD_Result MDrv_MVD_FlushQueue(MS_U32 u32Id);
839 MS_BOOL MDrv_MVD_FlushDisplayBuf(MS_U32 u32Id);
840 MS_U32 MDrv_MVD_GetQueueVacancy(MS_U32 u32Id, MS_BOOL bCached);
841 MS_VIRT MDrv_MVD_GetESReadPtr(MS_U32 u32Id);
842 MS_VIRT MDrv_MVD_GetESWritePtr(MS_U32 u32Id);
843 E_MVD_Result MDrv_MVD_EnableLastFrameShow(MS_U32 u32Id, MS_BOOL bEnable);
844 E_MVD_Result MDrv_MVD_IsDispFinish(MS_U32 u32Id);
845 E_MVD_Result MDrv_MVD_SetSpeed(MS_U32 u32Id, MVD_SpeedType eSpeedType, MS_U8 u8Multiple);
846 E_MVD_Result MDrv_MVD_ResetPTS(MS_U32 u32Id, MS_U32 u32PtsBase);
847 MS_U32 MDrv_MVD_GetPTS(MS_U32 u32Id);
848 MS_U64 MDrv_MVD_GetU64PTS(MS_U32 u32Id,MVD_PtsType eType);
849 MS_U32 MDrv_MVD_GetNextPTS(MS_U32 u32Id);
850 MVD_TrickDec MDrv_MVD_GetTrickMode(MS_U32 u32Id);
851 MS_BOOL MDrv_MVD_IsPlaying(MS_U32 u32Id);
852 MS_BOOL MDrv_MVD_IsIdle(MS_U32 u32Id);
853 MS_BOOL MDrv_MVD_IsSeqChg(MS_U32 u32Id);
854 E_MVD_Result MDrv_MVD_DbgSetData(MS_U32 u32Id, MS_VIRT u32Addr, MS_U32 u32Data);
855 E_MVD_Result MDrv_MVD_DbgGetData(MS_U32 u32Id, MS_VIRT u32Addr, MS_U32* u32Data);
856 MS_U8 MDrv_MVD_GetDecodedFrameIdx (MS_U32 u32Id);
857 MS_BOOL MDrv_MVD_SetFileModeAVSync(MS_U32 u32Id, MVD_TIMESTAMP_TYPE eSyncMode);
858 MS_BOOL MDrv_MVD_IsAllBufferEmpty(MS_U32 u32Id);
859 MS_BOOL MDrv_MVD_GenPattern(MS_U32 u32Id, MVD_PatternType ePattern, MS_PHY u32PAddr, MS_U32* pu32Size);
860 MS_U32 MDrv_MVD_GetPatternInfo(void);
861 E_MVD_Result MDrv_MVD_SetDynScalingParam(MS_U32 u32Id, MS_PHY u32StAddr, MS_SIZE u32Size);
862 MS_BOOL MDrv_MVD_SetVirtualBox(MS_U32 u32Id, MS_U16 u16Width, MS_U16 u16Height);
863 MS_BOOL MDrv_MVD_SetBlueScreen(MS_U32 u32Id, MS_BOOL bEn);
864 MS_BOOL MDrv_MVD_FRC_OnlyShowTopField(MS_U32 u32Id, MS_BOOL bEnable);
865 MS_BOOL MDrv_MVD_EnableInt(MS_U32 u32Id, MS_U32 bEn);
866 E_MVD_Result MDrv_MVD_EnableDispOneField(MS_U32 u32Id, MS_BOOL bEn);
867 E_MVD_Result MDrv_MVD_GetExtDispInfo(MS_U32 u32Id, MVD_ExtDispInfo* pInfo);
868 E_MVD_Result MDrv_MVD_GetFrmInfo(MS_U32 u32Id, MVD_FrmInfoType eType, MVD_FrmInfo* pInfo);
869 E_MVD_Result MDrv_MVD_GetTimeCode(MS_U32 u32Id, MVD_FrmInfoType eType, MVD_TimeCode* pInfo);
870 MS_BOOL MDrv_MVD_GetUsrDataIsAvailable(MS_U32 u32Id);
871 MS_BOOL MDrv_MVD_GetUsrDataInfo(MS_U32 u32Id, MVD_UsrDataInfo* pUsrInfo);
872 E_MVD_Result MDrv_MVD_SetFreezeDisp(MS_U32 u32Id, MS_BOOL bEn);
873 MS_U32 MDrv_MVD_GetDispCount(MS_U32 u32Id);
874 E_MVD_Result MDrv_MVD_GetXcLowDelayIntState(MS_U32 u32Id);
875 E_MVD_Result MDrv_MVD_SetFdMaskDelayCount(MS_U32 u32Id, MS_U16 u16Cnt);
876 E_MVD_Result MDrv_MVD_SetOutputFRCMode(MS_U32 u32Id, MS_U8 u8FrameRate, MS_U8 u8Interlace);
877 E_MVD_Result MDrv_MVD_SetFRCDropType(MS_U32 u32Id, MS_U8 u8DropType);
878 E_MVD_Result MDrv_MVD_SetDisableSeqChange(MS_U32 u32Id, MS_BOOL bEnable);
879 
880 MS_BOOL MDrv_MVD_SetMStreamerMode(MS_U32 u32Id, MS_U8 u8Mode);
881 MS_BOOL MDrv_MVD_SetMcuMode(MS_U32 u32Id, MS_U8 u8Mode);
882 MS_BOOL MDrv_MVD_FrameFlip(MS_U32 u32Id, MS_U8 u8FrmIdx);
883 MS_BOOL MDrv_MVD_FrameRelease(MS_U32 u32Id, MS_U8 u8FrmIdx);
884 MS_BOOL MDrv_MVD_FrameCapture(MS_U32 u32Id, MS_U8 u8FrmIdx, MS_BOOL bEnable);
885 MS_BOOL MDrv_MVD_ReleaseFdMask(MS_U32 u32Id, MS_BOOL bRls);
886 MS_BOOL MDrv_MVD_ParserRstDone(MS_U32 u32Id, MS_BOOL bEnable);
887 MS_BOOL MDrv_MVD_SetVSizeAlign(MS_U32 u32Id, MS_BOOL bEnable);
888 E_MVD_Result MDrv_MVD_SetAutoMute(MS_U32 u32Id, MS_BOOL bEnable);
889 
890 MS_BOOL MDrv_MVD_SetSkipRepeatMode(MS_U32 u32Id, MS_U8 u8Mode);
891 MS_BOOL MDrv_MVD_SetSingleDecodeMode(MS_BOOL bEnable);
892 MS_BOOL MDrv_MVD_FlushPTSBuf(MS_U32 u32Id,MS_BOOL bEnable);
893 MS_BOOL MDrv_MVD_ShowDecodeOrder(MS_U32 u32Id, MS_U8 u8Mode);
894 E_MVD_Result MDrv_MVD_GetCrcValue(MS_U32 u32Id, MVD_CrcIn *pCrcIn, MVD_CrcOut *pCrcOut);
895 E_MVD_Result MDrv_MVD_SetDbgMode(MS_U32 u32Id, MVD_DbgMode enDbgMode, MS_BOOL bEn);
896 MS_BOOL MDrv_MVD_SuspendDynamicScale(MS_U32 u32Id, MS_BOOL bEnable);
897 MS_U8 MDrv_MVD_GetSuspendDynamicScale(MS_U32 u32Id);
898 MS_U8 MDrv_MVD_GetStereoType(MS_U32 u32Id);
899 void MDrv_MVD_DbgDump(MS_U32 u32Id);
900 MS_U32 MDrv_MVD_GetDivxVer(MS_U32 u32Id);
901 MS_BOOL MDrv_MVD_SetIdctMode(MS_U32 u32Id, MS_U8 u8Mode);
902 E_MVD_Result MDrv_MVD_Init_Share_Mem(void);
903 MS_BOOL MDrv_MVD_PreSetCodecType(MS_U32 u32Id,MVD_CodecType eMvdCodecType ,MS_BOOL *bHDMode);
904 E_MVD_Result MDrv_MVD_SetXCLowDelayPara(MS_U32 u32Id,MS_U32 u32Para);
905 MS_U8 MVD_GetHalIdx(MS_U32 u32Id);
906 MS_U32 MVD_GetStreamId(MS_U8 u8Idx);
907 void MDrv_MVD_Drop_One_PTS(MS_U32 u32Id);
908 MS_BOOL MDrv_MVD_DisableEsFullStop(MS_U32 u32Id, MS_BOOL bDisable);
909 #define MVD_ENABLE_ISR
910 
911 #ifdef MVD_ENABLE_ISR
912 E_MVD_Result MDrv_MVD_SetIsrEvent(MS_U32 u32Id, MS_U32 eEvent, MVD_InterruptCb fnHandler);
913 MS_U32 MDrv_MVD_GetIsrEvent(MS_U32 u32Id);
914 #else
915 #define MDrv_MVD_SetIsrEvent(x, y, z) (E_MVD_RET_OK)
916 #define MDrv_MVD_GetIsrEvent(x)     (MS_U32)0
917 #endif
918 MS_U32 MDrv_MVD_GetSLQNum(MS_U32 u32Id);
919 MS_U32 MDrv_MVD_GetDispQNum(MS_U32 u32Id);
920 
921 E_MVD_Result MDrv_MVD_EX_SetMVDClockSpeed(MVD_EX_ClockSpeed eClockSpeed);
922 MS_BOOL MDrv_MVD_ShowFirstFrameDirect(MS_U32 u32Id,MS_BOOL bEnable);
923 E_MVD_Result MDrv_MVD_SetSelfSeqChange(MS_U32 u32Id, MS_BOOL bEnable);
924 MS_U8 MDrv_MVD_GetESBufferStatus(MS_U32 u32Id);
925 E_MVD_Result MDrv_MVD_SetExternalDSBuffer(MS_U32 u32Id, MVD_EX_ExternalDSBuf *pExternalBuf);
926 MS_BOOL MDrv_MVD_Field_Polarity_Display_One_field(MS_U32 u32Id, MS_BOOL bEnable,MS_U8 top_bottom);
927 
928 MS_BOOL MDrv_MVD_SetShareMemoryBase(MS_U32 u32Id, MS_VIRT u32base);
929 MS_U32 MDrv_MVD_GetShareMemoryOffset(MS_U32 u32Id, MS_VIRT *u32base);
930 MS_BOOL MDrv_MVD_EnableVPUSecurityMode(MS_BOOL enable);
931 MS_BOOL MDrv_MVD_GetSupport2ndMVOPInterface(void);
932 MS_BOOL MDrv_MVD_REE_RegisterMBX(void);
933 MS_BOOL MDrv_MVD_REE_SetSHMBaseAddr(MS_U32 U32Type,MS_PHY u32SHMAddr,MS_PHY u32SHMSize,MS_PHY u32MIU1Addr);
934 MS_BOOL MDrv_MVD_GetPVRSeamlessInfo(MS_U8 u8Idx,void* param);
935 
936 MS_BOOL MDrv_MVD_SetExternal_CC608_Buffer(MS_U32 u32Id, MS_VIRT u32base,MS_U8 u8size);
937 MS_BOOL MDrv_MVD_SetExternal_CC708_Buffer(MS_U32 u32Id, MS_VIRT u32base,MS_U8 u8size);
938 MS_BOOL MDrv_MVD_SetPrebufferSize(MS_U32 u32Id, MS_U32 size);
939 E_MVD_Result MDrv_MVD_HWBuffer_ReMappingMode(MS_U32 u32Id,MS_BOOL bEnable);
940 void MDrv_MVD_REE_GetSHMInformation(MS_VIRT* u32SHMAddr,MS_VIRT* u32VsyncSHMOffset);
941 E_MVD_Result MDrv_MVD_REE_GetVsyncExtShm(MS_VIRT* u32SHMAddr, MS_VIRT* u32VsyncExtShmOffset);
942 E_MVD_Result MDrv_MVD_SetTimeIncPredictParam(MS_U32 u32Id,MS_U32 u32Para);
943 MS_BOOL MDrv_MVD_SetDcodeTimeoutParam(MS_U32 u32Id,MS_BOOL enable,MS_U32 u32timeout);
944 MS_BOOL MDrv_MVD_SetFramebufferAutoMode(MS_U32 u32Id,MS_BOOL bEnable);
945 E_MVD_Result MDrv_MVD_Set_Smooth_Rewind(MS_U32 u32Id, MS_U8 bEnable);
946 E_MVD_Result MDrv_MVD_IsAlive(MS_U32 u32Id);
947 E_MVD_Result MDrv_MVD_Set_Err_Tolerance(MS_U32 u32Id, MS_U16 u16Para);
948 void MVD_RecordStreamId(MS_U32 u32Id);
949 void MDrv_MVD_EnableAutoInsertDummyPattern(MS_U32 u32Id, MS_BOOL bEnable);
950 E_MVD_Result MDrv_MVD_PVR_Seamless_mode(MS_U32 u32Id, MS_U8 u8Arg);
951 E_MVD_Result MDrv_MVD_SetDispFinishMode(MS_U32 u32Id,MS_U8 u8Mode);
952 MS_BOOL MDrv_MVD_Set_MBX_param(MS_U8 u8APIMbxMsgClass);
953 void MDrv_MVD_SetDmxFrameRate(MS_U32 u32Id,MS_U32 u32Value);
954 void MDrv_MVD_SetDmxFrameRateBase(MS_U32 u32Id,MS_U32 u32Value);
955 void MDrv_MVD_TrickPlay2xAVSync(MS_U32 u32Id,MS_BOOL bEnable);
956 void MDrv_MVD_Dynamic_FB_Mode(MS_U32 u32Id,MS_BOOL bEnable,MS_PHY u32Address,MS_U32 u32Size);
957 void MDrv_MVD_SetCMAInformation(void* cmaInitParam);
958 E_MVD_Result MDrv_MVD_EnablePTSDetector(MS_U32 u32Id, MS_BOOL bEn);
959 E_MVD_Result MDrv_MVD_DisablePBFrameMode(MS_U32 u32Id, MS_BOOL bEn);
960 MS_BOOL MDrv_MVD_ReleaseFreeStream(MS_U32 u32Id);
961 MS_U8   MDrv_MVD_CheckFreeStream(void);
962 MS_BOOL MDrv_MVD_GetColorInfo(MS_U32 u32Id, MVD_Color_Info* pstColorInfo);
963 E_MVD_Result MDrv_MVD_Set_SlowSyncParam(MS_U32 u32Id, MS_U8 u8RepeatPeriod,MS_U8 u8DropPeriod);
964 MS_BOOL MDrv_MVD_VariableFrameRate(MS_U32 u32Id);
965 MS_BOOL MDrv_MVD_EX_IsDispQueueEmpty(MS_U32 u32Id);
966 MS_U32 MDrv_MVD_EX_GetMinTspDataSize(MS_U32 u32Id);
967 
968 #endif
969 
970 #ifdef __cplusplus
971 }
972 #endif
973 
974 #endif
975