xref: /utopia/UTPA2-700.0.x/modules/audio/api/audio/apiAUDIO_v2_customer_utopia.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) 2013-2015 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 name:   apiAUDIO_v2_customer_utopia.h
98 //  Description: apiAUDIO_v2_customer_utopia.h
99 //
100 ////////////////////////////////////////////////////////////////////////////////////////////////////
101 #ifdef ROLLS_ROYCE
102 
103 #ifndef _AUDIO_V2_CUSTOMER_H_
104 #define _AUDIO_V2_CUSTOMER_H_
105 
106 #include "MsTypes.h"
107 #include "drvAUDIO_if.h"
108 #include "apiAUDIO_v2_customer_config.h"
109 
110 #ifdef __cplusplus
111 extern "C"
112 {
113 #endif
114 
115 
116 //-------------------------------------------------------------------------------------------------
117 //  Enum / Struct
118 //-------------------------------------------------------------------------------------------------
119 ///< Select AD output type
120 enum
121 {
122     AD_OUT_SPEAKER, ///< AD out in speaker only
123     AD_OUT_HP,      ///< AD out in HP only
124     AD_OUT_BOTH,    ///< AD out both in speaker & HP
125     AD_OUT_NONE     ///< no AD out
126 };
127 
128 ///< Audio source switch group
129 typedef enum
130 {
131     E_AUDIO_GROUP_MAIN,     ///< Main speaker, HP, Line-out , S/PDIF PCM mode
132     E_AUDIO_GROUP_SCART,    ///< SCART
133     E_AUDIO_GROUP_SPDIF,    ///< SPDIF non-pcm
134     E_AUDIO_GROUP_SUB,      ///< SUB source for PIP application
135     E_AUDIO_GROUP_INVALID
136 } AUDIO_SWITCH_GROUP;
137 
138 ///< Decoder command type
139 typedef enum
140 {
141     MSAPI_AUD_DVB_DECCMD_STOP = 0x0,        ///< 1st DSP stop
142     MSAPI_AUD_DVB_DECCMD_PLAY,              ///< 1st DSP play
143     MSAPI_AUD_DVB_DECCMD_RESYNC,
144     MSAPI_AUD_DVB_DECCMD_FREE_RUN,
145     MSAPI_AUD_DVB_DECCMD_AVSYNC,
146     MSAPI_AUD_DVB_DECCMD_PLAYFILE,          ///< 1st DSP play file
147     MSAPI_AUD_DVB_DECCMD_PAUSE,             ///< 1st DSP pause
148     MSAPI_AUD_DVB_DECCMD_PLAYFILETSP,       ///< 1st DSP play TS file
149     MSAPI_AUD_DVB_DECCMD_STARTBROWSE,
150     MSAPI_AUD_DVB_DECCMD_PLAYFRAME,         ///<1st DSP play MM (for uniplayer/Mstreamer)
151     MSAPI_AUD_DVB_DECCMD_PLAYFRAME_STAGE,   ///<1st DSP play MM (for stagecraft)
152     MSAPI_AUD_DVB_DECCMD_PLAYFRAME_GS,      ///<1st DSP play MM (for uniplayer/Gstreamer ES copy)
153     MSAPI_AUD_DVB_DECCMD_PLAYMM_FILE2,
154     MSAPI_AUD_DVB_DECCMD_PLAY_AD,
155     MSAPI_AUD_DVB_DECCMD_STOP_AD,
156     // SE DSP
157     MSAPI_AUD_DVB2_DECCMD_STOP=0x10,        ///< 2nd DSP stop
158     MSAPI_AUD_DVB2_DECCMD_PLAY,             ///< 2nd DSP play
159     MSAPI_AUD_DVB2_DECCMD_RESYNC,
160     MSAPI_AUD_DVB2_DECCMD_FREE_RUN,
161     MSAPI_AUD_DVB2_DECCMD_AVSYNC,
162     MSAPI_AUD_DVB2_DECCMD_PLAYFILE,         ///< 2nd DSP play file
163     MSAPI_AUD_DVB2_DECCMD_PAUSE,            ///< 2nd DSP pause
164     MSAPI_AUD_DVB2_DECCMD_PLAYFILETSP       ///< 2nd DSP play TS file
165 
166 } En_DVB_decCmdType;
167 
168 ///< ATV SIF Command
169 typedef enum
170 {
171     MSAPI_AUD_SIF_CMD_SET_STOP                  = 0x00,
172     MSAPI_AUD_SIF_CMD_SET_PLAY                  = 0x01,
173     MSAPI_AUD_SIF_CMD_ENABLE_HIDEV              = 0x02,
174     MSAPI_AUD_SIF_CMD_SET_HIDEV_FILTER_BW_LEVEL = 0x03,
175     MSAPI_AUD_SIF_CMD_RESET_FC_TRACKING         = 0x04,
176     MSAPI_AUD_SIF_CMD_ENABLE_FC_TRACKING        = 0x05,
177     MSAPI_AUD_SIF_CMD_SET_ADC_FROM_VIF_PATH     = 0x06,
178     MSAPI_AUD_SIF_CMD_ENABLE_AUTO_MUTE          = 0x07,
179     MSAPI_AUD_SIF_CMD_ENABLE_BEEPER_FUNCTION    = 0x08,
180     MSAPI_AUD_SIF_CMD_SET_BEEPER_TONE           = 0x09,
181     MSAPI_AUD_SIF_CMD_ENABLE_AGC                = 0x0A,
182     MSAPI_AUD_SIF_CMD_RESET_AGC                 = 0x0B,
183     MSAPI_AUD_SIF_STANDARD_RESET                = 0x0C,
184     MSAPI_AUD_SIF_CMD_DETECT_MAIN_STD_ONLY      = 0x0D,
185     MSAPI_AUD_SIF_CMD_ENABLE_AUTO_SOUNDMODE     = 0x0E,
186     MSAPI_AUD_SIF_CMD_FMTX_SET_PREEMP           = 0x0F,
187     MSAPI_AUD_SIF_CMD_SET_ENC_CMD               = 0x10,
188     MSAPI_AUD_SIF_CMD_SET_ENC_Input_attenuation = 0x11,
189     MSAPI_AUD_SIF_CMD_SET_ENC_Output_scaling    = 0x12,
190     MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_M_Gain       = 0x13,
191     MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_D_Gain       = 0x14,
192     MSAPI_AUD_SIF_CMD_SET_BTSC_Enc_SAP_Gain     = 0x15,
193 
194     MSAPI_AUD_SIF_CMD2_ADC_VIA_VIF_PIN          = 0x01
195 } En_AUD_SIF_CmdType;
196 
197 ///< Audio SIF Standard Type
198 typedef enum
199 {
200     E_AUDIOSTANDARD_BG          = 0x00,         ///< Audio standard BG
201     E_AUDIOSTANDARD_BG_A2       = 0x01,         ///< Audio standard BG A2
202     E_AUDIOSTANDARD_BG_NICAM    = 0x02,         ///< Audio standard BG NICAM
203     E_AUDIOSTANDARD_I           = 0x03,         ///< Audio standard I
204     E_AUDIOSTANDARD_DK          = 0x04,         ///< Audio standard DK
205     E_AUDIOSTANDARD_DK1_A2      = 0x05,         ///< Audio standard DK1 A2
206     E_AUDIOSTANDARD_DK2_A2      = 0x06,         ///< Audio standard DK2 A2
207     E_AUDIOSTANDARD_DK3_A2      = 0x07,         ///< Audio standard DK3 A2
208     E_AUDIOSTANDARD_DK_NICAM    = 0x08,         ///< Audio standard DK NICAM
209     E_AUDIOSTANDARD_L           = 0x09,         ///< Audio standard L
210     E_AUDIOSTANDARD_M           = 0x0A,         ///< Audio standard M
211     E_AUDIOSTANDARD_M_BTSC      = 0x0B,         ///< Audio standard M BTSC
212     E_AUDIOSTANDARD_M_A2        = 0x0C,         ///< Audio standard M A2
213     E_AUDIOSTANDARD_M_EIA_J     = 0x0D,         ///< Audio standard M EIA J
214     E_AUDIOSTANDARD_NOTSTANDARD = 0x0F          ///< Not Audio standard
215 } AUDIOSTANDARD_TYPE;
216 
217 ///< sif carrier status define
218 typedef enum
219 {
220     // Never change the value of enumeration. Because each bit has weight.
221     E_STATE_AUDIO_NO_CARRIER           = 0x00, ///< No carrier detect
222     E_STATE_AUDIO_PRIMARY_CARRIER      = 0x01, ///< Carrier 1 exist
223     E_STATE_AUDIO_SECONDARY_CARRIER    = 0x02, ///< Carrier 2 exist
224     E_STATE_AUDIO_NICAM                = 0x04, ///< Nicam lock state
225     E_STATE_AUDIO_STEREO               = 0x08, ///< A2 Stereo exist
226     E_STATE_AUDIO_BILINGUAL            = 0x10, ///< A2 Dual exist
227     E_STATE_AUDIO_PILOT                = 0x20, ///< A2 Pilot exist
228     E_STATE_AUDIO_DK2                  = 0x40, ///< Sound standard is DK2
229     E_STATE_AUDIO_DK3                  = 0x80  ///< Sound standard is DK3
230 } AUDIOSTATUS;
231 
232 ///< Audio mode type
233 typedef enum
234 {
235     E_AUDIOMODE_INVALID       = 0x00,  ///< Audio Mode Invalid
236     E_AUDIOMODE_MONO          = 0x01,  ///< Audio Mode MONO
237     E_AUDIOMODE_FORCED_MONO   = 0x02,  ///< Audio Mode Forced MONO
238     E_AUDIOMODE_G_STEREO      = 0x03,  ///< Audio Mode G Stereo
239     E_AUDIOMODE_K_STEREO      = 0x04,  ///< Audio Mode  K Stereo
240     E_AUDIOMODE_MONO_SAP      = 0x05,  ///< Audio Mode MONO SAP
241     E_AUDIOMODE_STEREO_SAP    = 0x06,  ///< Audio Mode Stereo SAP
242     E_AUDIOMODE_DUAL_A        = 0x07,  ///< Audio Mode Dual A
243     E_AUDIOMODE_DUAL_B        = 0x08,  ///< Audio Mode Dual B
244     E_AUDIOMODE_DUAL_AB       = 0x09,  ///< Audio Mode Dual AB
245     E_AUDIOMODE_NICAM_MONO    = 0x0A,  ///< Audio Mode NICAM MONO
246     E_AUDIOMODE_NICAM_STEREO  = 0x0B,  ///< Audio Mode NICAM Stereo
247     E_AUDIOMODE_NICAM_DUAL_A  = 0x0C,  ///< Audio Mode NICAM DUAL A
248     E_AUDIOMODE_NICAM_DUAL_B  = 0x0D,  ///< Audio Mode NICAM DUAL B
249     E_AUDIOMODE_NICAM_DUAL_AB = 0x0E,  ///< Audio Mode NICAM DUAL AB
250     E_AUDIOMODE_HIDEV_MONO    = 0x0F,  ///< Audio Mode HIDEV MONO
251     E_AUDIOMODE_LEFT_LEFT     = 0x10,  ///< Audio Mode Left left
252     E_AUDIOMODE_RIGHT_RIGHT   = 0x11,  ///< Audio Mode right right
253     E_AUDIOMODE_LEFT_RIGHT    = 0x12   ///< Audio Mode left right
254 } AUDIOMODE_TYPE;
255 
256 
257 typedef enum
258 {
259     HDMITX_AUDIO_FREQ_NO_SIG  = 0,
260     HDMITX_AUDIO_32K          = 1,
261     HDMITX_AUDIO_44K          = 2,
262     HDMITX_AUDIO_48K          = 3,
263     HDMITX_AUDIO_88K          = 4,
264     HDMITX_AUDIO_96K          = 5,
265     HDMITX_AUDIO_176K         = 6,
266     HDMITX_AUDIO_192K         = 7,
267     HDMITX_AUDIO_FREQ_MAX_NUM = 8,
268 } HDMITX_AUDIO_FREQUENCY;
269 
270 typedef enum
271 {
272     HDMITX_AUDIO_PCM        = 0, // PCM
273     HDMITX_AUDIO_NONPCM     = 1, // non-PCM
274 } HDMITX_AUDIO_CODING_TYPE;
275 
276 typedef enum
277 {
278     HDMITX_AUDIO_CH_2  = 2, // 2 channels
279     HDMITX_AUDIO_CH_8  = 8, // 8 channels
280 } HDMITX_AUDIO_CHANNEL_COUNT;
281 
282 typedef enum
283 {
284     HDMITX_AUDIO_FORMAT_PCM   = 0,
285     HDMITX_AUDIO_FORMAT_DSD   = 1,
286     HDMITX_AUDIO_FORMAT_HBR   = 2,
287     HDMITX_AUDIO_FORMAT_NA    = 3,
288 } HDMITX_AUDIO_SOURCE_FORMAT;
289 
290 typedef enum
291 {
292     E_HDCP_DISABLE  = 0, // HDCP disable
293     E_HDCP_FAIL     = 1, // HDCP fail
294     E_HDCP_PASS     = 2, // HDCP pass
295 } HDMITX_HDCP_STATUS;
296 
297 //need to be consistent with VDEC_EX_Result of apiVDEC_EX.h
298 //function return enumerator
299 typedef enum
300 {
301     ///failed
302     E_VDEC_EX_FAIL = 0,
303     ///success
304     E_VDEC_EX_OK,
305     ///invalid parameter
306     E_VDEC_EX_RET_INVALID_PARAM,
307     ///access not allow
308     E_VDEC_EX_RET_ILLEGAL_ACCESS,
309     ///hardware abnormal
310     E_VDEC_EX_RET_HARDWARE_BREAKDOWN,
311      ///unsupported
312     E_VDEC_EX_RET_UNSUPPORTED,
313      ///timeout
314     E_VDEC_EX_RET_TIMEOUT,
315     ///not ready
316     E_VDEC_EX_RET_NOT_READY,
317     ///not initial
318     E_VDEC_EX_RET_NOT_INIT,
319     ///not exit after last initialization
320     E_VDEC_EX_RET_NOT_EXIT,
321     ///not running, counter does not change
322     E_VDEC_EX_RET_NOT_RUNNING,
323     ///max value
324     E_VDEC_EX_RET_NUM,
325 } VDEC_EX_Result;
326 
327 //need to be consistent with VDEC_StreamId of apiVDEC_EX.h
328 typedef struct
329 {
330     MS_U32 u32Version;
331     MS_U32 u32Id;
332 } VDEC_StreamId;
333 
334 //need to be consistent with VDEC_EX_User_Cmd of apiVDEC_EX.h
335 //VDEC user command id
336 typedef enum
337 {
338     //Group1:Set Control command================================
339     E_VDEC_EX_USER_CMD_SET_CONTROL_BASE  = 0x0000,
340     E_VDEC_EX_USER_CMD_REPEAT_LAST_FIELD,                       // Param: 1(ON), 0(OFF)
341     E_VDEC_EX_USER_CMD_AVSYNC_REPEAT_TH,                        // Param:0x01 ~ 0xFF(repeat times), 0xFF:always repeat when av is not sync
342     E_VDEC_EX_USER_CMD_DISP_ONE_FIELD,                          // Param: 1(ON), 0(OFF)
343     E_VDEC_EX_USER_CMD_FD_MASK_DELAY_COUNT,                     // Param: unit is in vsync base for mute the fd_mask
344     E_VDEC_EX_USER_CMD_FRC_OUTPUT,                              // Param: the address of VDEC_FRC_OutputParam
345     E_VDEC_EX_USER_CMD_FRC_DROP_TYPE,                           // Param: 1(FRC_DROP_FIELD), 0(FRC_DROP_FRAME), default:0
346     E_VDEC_EX_USER_CMD_FAST_DISPLAY,                            // Param: TRUE(Fast display), FALSE(Display until synced)
347     E_VDEC_EX_USER_CMD_IGNORE_ERR_REF,                          // Param: TRUE(Ignore error reference), FALSE(Enable error reference handle)
348     E_VDEC_EX_USER_CMD_FORCE_FOLLOW_DTV_SPEC,                   // Param: 1(ON), 0(OFF)
349     E_VDEC_EX_USER_CMD_AVC_MIN_FRM_GAP,                         // Param: Set the theshold of H264 frame gap, 0xFFFFFFFF don't care frame gap
350     E_VDEC_EX_USER_CMD_DISABLE_SEQ_CHG,                         // Param: 1(Disable), 0(Enable)
351     E_VDEC_EX_USER_CMD_SET_DISP_OUTSIDE_CTRL_MODE,              // Param: 1(ON) used for Openmax, 0(OFF) used for mstreamer and mm mode ,default : off
352     E_VDEC_EX_USER_CMD_SET_DTV_USER_DATA_MODE,                  // Param: 0(Support normal DVB CC, default case), 1(Support ATSC DirectTV CC), 2,3,4(Reserved)
353     E_VDEC_EX_USER_CMD_SET_SINGLE_TASK_MODE,
354     E_VDEC_EX_USER_CMD_AVC_DISABLE_ANTI_VDEAD,
355     E_VDEC_EX_USER_CMD_DTV_RESET_MVD_PARSER,                    // Param: 0(Disable), 1(Enable)
356     E_VDEC_EX_USER_CMD_PVR_FLUSH_FRAME_BUFFER,
357     E_VDEC_EX_USER_CMD_FORCE_INTERLACE_MODE,
358     E_VDEC_EX_USER_CMD_RELEASE_FD_MASK,                         // Param: 1 to release fd mask when zooming or slow motion
359     E_VDEC_EX_USER_CMD_SET_DECODE_MODE,
360     E_VDEC_EX_USER_CMD_SUPPORT_AVC_TO_MVC,                      // Param: 0(Do not support), 1(Support AVC to MVC)
361     E_VDEC_EX_USER_CMD_3DLR_VIEW_EXCHANGE,                      // Param: 0(Disable), 1(View L/R exhange)
362     E_VDEC_EX_USER_CMD_SET_VSIZE_ALIGN,                         // Param: 0(Disable), 1(Enable)
363     E_VDEC_EX_USER_CMD_SHOW_DECODE_ORDER,                       // Param: 0(Disable), 1(Enable)
364     E_VDEC_EX_USER_CMD_AVC_DISP_IGNORE_CROP,                    // Param: 0(Disable), 1(Enable)
365     E_VDEC_EX_USER_CMD_SET_DISP_FINISH_MODE,
366     E_VDEC_EX_USER_CMD_SET_AVSYNC_MODE,
367     E_VDEC_EX_USER_CMD_SUSPEND_DYNAMIC_SCALE,                   // Param: 0(Disable, non-suspend DS), 1(Enable, suspend DS)
368     E_VDEC_EX_USER_CMD_FORCE_AUTO_MUTE,
369     E_VDEC_EX_USER_CMD_AVC_NEW_SLOW_MOTION,                     // Param: 0(Disable), 1(Enable)
370     E_VDEC_EX_USER_CMD_PUSH_DISPQ_WITH_REF_NUM,                 // Param: 0(Disable), 1(Enable)
371     E_VDEC_EX_USER_CMD_DS_RESV_N_BUFFER,                        // Param: 0(Disable), 1(Enable)
372     E_VDEC_EX_USER_CMD_RM_ENABLE_PTS_TBL,                       // Param: 0(Disable), 1(Enable)
373     E_VDEC_EX_USER_CMD_FLUSH_PTS_BUF,
374     E_VDEC_EX_USER_CMD_SET_IDCT_MODE,                           // Param: 0(Original), 1(new IDCT)
375     E_VDEC_EX_USER_CMD_DROP_ERR_FRAME,                          // Param: 0(Disable), 1(Enable)
376     E_VDEC_EX_USER_CMD_SET_CC608_INFO_ENHANCE_MODE,
377     E_VDEC_EX_USER_CMD_IGNORE_PIC_OVERRUN,                      // Param: 0(Disable), 1(Enable)
378     E_VDEC_EX_USER_CMD_SET_SELF_SEQCHANGE,
379     E_VDEC_EX_USER_CMD_AUTO_EXHAUST_ES_MODE,                    // Param: set the upper bound (arg[31:16]), and lower bound (arg[15:0])of ES level, Unit = 1KBytes, Auto drop display to consume ES data as soon as possible when ES level is higher than upper bound
380     E_VDEC_EX_USER_CMD_CTL_SPEED_IN_DISP_ONLY,                  // Param: 0(Original: Dec and disp time), 1(In Disp only)
381     E_VDEC_EX_USER_CMD_AVC_SUPPORT_REF_NUM_OVER_MAX_DPB_SIZE,   // Param: 0(Disable), 1(Enable)
382     E_VDEC_EX_USER_CMD_RETURN_INVALID_AFD,                      // Param: 0(Disable), 1(Enable)
383     E_VDEC_EX_USER_CMD_FIELD_POLARITY_DISPLAY_ONE_FIELD,        // Param : VDEC_EX_Field_Polarity
384     E_VDEC_EX_USER_CMD_AVC_FORCE_BROKEN_BY_US,                  // Param: 0(Disable), 1(Enable)
385     E_VDEC_EX_USER_CMD_SHOW_FIRST_FRAME_DIRECT,                 // Param: 0(Disable), 1(Enable), Push first frame to display queue directly..
386     E_VDEC_EX_USER_CMD_AVC_RESIZE_DOS_DISP_PEND_BUF,            // Param:  size of AVC display pending buffer for display outside mode
387     E_VDEC_EX_USER_CMD_SET_XC_LOW_DELAY_PARA,                   // Param: arg0 for diff_field_number...
388     E_VDEC_EX_USER_CMD_SET_SECURE_MODE,                         // Param: use enum VDEC_EX_SecureMode
389     E_VDEC_EX_USER_CMD_RVU_SETTING_MODE,                        // Param: 0(Disable), 1(drop B-frame and force IDR)
390     E_VDEC_EX_USER_CMD_FRAMERATE_HANDLING,                      // Arg 0~60000, 0: Disable, 1000 ~ 60000: Used the arg to set frame rate when the sequence did not have frame rate info. and arg is not zero. (The frame unit is (arg/1000)fps, Exp: 30000 = 30.000 fps), others: Do not thing.
391     E_VDEC_EX_USER_CMD_DUAL_NON_BLOCK_MODE,                     // Param: 0(Disable), 1(Enable)
392     E_VDEC_EX_USER_CMD_IGNORE_PIC_STRUCT_DISPLAY,               // Param: 0(Disable), 1(Enable) Ignore Pic_struct when display progressive frame.
393     E_VDEC_EX_USER_CMD_INPUT_PTS_FREERUN_MODE,                  // Param: 0(Disable), 1(Enable) Video free run when the difference between input PTS and current STC is large than E_HVD_CMD_FREERUN_THRESHOLD + 1s;
394     E_VDEC_EX_USER_CMD_ERR_CONCEAL_SLICE_1ST_MB,                // Param: 0(disable), Error concealment from current/last MB position; 1(enale) Error concealment from current slice first MB.(Need enable E_HVD_CMD_ERR_CONCEAL)
395     E_VDEC_EX_USER_CMD_SET_EXTERNAL_DS_BUFFER,                  // Param: External DS Buffer info.
396     E_VDEC_EX_USER_CMD_SET_MIN_TSP_DATA_SIZE,                   // Param: Resize HVD_FW_AVC_ES_MIN_TSP_DATA_SIZE
397     E_VDEC_EX_USER_CMD_SET_DMX_FRAMERATE,
398     E_VDEC_EX_USER_CMD_SET_DMX_FRAMERATEBASE,
399     E_VDEC_EX_USER_CMD_ENABLE_CC_608_EXTERNAL_BUFFER,           // Param: u32_ccinfo 32bits-->([31:8]+[7:0] = addr+size), addr is kb unit, if u32_ccinfo ==0, it will turn off this feature
400     E_VDEC_EX_USER_CMD_ENABLE_CC_708_EXTERNAL_BUFFER,           // Param: u32_ccinfo 32bits-->([31:8]+[7:0] = addr+size), addr is kb unit, if u32_ccinfo ==0, it will turn off this feature
401     E_VDEC_EX_USER_CMD_SET_TIME_INC_PREDICT_PARA,
402     E_VDEC_EX_USER_CMD_ENABLE_DECODE_ENGINE_TIMEOUT,            // Param: Enable/Disable decode timeout solution, timeout value unit:ms (VDEC_EX_Decode_Timeout_Param)
403     E_VDEC_EX_USER_CMD_AUTO_FREE_ES,                            // Param: 0(Disable), 1(Enable)
404     E_VDEC_EX_USER_CMD_FRAMEBUFFER_AUTO_MODE,                   // Param: 0(Disable),1(Enable), this cmd is used for MVD.
405     E_VDEC_EX_USER_CMD_SET_SMOOTH_REWIND,                       // enable/disable or support smooth rewind
406     E_VDEC_EX_USER_CMD_SET_ERROR_TOLERANCE,
407     E_VDEC_EX_USER_CMD_AUTO_DROP_DISPLAY_QUEUE,                 // Param: 0(Disable), N = 1~16: Drop display queue when display queue above than N frames.
408     E_VDEC_EX_USER_CMD_USE_CPB_REMOVAL_DEALY,                   // Param: 0(Disable), 1(Enable)
409     E_VDEC_EX_USER_CMD_SKIP_N_FRAME,                            // Param: 0:disable, N = 1~63. Skip N frame.
410     E_VDEC_EX_USER_CMD_SET_PTS_US_MODE,                         // Param: 1(enable), 0(disable ) PTS output by micro second level,
411     E_VDEC_EX_USER_CMD_AUTO_INSERT_DUMMY_DATA,                  // Param: 1(enable),0(disable), Enable/Disable utopia auto insert dummy pattern in SLQ/BBU mode.
412     E_VDEC_EX_USER_CMD_DROP_ONE_PTS,
413     E_VDEC_EX_USER_CMD_PVR_TIMESHIFT_SEAMLESS_MODE,
414     E_VDEC_EX_USER_CMD_AUTO_REDUCE_ES_DATA,
415     E_VDEC_EX_USER_CMD_RM_FORCE_MCU_MODE_ES,                    // Param: 0(Disable), 1(Enable)
416     E_VDEC_EX_USER_CMD_FORCE_PROGRESSIVE_MODE,                  // Param: 1(enable),0(disable), Enable/Disable force progressive mode
417     E_VDEC_EX_USER_CMD_SET_FRAMEBUFF2,                          // Param[0]=Addr and Param[1]=size for the second frame buffer
418     E_VDEC_EX_USER_CMD_ENABLE_PTS_DECTECTOR,                    // Param: 1(ON), 0(OFF)
419     E_VDEC_EX_USER_CMD_SET_AVSYNC_DISP_AUTO_DROP,
420     E_VDEC_EX_USER_CMD_SET_DYNAMIC_DISP_PATH,
421 
422     E_VDEC_EX_USER_CMD_MVC_SET_CMD_BASE  = 0x0800,
423     E_VDEC_EX_USER_CMD_MVC_BBU2_PUSH_PACKET,                    // Param: Packet Info.
424     E_VDEC_EX_USER_CMD_MVC_BBU2_FIRE_DECCMD,                    // Param: Non
425 
426     E_VDEC_EX_USER_CMD_UT_SET_CMD_BASE = 0x0900,
427     E_VDEC_EX_USER_CMD_UT_SET_DBG_MODE,                         // Param: for enable the specify dbg mode for UT
428     E_VDEC_EX_USER_CMD_UT_CLR_DBG_MODE,                         // Param: for disable the specify dbg mode for UT
429 
430     //Group2:Get Control command================================
431     E_VDEC_EX_USER_CMD_GET_CONTROL_BASE  = 0x1000,
432     E_VDEC_EX_USER_CMD_GET_CHROMA_TYPE,
433     E_VDEC_EX_USER_CMD_GET_REAL_FRAMERATE,                      // Get Real FrameRate reported by decoder
434     E_VDEC_EX_USER_CMD_GET_COLOR_MATRIX,                        // Get color matrix coefficients reported by decoder
435     E_VDEC_EX_USER_CMD_GET_MAIN_STREAM_ID,                      // Get activated main stream ID
436     E_VDEC_EX_USER_CMD_GET_SUB_STREAM_ID,                       // Get activated sub stream ID
437     E_VDEC_EX_USER_CMD_GET_DYNSCALE_ENABLED,
438     E_VDEC_EX_USER_CMD_GET_FPA_SEI,                             //Get SEI info
439     E_VDEC_EX_USER_CMD_GET_U64PTS,
440     E_VDEC_EX_USER_CMD_GET_ORI_INTERLACE_MODE,
441     E_VDEC_EX_USER_CMD_GET_MBS_ONLY_FLAG,
442     E_VDEC_EX_USER_CMD_GET_CRC_VALUE,                           //Get frame Y/UV crc value
443     E_VDEC_EX_USER_CMD_GET_BBU_Q_NUM,
444     E_VDEC_EX_USER_CMD_GET_DISP_FRAME_NUM,
445     E_VDEC_EX_USER_CMD_GET_FPA_SEI_EX,                          //Get SEI info(enhancement)
446     E_VDEC_EX_USER_CMD_GET_ES_BUFFER_STATUS,                    //Get ES buffer over/under flow status
447     E_VDEC_EX_USER_CMD_GET_CODEC_TYPE,                          // Get Codec type
448     E_VDEC_EX_USER_CMD_GET_SHAREMEMORY_BASE,
449     E_VDEC_EX_USER_CMD_GET_IS_LEAST_DISPQ_SIZE_FLAG,
450     E_VDEC_EX_USER_CMD_GET_FIELD_PIC_FLAG,                      // Param: Get Field Pic Flag
451     E_VDEC_EX_USER_CMD_GET_SUPPORT_2ND_MVOP_INTERFACE,          // Param: TRUE : support, FALSE : not support
452     E_VDEC_EX_USER_CMD_GET_FB_USAGE_MEM,                        // Get FrameBuufer Size needed by decoder
453     E_VDEC_EX_USER_CMD_GET_XC_LOW_DELAY_INT_STATE,              // Get xc_low_delay int state...
454     E_VDEC_EX_USER_CMD_GET_VSYNC_BRIDGE_ADDR,
455     E_VDEC_EX_USER_CMD_GET_FRAME_INFO_EX,
456     E_VDEC_EX_USER_CMD_GET_FLUSH_PATTEN_ENTRY_NUM,
457     E_VDEC_EX_USER_CMD_GET_DS_BUF_MIU_SEL,                      //For those chips which has 3 MIU, use this get control to get correct miu select of DS buffer
458     E_VDEC_EX_USER_CMD_GET_FW_STATUS_FLAG,
459     E_VDEC_EX_USER_CMD_GET_HW_MAX_PIXEL,
460     E_VDEC_EX_USER_CMD_GET_FLOW_CONTROL_U64PTS_DIFF,            //based on PTS table Rdptr and Wrptr, support TSP mode only
461     E_VDEC_EX_USER_CMD_GET_NEXT_DISP_FRAME_INFO_EXT,            //replace of E_VDEC_EX_USER_CMD_GET_FRAME_INFO_EX
462     E_VDEC_EX_USER_CMD_GET_VSYNC_BRIDGE_EXT_ADDR,               //get vsync bridge ext addr
463     E_VDEC_EX_USER_CMD_GET_DCV_SEI,
464     E_VDEC_EX_USER_CMD_GET_VUI_DISP_INFO,
465     E_VDEC_EX_USER_CMD_GET_CODEC_CAP,
466     E_VDEC_EX_USER_CMD_GET_PRE_PAS_U64PTS,
467     E_VDEC_EX_USER_CMD_GET_CLLI_SEI,                            // Content light level Info
468     E_VDEC_EX_USER_CMD_GET_SEQ_CHANGE_INFO,                     // Get the reason why seq changes, parameter is MS_U32, definition is VDEC_EX_SeqChangeInfo
469 
470     //MVC Get Control command================================
471     E_VDEC_EX_USER_CMD_MVC_GET_CMD_BASE  = 0x1800,
472     E_VDEC_EX_USER_CMD_GET_MVC_SUB_FRAME_DISP_INFO,             // Param: VDEC_FrameInfo pointer.
473     E_VDEC_EX_USER_CMD_GET_MVC_BBU2_DECQ_VACANCY,               // Param: BBU2 Dec Q Vacancy.
474     E_VDEC_EX_USER_CMD_GET_MVC_ES2_READ_PTR,                    // Param: ES2 read pointer.
475     E_VDEC_EX_USER_CMD_GET_MVC_ES2_WRITE_PTR,                   // Param: ES2 Write pointer.
476     E_VDEC_EX_USER_CMD_GET_ES_QUANTITY,                         // Param: Get ES buffer Level.
477     E_VDEC_EX_USER_CMD_GET_ES2_QUANTITY,                        // Param: Get ES2 buffer Level.
478 
479 
480     //Group3:System Preset Control command======================
481     //Group3-1:Common system Preset Control command
482     E_VDEC_EX_USER_CMD_SYSTEM_PRESET_CONTROL_BASE  = 0x2000,
483     E_VDEC_EX_USER_CMD_SYSTEM_PRESET_VPU_CLOCK,                 //Param: VDEC_EX_ClockSpeed
484 
485     //Group3-2:HVD System Preset Control command
486     E_VDEC_EX_USER_CMD_SYSTEM_PRESET_HVD_BASE      = 0x2100,
487     E_VDEC_EX_USER_CMD_SYSTEM_PRESET_HVD_CLOCK,                 //Param: VDEC_EX_ClockSpeed
488 
489     //Group3-3:MVD System Preset Control command
490     E_VDEC_EX_USER_CMD_SYSTEM_PRESET_MVD_BASE      = 0x2200,
491     E_VDEC_EX_USER_CMD_SYSTEM_PRESET_MVD_CLOCK,                 //Param: VDEC_EX_ClockSpeed
492     E_VDEC_EX_USER_CMD_VPU_SECURITY_MODE,                       //Param: 0:disable,1:enable
493 
494     //Group3-4:Preset Control command=============================
495     E_VDEC_EX_USER_CMD_PRESET_CONTROL_BASE           = 0x2300,
496     E_VDEC_EX_USER_CMD_HVD_ONE_PENDING_BUFFER_MODE,             //Param: 0(Disable), 1(Enable), use only one pending buffer instead of two for HVD
497     E_VDEC_EX_USER_CMD_MVD_HWBUFFER_REMAPPING_MODE,             //Param: 0(Disable), 1(Enable),Allcate HW buffer to start of frame buffer
498     E_VDEC_EX_USER_CMD_SET_SHAREMEMORY_BASE,
499     E_VDEC_EX_USER_CMD_HVD_COL_BBU_MODE,                        //Param: HVD use colocated BBU mode, 0: disable, 1: enable /*johnny.ko*/
500     E_VDEC_EX_USER_CMD_HVD_IAPGN_BUF_SHARE_BW_MODE,             //Param: HVD IAP GN Buffer address,
501     /***/E_VDEC_EX_USER_CMD_DTV_DEBUG_MODE,
502     E_VDEC_EX_USER_CMD_HVD_TS_IN_BBU_MODE,
503     E_VDEC_EX_USER_CMD_AUTO_ARRANGE_FRAMEBUFFER_USAGE,          //Param: 0:disable,1:enable, address:PA,size:unit is byte
504     E_VDEC_EX_USER_CMD_THUMBNAIL_MODE,                          //Param: 0(Disable), 1(Enable), use small frame buffer to decdoe thumbnail
505     E_VDEC_EX_USER_CMD_FORCE_8BIT_DEC_MODE,                     //Param: force 8bit decode mode, 0: disable, 1: enable
506     E_VDEC_EX_USER_CMD_MFCODEC_MODE,                            //Param: VDEC_EX_MFCodec_mode
507     E_VDEC_EX_USER_CMD_VDEC_FEATURE,                            //AP control VDEC features
508     E_VDEC_EX_USER_CMD_DYNAMIC_CMA_MODE,                        //enable dynamic cma features
509     E_VDEC_EX_USER_CMD_CONNECT_DISPLAY_PATH,
510 
511     //Group4:System Postset Control command======================
512     E_VDEC_EX_USER_CMD_SYSTEM_POSTSET_CONTROL_BASE  = 0x3000,
513     E_VDEC_EX_USER_CMD_SYSTEM_POSTSET_CLEAR_PROCESS_RELATED,
514 
515     //Group5:System PreGet Control command======================
516     //Group5-1:Common system Preget Control command
517     E_VDEC_EX_USER_CMD_SYSTEM_PREGET_CONTROL_BASE  = 0x4000,
518     E_VDEC_EX_USER_CMD_SYSTEM_PREGET_FB_MEMORY_USAGE_SIZE,
519 
520 } VDEC_EX_User_Cmd;
521 
522 //-------------------------------------------------------------------------------------------------
523 //  Functions
524 //-------------------------------------------------------------------------------------------------
525 
526 //============================================================
527 // System
528 //============================================================
529 void MApi_AUDIO_WritePreInitTable(void);
530 void MApi_AUDIO_SetDspBaseAddr(MS_U8 u8Index, MS_U32 u32Bin_Base_Address, MS_U32 u32Mad_Base_Buffer_Adr);
531 void MApi_AUDIO_Initialize(void);
532 void MApi_Audio_Monitor(void);
533 MS_U32 MApi_AUDIO_GetDspMadBaseAddr(MS_U8 u8Index);
534 void MApi_AUDIO_ExitAudioSystem(void);
535 void MApi_AUDIO_SetPowerOn(MS_BOOL bFlag);
536 
537 //============================================================
538 // path
539 //============================================================
540 void MApi_AUDIO_SetOutputInfo(AUDIO_OUT_INFO *pout_info);
541 void MApi_AUDIO_InputSwitch(AUDIO_INPUT_TYPE enSource, AUDIO_SWITCH_GROUP enGroup);
542 void MApi_AUDIO_SetSourceInfo(AUDIO_SOURCE_INFO_TYPE eSourceType);
543 
544 //=============================================================
545 // volume
546 //=============================================================
547 void MApi_AUDIO_SetMixModeMute(AUDIO_SOURCE_INFO_TYPE eSourceType, AUDIO_MIX_VOL_TYPE VolType, MS_BOOL EnMute);
548 void MApi_AUDIO_SetMixModeVolume(AUDIO_SOURCE_INFO_TYPE eSourceType, AUDIO_MIX_VOL_TYPE VolType, MS_U8 u8Vol1, MS_U8 u8Vol2);
549 void MApi_AUDIO_SetAbsoluteVolume(MS_U8 u8Path, MS_U8 u8Vol1, MS_U8 u8Vol2);
550 void MApi_AUDIO_SetMute(MS_U8 u8Path, MS_BOOL EnMute );
551 void MApi_AUDIO_SPDIF_SetMute(MS_BOOL mute_en);
552 
553 //============================================================
554 // Decoder
555 //============================================================
556 AUDIO_DEC_ID MApi_AUDIO_OpenDecodeSystem(AudioDecStatus_t * p_AudioDecStatus);
557 MS_BOOL MApi_AUDIO_GetDecodeSystem(AUDIO_DEC_ID DecId,  AudioDecStatus_t * p_AudioDecStatus);
558 MS_BOOL MApi_AUDIO_SetDecodeSystem(AUDIO_DEC_ID DecId,  AudioDecStatus_t * p_AudioDecStatus);
559 MS_BOOL MApi_AUDIO_ReleaseDecodeSystem(AUDIO_DEC_ID DecId);
560 MS_BOOL MApi_AUDIO_SetAC3PInfo(Audio_AC3P_infoType infoType, MS_U32 param1, MS_U32 param2);
561 MS_U32  MApi_AUDIO_GetAC3PInfo(Audio_AC3P_infoType infoType);
562 void    MApi_AUDIO_SetCommand(En_DVB_decCmdType enDecComamnd);
563 void    MApi_AUDIO_SetADOutputMode(MS_U8 out_mode);
564 void    MApi_AUDIO_SetASFParm(WMA_ASF_PARMTYPE parm_type, MS_U32 value);
565 MS_BOOL MApi_AUDIO_SetDecodeCmd(AUDIO_DEC_ID DecId, En_DVB_decCmdType enDecComamnd);
566 MS_BOOL MApi_AUDIO_GetMAD_LOCK(void);
567 
568 //============================================================
569 // Common Decoder
570 //============================================================
571 #if(UTPA_SUPPORT_COMMON_DECODER_API)
572 MS_S32 MApi_AUDIO_DECODER_Open(void * pData);
573 MS_S32 MApi_AUDIO_DECODER_Close(MS_S32 s32DeviceID);
574 MS_S32 MApi_AUDIO_DECODER_Start(MS_S32 s32DeviceID);
575 MS_S32 MApi_AUDIO_DECODER_Stop(MS_S32 s32DeviceID);
576 MS_S32 MApi_AUDIO_DECODER_Set(MS_S32 s32DeviceID, AUDIO_DECODER_Command_t Cmd, void* pData);
577 MS_S32 MApi_AUDIO_DECODER_Get(MS_S32 s32DeviceID, AUDIO_DECODER_Command_t Cmd, void* pData);
578 MS_U32 MApi_AUDIO_DECODER_Read(MS_S32 s32DeviceID, void* pBuf, MS_U32 u32Size);
579 MS_U32 MApi_AUDIO_DECODER_Write(MS_S32 s32DeviceID, void* pBuf, MS_U32 u32Size);
580 MS_S32 MApi_AUDIO_DECODER_Flush(MS_S32 s32DeviceID);
581 #endif //#if(UTPA_SUPPORT_COMMON_DECODER_API)
582 
583 //============================================================
584 // Encode
585 //============================================================
586 
587 
588 //=============================================================
589 // Common Info
590 //=============================================================
591 MS_BOOL   MApi_AUDIO_SetCommAudioInfo(Audio_COMM_infoType infoType, MS_U32 param1, MS_U32 param2);
592 long long MApi_AUDIO_GetCommAudioInfo(Audio_COMM_infoType infoType);
593 MS_BOOL   MApi_AUDIO_SetAudioParam2(AUDIO_DEC_ID DecId, Audio_ParamType paramType, MS_U32 Param);
594 MS_BOOL   MApi_AUDIO_GetAudioInfo2(AUDIO_DEC_ID DecId, Audio_InfoType infoType, void * pInfo);
595 
596 //=============================================================
597 // Capture
598 //=============================================================
599 MS_BOOL MApi_AUDIO_PCMCapture_Read(const AUDIO_DEVICE_TYPE eID, void *buffer, const MS_U32 bytes);
600 MS_BOOL MApi_AUDIO_PCMCapture_Init(const AUDIO_DEVICE_TYPE eID, const AUDIO_CAPTURE_SOURCE_TYPE eSource);
601 MS_BOOL MApi_AUDIO_PCMCapture_Start(const AUDIO_DEVICE_TYPE eID);
602 MS_BOOL MApi_AUDIO_PCMCapture_Stop(const AUDIO_DEVICE_TYPE eID);
603 
604 //============================================================
605 // ATV
606 //============================================================
607 void    MApi_AUDIO_SIF_SendCmd(En_AUD_SIF_CmdType enAudSifCommand, MS_U8 comm_arg1, MS_U8 comm_arg2);
608 MS_BOOL MApi_AUDIO_SIF_SetBandSetup(MS_U8 SifBand);
609 void    MApi_AUDIO_SIF_SetStandard(AUDIOSTANDARD_TYPE standard_type);
610 MS_BOOL MApi_AUDIO_SIF_IsPALType(AUDIO_SIF_PAL_TYPE pal_type);
611 void    MApi_AUDIO_SIF_SetPALType(AUDIO_SIF_PAL_TYPE pal_type);
612 MS_BOOL MApi_AUDIO_SIF_SetSoundMode(MS_U8 u8SifSoundMode);
613 void    MApi_AUDIO_TriggerSifPLL(void);
614 MS_BOOL MApi_AUDIO_SIF_GetAudioStatus(AUDIOSTATUS * eAudioStatus);
615 MS_U8   MApi_AUDIO_SIF_GetSoundMode(void);
616 void    MApi_AUDIO_SIF_StartAutoStandardDetection(void);
617 AUDIOSTANDARD_TYPE MApi_AUDIO_SIF_GetResultOfAutoStandardDetection(void);
618 void    MApi_AUDIO_SIF_SetThreshold(THR_TBL_TYPE *ThrTbl);
619 void    MApi_AUDIO_SIF_SetPrescale(MS_U8 gain_type, MS_S32 db_value);
620 
621 //=============================================================
622 // SPDIF
623 //=============================================================
624 void    MApi_Audio_SPDIF_Monitor(void);
625 void    MApi_AUDIO_SPDIF_SetMode(MS_U8 spdif_mode);
626 MS_U8   MApi_AUDIO_SPDIF_GetMode(void);
627 void    MApi_AUDIO_SPDIF_SetSCMS(MS_U8 C_bit_en, MS_U8 L_bit_en);
628 void    MApi_AUDIO_SPDIF_HWEN(MS_BOOL spdif_en);
629 MS_BOOL MApi_AUDIO_SPDIF_ChannelStatus_CTRL(AUDIO_SPDIF_CS_TYPE cs_mode, AUDIO_SPDIF_CS_TYPE_STATUS status);
630 
631 //=============================================================
632 // HDMI
633 //=============================================================
634 #ifdef CONFIG_API_HDMITX //TV dont have HDMI TX
635 MS_BOOL MApi_HDMITx_Init(void);
636 void    MApi_HDMITx_SetAudioConfiguration(HDMITX_AUDIO_FREQUENCY freq, HDMITX_AUDIO_CHANNEL_COUNT ch, HDMITX_AUDIO_CODING_TYPE type);
637 void    MApi_HDMITx_SetAudioOnOff(MS_BOOL state);
638 void    MApi_HDMITx_SetAudioFrequency(HDMITX_AUDIO_FREQUENCY freq);
639 void    MApi_HDMITx_SetAudioSourceFormat(HDMITX_AUDIO_SOURCE_FORMAT fmt);
640 HDMITX_HDCP_STATUS MApi_HDMITx_GetHDCPStatus(void);
641 #endif
642 
643 MS_BOOL MApi_AUDIO_DigitalOut_SetDeviceCapability(DIGITAL_OUTPUT_TYPE eoutType, AUDIO_FORMAT_CODE ecodecType, Digital_Out_Device_Capability_t *p_codecCapability);
644 MS_BOOL MApi_AUDIO_HDMI_GetNonpcmFlag(void);
645 void    MApi_AUDIO_HDMI_Tx_GetStatus(MS_BOOL *onOff, AUDIO_FS_TYPE *hdmi_SmpFreq, HDMI_TX_OUTPUT_TYPE *outType );
646 void    MApi_AUDIO_HDMI_TX_SetMode(HDMI_TX_OUTPUT_TYPE outType);
647 AUDIO_HDMI_RX_TYPE MApi_AUDIO_HDMI_RX_SetNonpcm(MS_U8 nonPCM_en);
648 AUDIO_HDMI_RX_TYPE MApi_AUDIO_HDMI_RX_GetNonPCM(void);
649 
650 //=============================================================
651 // PCM IO
652 //=============================================================
653 MS_S32 MApi_AUDIO_PCM_Open(void *pData);
654 MS_S32 MApi_AUDIO_PCM_Close(MS_S32 s32DeviceId);
655 MS_S32 MApi_AUDIO_PCM_Start(MS_S32 s32DeviceId);
656 MS_S32 MApi_AUDIO_PCM_Stop(MS_S32 s32DeviceId);
657 MS_S32 MApi_AUDIO_PCM_Set(MS_S32 s32DeviceId, MS_U32 u32Cmd, const void *pData);
658 MS_S32 MApi_AUDIO_PCM_Get(MS_S32 s32DeviceId, MS_U32 u32Cmd, void *pData);
659 MS_U32 MApi_AUDIO_PCM_Read(MS_S32 s32DeviceId, void *pBuf, MS_U32 u32Size);
660 MS_U32 MApi_AUDIO_PCM_Write(MS_S32 s32DeviceId, const void *pBuf, MS_U32 u32Size);
661 MS_S32 MApi_AUDIO_PCM_Flush(MS_S32 s32DeviceId);
662 
663 //=============================================================
664 // Basic Sound Effect
665 //=============================================================
666 MS_BOOL MApi_SND_ProcessEnable(Sound_ENABLE_Type Type, MS_BOOL enable);
667 MS_BOOL MApi_SND_SetParam1(Sound_SET_PARAM_Type Type, MS_U16 param1, MS_U16 param2);
668 MS_U16  MApi_SND_GetParam1(Sound_GET_PARAM_Type Type, MS_U16 param1);
669 void    MApi_AUDIO_SetPEQCoef(AUDIO_PEQ_COEF *peq_coef);
670 void    MApi_AUDIO_SetAvcAT(MS_U8 AvcAT);
671 void    MApi_AUDIO_SetAvcRT(MS_U8 AvcRT);
672 
673 //=============================================================
674 // ADV Sound Effect
675 //=============================================================
676 MS_BOOL MApi_AUDIO_ADVSOUND_ProcessEnable(ADVSND_TYPE type);
677 MS_BOOL MApi_AUDIO_ADVSOUND_SubProcessEnable(ADVFUNC proc, MS_BOOL enable);
678 MS_BOOL MApi_AUDIO_ADVSND_SetParam(ADVSND_PARAM param, MS_U32 u32value1, MS_U16 u16value2);
679 void    MApi_AUDIO_COPY_Parameter(ADVSND_PARAM type, void* Parameter_ptr,MS_U32 size);
680 
681 //=============================================================
682 // MM
683 //=============================================================
684 MS_PHY  MApi_AUDIO_GetDDRInfo(AUDIO_DEC_ID DecId, EN_AUDIO_DDRINFO DDRInfo);
685 MS_BOOL MApi_AUDIO_MM2_initAesInfo(AUDIO_DEC_ID dec_id);
686 MS_BOOL MApi_AUDIO_MM2_checkAesInfo(AUDIO_DEC_ID  dec_id, AES_INFO *aes_info);
687 MS_BOOL MApi_AUDIO_MM2_inputAesFinished(AUDIO_DEC_ID dec_id, MS_U32 es_size, MS_BOOL ptsExist, MS_U64 pts);
688 
689 //=============================================================
690 // not audio, use for debug
691 //=============================================================
692 VDEC_EX_Result MApi_VDEC_EX_GetControl(VDEC_StreamId *pStreamId, VDEC_EX_User_Cmd cmd_id, MS_U32 *param);
693 MS_U32 MApi_VDEC_EX_GetPTS(VDEC_StreamId *pStreamId);
694 
695 #ifdef __cplusplus
696 }
697 #endif
698 
699 #endif //_AUDIO_V2_CUSTOMER_H_
700 
701 #endif // #ifdef ROLLS_ROYCE
702