xref: /utopia/UTPA2-700.0.x/mxlib/include/apiDMX.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   apiDMX.h
98 /// @brief  Demux API
99 /// @author MStar Semiconductor,Inc.
100 ////////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 //-------------------------------------------------
103 /*! \defgroup DMX DMX interface
104 
105   TSP (Transport Stream Processor) receives transport stream through serial or parallel interface.
106   The input stream can be filtered by PID and masked pattern to get individual section data streams that are qualified with CRC and stored into the ring buffers located in external memory.
107   Besides section filter, audio PES FIFO and video PES FIFO are used to pass the selected Audio/Video PES packet to audio/video decoder.
108   PVR function is also supported.
109 
110   In order to parse section data in TS stream, TSP equipment a 32-bit RISC processor, besides, The PID filter, header compare, CRC, DMA and PVR are implemented with dedicated hardware.
111 
112   <b> Ownership of Filters </b> \n
113   Not only one processor will use Demux driver at the same time, all the filters can be grouped into different processor by API MApi_DMX_SetOwner.
114    \image html apiDMX_pic1.png
115 
116    <b> Filter Life Cycle </b> \n
117    \image html apiDMX_pic2.png
118 
119   <b> API call flow for initiation: </b> \n
120    \image html apiDMX_pic3.png
121 
122   <b> API call flow for exit: </b> \n
123    \image html apiDMX_pic4.png
124 
125   <b> API call flow for general usage - Live in playback: </b> \n
126    \image html apiDMX_pic5.png
127 
128   <b> API call flow for general usage - File in playback: </b> \n
129    \image html apiDMX_pic6.png
130 
131   <b> API call flow for general usage - PVR/PVRCA: </b> \n
132    \image html apiDMX_pic7.png
133 
134   <b> API call flow for general usage - MMFI Audio/MMFI Video3D: </b> \n
135    \image html apiDMX_pic8.png
136 
137   *! \defgroup TSP TSP related functions
138   *   \ingroup   DMX
139 
140   *! \defgroup TSP_General  TSP General functions
141   *   \ingroup   TSP
142 
143   *! \defgroup TSP_Flow  TSP Flow control functions
144   *   \ingroup   TSP
145 
146   *! \defgroup TSP_STC TSP STC/PCR functions
147   *   \ingroup   TSP
148 
149   *! \defgroup TSP_Filter TSP Basic filter control functions
150   *   \ingroup   TSP
151 
152   *! \defgroup TSP_SecFilter TSP Section filter control functions
153   *   \ingroup   TSP
154 
155   *! \defgroup TSP_TTX TSP Teltext related functions
156   *   \ingroup   TSP
157 
158   *! \defgroup TSP_FIFO TSP AVFIFO functions
159   *   \ingroup   TSP
160 
161   *! \defgroup TSP_PVR TSP PVR (record) related functions
162   *   \ingroup   TSP
163 
164   *! \defgroup TSP_PVR_General TSP PVR general  functions
165   *   \ingroup   TSP_PVR
166 
167   *! \defgroup TSP_PVR_CA TSP PVR CA  functions (need decrypt)
168   *   \ingroup   TSP_PVR
169 
170   *! \defgroup TSP_FILEIN_PVR TSP file-in record related functions
171   *   \ingroup   TSP_PVR
172 
173   *! \defgroup TSP_PVR_STB TSP PVR related functions for STB
174   *   \ingroup   TSP_PVR
175 
176   *! \defgroup TSP_Playback TSP playback (file-in) related functions
177   *   \ingroup   TSP
178 
179   *! \defgroup TSP_SCMB TSP Scramble status check functions
180   *   \ingroup   TSP
181 
182   *! \defgroup TSP_STB TSP functions which only used on STB chip
183   *   \ingroup   TSP
184 
185   *! \defgroup TSP_Debug TSP Debug functions
186   *   \ingroup   TSP
187 
188   *! \defgroup TSP_FIQ TSP FIQ related functions
189   *   \ingroup   TSP
190 
191   *! \defgroup TSP_Merge TSP merge stream related functions for CI+ 1.4 used
192   *   \ingroup   TSP
193 
194   *! \defgroup TSP_MM TSP MM (Multi-Media) related functions
195   *   \ingroup   TSP
196 
197   *! \defgroup TSO TSO related functions
198   *   \ingroup   DMX
199 
200   *! \defgroup TSO_General TSO general functions
201   *   \ingroup   TSO
202 
203   *! \defgroup DMX_STR DMX STR functions
204   *   \ingroup   DMX
205 
206   *! \defgroup DMX_ToBeModified DMX api to be modified
207   *   \ingroup   DMX
208 
209   *! \defgroup DMX_ToBeModified_TSP TSP api to be modified
210   *   \ingroup   DMX_ToBeModified
211 
212   *! \defgroup DMX_ToBeModified_MM MM api to be modified
213   *   \ingroup   DMX_ToBeModified
214 
215   *! \defgroup DMX_ToBeModified_TSO TSO api to be modified
216   *   \ingroup   DMX_ToBeModified
217 
218   *! \defgroup DMX_ToBeRemove DMX api to be removed
219   *   \ingroup   DMX
220 
221   */
222 //-------------------------------------------------
223 
224 #ifndef __API_DMX_H__
225 #define __API_DMX_H__
226 
227 #include "MsCommon.h"
228 #include "UFO.h"
229 
230 #ifdef __cplusplus
231 extern "C"
232 {
233 #endif
234 
235 /// NULL PID definition
236 #define DMX_PID_NULL               (0x1FFFUL)
237 
238 // Please don't change this value if you know exactly what you are doing
239 /// DMX Filter pattern depth
240 #define DMX_SECT_FLT_DEPTH         (16UL)
241 
242 /// NULL DMX Id
243 #define DMX_DMXID_NULL             ((MS_U8)0xFFUL)
244 #define MSIF_DMX_LIB_CODE                     {'D','M','X','_'}    //Lib code
245 #define MSIF_DMX_LIBVER                       {'1','5'}            //LIB version
246 #define MSIF_DMX_BUILDNUM                     {'0','3'}            //Build Number
247 #define MSIF_DMX_CHANGELIST                   {'0','0','6','1','7','4','7','0'} //P4 ChangeList Number
248 
249 /// DMX Version
250 #define DMX_API_VERSION                 /* Character String for DRV/API version             */  \
251     MSIF_TAG,                           /* 'MSIF'                                           */  \
252     MSIF_CLASS,                         /* '00'                                             */  \
253     MSIF_CUS,                           /* 0x0000                                           */  \
254     MSIF_MOD,                           /* 0x0000                                           */  \
255     MSIF_CHIP,                                                                                  \
256     MSIF_CPU,                                                                                   \
257     MSIF_DMX_LIB_CODE,                  /* IP__                                             */  \
258     MSIF_DMX_LIBVER,                    /* 0.0 ~ Z.Z                                        */  \
259     MSIF_DMX_BUILDNUM,                  /* 00 ~ 99                                          */  \
260     MSIF_DMX_CHANGELIST,                /* CL#                                              */  \
261     MSIF_OS
262 
263 /// DMX status indicator
264 typedef enum
265 {
266     DMX_FILTER_STATUS_OK,                   ///< DMX status OK
267     DMX_FILTER_STATUS_ERROR,                ///< DMX status ERROR
268     DMX_FILTER_STATUS_NOT_SUPPORT,           ///< DMX status NOT SUPPORT
269     DMX_FILTER_STATUS_MULTIPRC_RUNNING      ///< DMX status multiple process still sunning
270 } DMX_FILTER_STATUS;
271 
272 /// DMX debug levels
273 typedef enum
274 {
275     DMX_DBG_NONE,   ///< None
276     DMX_DBG_ERR,    ///< Errors
277     DMX_DBG_WARN,   ///< Warnings
278     DMX_DBG_INFO,   ///< Information
279     DMX_DBG_PVR,    ///< PVR
280     DMX_DBG_FUNC    ///< Function calls
281 } DMX_DBGMSG_LEVEL;
282 
283 /// DMX internal startup parameter
284 #if defined(UFO_PUBLIC_HEADER_500_3)
285 typedef struct __attribute__((__packed__)) _DMX_FW_Param
286 #else
287 typedef struct DLL_PACKED _DMX_FW_Param
288 #endif
289 {
290     MS_PHY                                  phyFWAddr;           ///< Firmware physical address
291     MS_U32                                  u32FWSize;           ///< Firmware size
292 
293     MS_PHY                                  phyVQAddr;           ///< Virtual Queue physical address
294     MS_U32                                  u32VQSize;           ///< Virtual Queue size
295 
296     MS_U32                                  u32IsHK;             ///< Indicates whether this is the "house-keeping" (= main) CPU
297     MS_U32                                  u32Res;
298 
299     MS_U32                                  _zero_reserved[2];   ///< Reserved
300 
301 } DMX_TSPParam;
302 
303 
304 #if 0
305 /// DMX fitler type and source type
306 typedef enum
307 {
308     DMX_FILTER_TYPE_VIDEO,                                   ///< DMX video filter type
309     DMX_FILTER_TYPE_AUDIO,                                   ///< DMX audio filter type
310     DMX_FILTER_TYPE_AUDIO2,                                  ///< DMX audio2 filter type
311     DMX_FILTER_TYPE_SECTION,                                 ///< DMX section filter type
312     DMX_FILTER_TYPE_PES,                                     ///< DMX PES filter type
313     DMX_FILTER_TYPE_PACKET,                                  ///< DMX TS packet filter type
314     DMX_FILTER_TYPE_PCR,                                     ///< DMX PCR filter type
315     DMX_FILTER_TYPE_TELETEXT,                                ///< DMX teletext filter type
316 
317     DMX_FILTER_SOURCE_TYPE_MASK  =  0xC0000000,              ///< DMX filter source mask
318     DMX_FILTER_SOURCE_TYPE_LIVE  =  0x80000000,              ///< DMX live stream filter source
319     DMX_FILTER_SOURCE_TYPE_FILE  =  0x40000000,              ///< DMX file in filter type
320 } DMX_FILTER_TYPE;
321 #endif
322 
323 /// DMX fitler type and source type
324 #define DMX_FILTER_TYPE MS_U32  ///< Filter types
325 
326 #define DMX_FILTER_TYPE_VIDEO                   0x00000000UL                  ///< DMX video filter type
327 #define DMX_FILTER_TYPE_AUDIO                   0x00000001UL                  ///< DMX audio filter type
328 #define DMX_FILTER_TYPE_AUDIO2                  0x00000002UL                  ///< DMX audio2 filter type
329 #define DMX_FILTER_TYPE_SECTION                 0x00000003UL                  ///< DMX section filter type
330 #define DMX_FILTER_TYPE_PES                     0x00000004UL                  ///< DMX PES filter type
331 #define DMX_FILTER_TYPE_PACKET                  0x00000005UL                  ///< DMX TS packet filter type
332 #define DMX_FILTER_TYPE_PCR                     0x00000006UL                  ///< DMX PCR filter type
333 #define DMX_FILTER_TYPE_TELETEXT                0x00000007UL                  ///< DMX teletext filter type
334 #define DMX_FILTER_TYPE_VIDEO3D                 0x00000008UL                  ///< DMX V3D filter type
335 #define DMX_FILTER_TYPE_VIDEO2                  DMX_FILTER_TYPE_VIDEO3D       ///< DMX video2 filter type
336 #define DMX_FILTER_TYPE_AUDIO3                  0x00000009UL                  ///< DMX audio3 filter type
337 #define DMX_FILTER_TYPE_AUDIO4                  0x0000000AUL                  ///< DMX audio4 filter type
338 #define DMX_FILTER_TYPE_REC                     0x0000000BUL                  ///< DMX record filter type no destination needs to be set
339 #define DMX_FILTER_TYPE_SCMBCHK                 0x0000000CUL                  ///< DMX filter type for checking TS scrambling status
340 #define DMX_FILTER_TYPE_SECTION_VER             0x0000000DUL                  ///< DMX section filter type with version and CRC check
341 #define DMX_FILTER_TYPE_SECTION_NO_PUSI         0x0000000EUL                  ///< DMX section filter type which receive section without PUSI
342 #define DMX_FILTER_TYPE_VIDEO3                  0x0000000FUL                  ///< DMX video3 filter type
343 #define DMX_FILTER_TYPE_VIDEO4                  0x00000010UL                  ///< DMX video4 filter type
344 #if defined(UFO_PUBLIC_HEADER_500_3)
345 #define DMX_FILTER_TYPE_PVR                     0x00000010UL                  ///< DMX record filter (merge stream) type no destination needs to be set
346 #define DMX_FILTER_TYPE_PVR1                    0x00000011UL                  ///< DMX record filter (merge stream) type no destination needs to be set
347 #define DMX_FILTER_TYPE_PVR2                    0x00000012UL                  ///< DMX record filter (merge stream) type no destination needs to be set
348 #define DMX_FILTER_TYPE_PVR3                    0x00000013UL                  ///< DMX record filter (merge stream) type no destination needs to be set
349 #else
350 #define DMX_FILTER_TYPE_PVR                     0x00000011UL                  ///< DMX record filter (merge stream) type no destination needs to be set
351 #define DMX_FILTER_TYPE_PVR1                    0x00000012UL                  ///< DMX record filter (merge stream) type no destination needs to be set
352 #define DMX_FILTER_TYPE_PVR2                    0x00000013UL                  ///< DMX record filter (merge stream) type no destination needs to be set
353 #define DMX_FILTER_TYPE_PVR3                    0x00000014UL                  ///< DMX record filter (merge stream) type no destination needs to be set
354 #endif
355 #define DMX_FILTER_TYPE_PVR4                    0x00000015UL                  ///< DMX record filter (merge stream) type no destination needs to be set
356 #define DMX_FILTER_TYPE_PVR5                    0x00000016UL                  ///< DMX record filter (merge stream) type no destination needs to be set
357 #define DMX_FILTER_TYPE_PVR6                    0x00000017UL                  ///< DMX record filter (merge stream) type no destination needs to be set
358 #define DMX_FILTER_TYPE_PVR7                    0x00000018UL                  ///< DMX record filter (merge stream) type no destination needs to be set
359 #define DMX_FILTER_TYPE_PVR8                    0x00000019UL                  ///< DMX record filter (merge stream) type no destination needs to be set
360 #define DMX_FILTER_TYPE_PVR9                    0x0000001AUL                  ///< DMX record filter (merge stream) type no destination needs to be set
361 #define DMX_FILTER_TYPE_AUDIO5                  0x0000001BUL                  ///< DMX audio5 filter type
362 #define DMX_FILTER_TYPE_AUDIO6                  0x0000001CUL                  ///< DMX audio6 filter type
363 #define DMX_FILTER_TYPE_VIDEO5                  0x0000001DUL                  ///< DMX video5 filter type
364 #define DMX_FILTER_TYPE_VIDEO6                  0x0000001EUL                  ///< DMX video6 filter type
365 #define DMX_FILTER_TYPE_VIDEO7                  0x0000001FUL                  ///< DMX video7 filter type
366 #define DMX_FILTER_TYPE_VIDEO8                  0x00000020UL                  ///< DMX video8 filter type
367 #define DMX_FILTER_FLT_MASK                     0xF3FF0F00UL
368 
369 #define DMX_FILTER_SOURCE_TYPE_MASK             0xF0FC0000UL                   ///< DMX filter source mask
370 #define DMX_FILTER_SOURCE_TYPE_LIVE             0x80000000UL                   ///< DMX live stream filter source
371 #define DMX_FILTER_SOURCE_TYPE_FILE             0x40000000UL                   ///< DMX file in filter type
372 #define DMX_FILTER_SOURCE_TYPE_LIVEB            DMX_FILTER_SOURCE_TYPE_FILE    ///< Input from TS1 to File PID filter
373 #define DMX_FILTER_SOURCE_TYPE_TS1              0x00800000UL                   ///< DMX live stream filter source 1
374 #define DMX_FILTER_SOURCE_TYPE_TS2              0x00400000UL                   ///< DMX live stream filter source 2
375 #define DMX_FILTER_SOURCE_TYPE_TS3              0x00200000UL                   ///< DMX live stream filter source 3
376 #define DMX_FILTER_SOURCE_TYPE_FILE1            0x00100000UL                   ///< DMX file-in stream, filter source from file1
377 #define DMX_FILTER_SOURCE_TYPE_FILE2            0x00080000UL                   ///< DMX file-in stream, filter source from file2
378 #define DMX_FILTER_SOURCE_TYPE_FILE3            0x00040000UL                   ///< DMX file-in stream, filter source from file3
379 #define DMX_FILTER_SOURCE_TYPE_TS4              0x00000000UL                   ///< DMX live stream filter source 4
380 #define DMX_FILTER_SOURCE_TYPE_TS5              0x000C0000UL                   ///< DMX live stream filter source 5
381 #define DMX_FILTER_SOURCE_TYPE_TS6              0x00140000UL                   ///< DMX live stream filter source 6
382 #define DMX_FILTER_SOURCE_TYPE_FILE4            0x00180000UL                   ///< DMX file-in stream, filter source from file4
383 #define DMX_FILTER_SOURCE_TYPE_FILE5            0x001C0000UL                   ///< DMX file-in stream, filter source from file5
384 #define DMX_FILTER_SOURCE_TYPE_FILE6            0x00240000UL                   ///< DMX file-in stream, filter source from file6
385 
386 
387 // Source ID define.  For merge stream
388 #define DMX_FILTER_SOURCEID_MASK                0x00010F00UL
389 #define DMX_FILTER_SOURCEID_0                   0x00000000UL
390 #define DMX_FILTER_SOURCEID_1                   0x00000100UL
391 #define DMX_FILTER_SOURCEID_2                   0x00000200UL
392 #define DMX_FILTER_SOURCEID_3                   0x00000300UL
393 #define DMX_FILTER_SOURCEID_4                   0x00000400UL
394 #define DMX_FILTER_SOURCEID_5                   0x00000500UL
395 #define DMX_FILTER_SOURCEID_6                   0x00000600UL
396 #define DMX_FILTER_SOURCEID_7                   0x00000700UL
397 #define DMX_FILTER_SOURCEID_8                   0x00000800UL
398 #define DMX_FILTER_SOURCEID_9                   0x00000900UL
399 #define DMX_FILTER_SOURCEID_10                  0x00000a00UL
400 #define DMX_FILTER_SOURCEID_11                  0x00000b00UL
401 #define DMX_FILTER_SOURCEID_12                  0x00000c00UL
402 #define DMX_FILTER_SOURCEID_13                  0x00000d00UL
403 #define DMX_FILTER_SOURCEID_14                  0x00000e00UL
404 #define DMX_FILTER_SOURCEID_15                  0x00000f00UL
405 #define DMX_FILTER_SOURCEID_16                  0x00010000UL
406 #define DMX_FILTER_SOURCEID_17                  0x00010100UL
407 #define DMX_FILTER_SOURCEID_18                  0x00010200UL
408 #define DMX_FILTER_SOURCEID_19                  0x00010300UL
409 #define DMX_FILTER_SOURCEID_20                  0x00010400UL
410 #define DMX_FILTER_SOURCEID_21                  0x00010500UL
411 #define DMX_FILTER_SOURCEID_22                  0x00010600UL
412 #define DMX_FILTER_SOURCEID_23                  0x00010700UL
413 #define DMX_FILTER_SOURCEID_24                  0x00010800UL
414 #define DMX_FILTER_SOURCEID_25                  0x00010900UL
415 #define DMX_FILTER_SOURCEID_26                  0x00010a00UL
416 #define DMX_FILTER_SOURCEID_27                  0x00010b00UL
417 #define DMX_FILTER_SOURCEID_28                  0x00010c00UL
418 #define DMX_FILTER_SOURCEID_29                  0x00010d00UL
419 #define DMX_FILTER_SOURCEID_30                  0x00010e00UL
420 #define DMX_FILTER_SOURCEID_31                  0x00010f00UL
421 
422 
423 // Only supported by TSP ver3.0 driver for section filter duplicate sw patch
424 #define DMX_FILTER_FLT_TYPE_DUPSEC              0x02000000UL
425 
426 // Only supported by TSP ver2.0 driver
427 #define DMX_FILTER_SOURCE_TYPE_PLAYBACK         DMX_FILTER_SOURCE_TYPE_LIVE   ///< DMX playback filter source
428 #define DMX_FILTER_SOURCE_TYPE_PVR0             0x20000000UL                  ///< DMX PVR0 stream filter source
429 #define DMX_FILTER_SOURCE_TYPE_PVR1             0x10000000UL                  ///< DMX PVR1 stream filter source
430 
431 #define DMX_FILTER_FLT_SCMB_MASK                0x30000000UL                  ///< DMX descramble filter mask
432 #define DMX_FILTER_FLT_TYPE_SCMB                0x20000000UL                  ///< DMX descramble filter type
433 #define DMX_FILTER_FLT_TYPE_SCMB_SHAREKEY       0x10000000UL                  ///< DMX descramble filter type with sharekey
434 
435 // Support PVR I frame parser LUT.
436 // When open the filter type DMX_FILTER_TYPE_PVRx, video PID need to OR(|) this source type for PVR. EX: DMX_FILTER_TYPE_PVRx | DMX_FILTER_TYPE_EX_I_FRAME_PVR
437 #define DMX_FILTER_TYPE_EX_I_FRAME_PVR          0x01000000UL                  ///< DMX PVR I frame LUT PVR_TABLE enable
438 //--------------------------------------------------
439 // Debug table
440 /// DMX debug commands
441 typedef enum
442 {
443     DMX_DEBUG_CMD_NONE,     ///< None
444     DMX_DEBUG_CMD_CLEAR,    ///< Clear debug command
445     DMX_DEBUG_CMD_ENABLE,   ///< Enable debug command
446     DMX_DEBUG_CMD_DISABLE,  ///< Disable debug command
447 } DMX_DEBUG_CMD;
448 
449 /// DMX debug source
450 typedef enum
451 {
452     DMX_DEBUG_SRC_TS0       = 0,                     ///< Debug LIVE0 input
453     DMX_DEBUG_SRC_TS1       = 1,                     ///< Debug LIVE1 input
454     DMX_DEBUG_SRC_TS2       = 2,                     ///< Debug LIVE2 input
455     DMX_DEBUG_SRC_FILE      = 3,                     ///< Debug FILE0 input
456     DMX_DEBUG_SRC_TS3       = 4,                     ///< Debug LIVE3 input
457     DMX_DEBUG_SRC_FILE0     = DMX_DEBUG_SRC_FILE,    ///< Debug FILE0 input
458     DMX_DEBUG_SRC_FILE1     = 5,                     ///< Debug FILE1 input
459     DMX_DEBUG_SRC_FILE2     = 6,                     ///< Debug FILE2 input
460     DMX_DEBUG_SRC_FILE3     = 7,                     ///< Debug FILE3 input
461     DMX_DEBUG_SRC_MMFI0     = 8,                     ///< Debug MMFI0 input
462     DMX_DEBUG_SRC_MMFI1     = 9,                     ///< Debug MMFI1 input
463     DMX_DEBUG_SRC_TS4       = 10,                    ///< Debug LIVE4 input
464     DMX_DEBUG_SRC_TS5       = 11,                    ///< Debug LIVE5 input
465     DMX_DEBUG_SRC_TS6       = 12,                    ///< Debug LIVE6 input
466     DMX_DEBUG_SRC_FILE4     = 13,                    ///< Debug FILE4 input
467     DMX_DEBUG_SRC_FILE5     = 14,                    ///< Debug FILE5 input
468     DMX_DEBUG_SRC_FILE6     = 15,                    ///< Debug FILE6 input
469 } DMX_DEBUG_SRC;
470 
471 /// DMX debug TSIF type
472 typedef enum
473 {
474     DMX_DEBUG_TSIF_TS0,        ///< Debug LIVE0  input
475     DMX_DEBUG_TSIF_TS1,        ///< Debug LIVE1  input
476     DMX_DEBUG_TSIF_TSCB,       ///< Debug LIVECB input
477     DMX_DEBUG_TSIF_TS2,        ///< Debug LIVE2  input
478     DMX_DEBUG_TSIF_TS3,        ///< Debug LIVE3  input
479     DMX_DEBUG_TSIF_TS4,        ///< Debug LIVE4  input
480     DMX_DEBUG_TSIF_TS5,        ///< Debug LIVE5  input
481     DMX_DEBUG_TSIF_TS6,        ///< Debug LIVE6  input
482 
483 } DMX_DEBUG_TSIF;
484 
485 /// DMX debug FIFO type
486 typedef enum
487 {
488     DMX_DEBUG_FIFO_VIDEO,                                ///< Debug Video    FIFO
489     DMX_DEBUG_FIFO_AUDIO,                                ///< Debug Audio    FIFO
490     DMX_DEBUG_FIFO_VIDEO3D,                              ///< Debug Video 3D FIFO
491     DMX_DEBUG_FIFO_VIDEO2 = DMX_DEBUG_FIFO_VIDEO3D,      ///< Debug Video 2  FIFO
492     DMX_DEBUG_FIFO_AUDIOB,                               ///< Debug Audio B  FIFO
493     DMX_DEBUG_FIFO_AUDIOC,                               ///< Debug Audio C  FIFO
494     DMX_DEBUG_FIFO_AUDIOD,                               ///< Debug Audio D  FIFO
495     DMX_DEBUG_FIFO_VIDEO3,                               ///< Debug Video 3  FIFO
496     DMX_DEBUG_FIFO_VIDEO4,                               ///< Debug Video 4  FIFO
497     DMX_DEBUG_FIFO_VIDEO5,                               ///< Debug Video 5  FIFO
498     DMX_DEBUG_FIFO_VIDEO6,                               ///< Debug Video 6  FIFO
499     DMX_DEBUG_FIFO_VIDEO7,                               ///< Debug Video 7  FIFO
500     DMX_DEBUG_FIFO_VIDEO8,                               ///< Debug Video 8  FIFO
501     DMX_DEBUG_FIFO_AUDIOE,                               ///< Debug Audio E  FIFO
502     DMX_DEBUG_FIFO_AUDIOF                                ///< Debug Audio F  FIFO
503 
504 } DMX_DEBUG_FIFO;
505 
506 /// DMX debug FIFO Source
507 typedef enum
508 {
509     DMX_DEBUG_PKT_DEMUX_0,      ///< Debug LIVE0  input
510     DMX_DEBUG_PKT_DEMUX_0_FILE, ///< Debug FILE0  input
511     DMX_DEBUG_PKT_DEMUX_1,      ///< Debug LIVE1  input
512     DMX_DEBUG_PKT_DEMUX_2,      ///< Debug LIVE2  input
513     DMX_DEBUG_MMFI0,            ///< Debug MMFI0  input
514     DMX_DEBUG_MMFI1,            ///< Debug MMFI1  input
515     DMX_DEBUG_PKT_DEMUX_3,      ///< Debug LIVE3  input
516     DMX_DEBUG_PKT_DEMUX_1_FILE, ///< Debug FILE1  input
517     DMX_DEBUG_PKT_DEMUX_2_FILE, ///< Debug FILE2  input
518     DMX_DEBUG_PKT_DEMUX_3_FILE, ///< Debug FILE3  input
519     DMX_DEBUG_PKT_DEMUX_4,      ///< Debug LIVE4  input
520     DMX_DEBUG_PKT_DEMUX_5,      ///< Debug LIVE5  input
521     DMX_DEBUG_PKT_DEMUX_6,      ///< Debug LIVE6  input
522     DMX_DEBUG_PKT_DEMUX_4_FILE, ///< Debug FILE4  input
523     DMX_DEBUG_PKT_DEMUX_5_FILE, ///< Debug FILE5  input
524     DMX_DEBUG_PKT_DEMUX_6_FILE, ///< Debug FILE6  input
525 
526 } DMX_DEBUG_FIFO_SRC;
527 
528 // only one playback flow or PVR flow exist
529 // Playback flow and PVR flow can exist simultaneously
530 
531 /// DMX flow type
532 typedef enum
533 {
534     DMX_FLOW_PLAYBACK                   = 0,                       ///< DMX playback flow
535     DMX_FLOW_PVR                        = 1,                       ///< DMX recording flow
536     DMX_FLOW_PVR1                       = 2,                       ///< DMX recording flow 1 note: Not support for all chip
537 
538     DMX_FLOW_PVRCA                      = 3,                       ///< CI+ PVR
539 
540     DMX_FLOW_FILEIN_MM                  = 4,                       ///< DMX Filein flow with Main path Vido and MMFI path Audio
541     DMX_FLOW_MMFI0                      = DMX_FLOW_FILEIN_MM,      ///< DMX Filein flow with MMFI 0 (MMFI version 2.0)
542     DMX_FLOW_FILEIN_MM3D                = 5,                       ///< DMX Filein flow with Main path Video, MMFI path 3DVideo, and MMFI Audio
543     DMX_FLOW_MMFI1                      = DMX_FLOW_FILEIN_MM3D,    ///< DMX Filein flow with MMFI 1 (MMFI version 2.0)
544 
545     DMX_FLOW_CIPHSS_PLAYBACK            = 6,                       ///< Playback flow for CI+ HSS 2 path input for CI+
546     DMX_FLOW_CIPHSS_PVRCA               = 7,                       ///< PVR flow for CI+ HSS 2 path input for CI+
547 
548     DMX_FLOW_PVR2                       = 8,                       ///< DMX recording flow 2, note: Not support for all chip, PVR2
549     DMX_FLOW_PVR3                       = 9,                       ///< DMX recording flow 3, note: Not support for all chip
550     DMX_FLOW_PVR4                       = 10,                      ///< DMX recording flow 4, note: Not support for all chip
551     DMX_FLOW_PVR5                       = 11,                      ///< DMX recording flow 5, note: Not support for all chip
552 
553     DMX_FLOW_TSO_PLAYBACK               = 12,                      ///< DMX TSO playback flow (live0 & file0)
554     DMX_FLOW_PLAYBACK1                  = 13,                      ///< DMX playback flow from TS1 (version 3.0)
555     DMX_FLOW_PVRCA1                     = 14,                      ///< CI+ PVR (version 3.0)
556 
557     DMX_FLOW_TSO_PLAYBACK1              = 15,                      ///< DMX TSO1 playback flow (live1 & file1)
558     DMX_FLOW_PLAYBACK2                  = 16,                      ///< DMX playback flow from TS2 (version 3.0/4.0)
559     DMX_FLOW_PLAYBACK3                  = 17,                      ///< DMX playback flow from TS3 (version 4.0)
560 
561     DMX_FLOW_PLAYBACK_NOCA              = 18,                      ///< DMX playback flow without pass through CA
562     DMX_FLOW_PLAYBACK_SRC_TS1           = 19,                      ///< DMX playback, CA input from TS1 output to Live0
563 
564     DMX_FLOW_PLAYBACK_FI                = 20,                      ///< DMX playback flow from TSFI (version 3.0)
565 
566     DMX_FLOW_TSO_MMT                    = 21,                      ///< TSO MMT Flow
567 
568     DMX_FLOW_TSIO_PLAYBACK              = 22,                      ///< DMX TSIO playback flow
569 
570     DMX_FLOW_PLAYBACK4                  = 23,                      ///< DMX playback flow from TS4 (version 4.0)
571     DMX_FLOW_PLAYBACK5                  = 24,                      ///< DMX playback flow from TS5 (version 4.0)
572     DMX_FLOW_PLAYBACK6                  = 25,                      ///< DMX playback flow from TS6 (version 4.0)
573 
574     DMX_FLOW_NUM,
575 } DMX_FLOW;
576 
577 /// DMX input type
578 typedef enum
579 {
580     DMX_FLOW_INPUT_DEMOD,               ///< DMX input from internal demodulator 0
581     DMX_FLOW_INPUT_MEM,                 ///< DMX input from memory
582     DMX_FLOW_INPUT_EXT_INPUT0,          ///< DMX input from external input 0
583     DMX_FLOW_INPUT_EXT_INPUT1,          ///< DMX input from external input 1
584     DMX_FLOW_INPUT_EXT_INPUT2,          ///< DMX input from external input 2. note: Not support for all chip
585     DMX_FLOW_INPUT_EXT_INPUT3,          ///< DMX input from external input 3. note: Not support for all chip
586     DMX_FLOW_INPUT_MEM_NOPASSCA,        ///< DMX input from memory, but not pass through CA
587     DMX_FLOW_INPUT_DEMOD1,              ///< DMX input from internal demodulator 1
588     DMX_FLOW_INPUT_TSO,                 ///< DMX input from TS Output 0
589     DMX_FLOW_INPUT_TSO1,                ///< DMX input from TS Output 1
590     DMX_FLOW_INPUT_MEM_PASSCA1,         ///< DMX input from memory, but pass through CA1, not CA0
591     DMX_FLOW_INPUT_MEM1,                ///< DMX input from memory path 2
592     DMX_FLOW_INPUT_EXT_INPUT4,          ///< DMX input from external input 4. note: Not support for all chip
593     DMX_FLOW_INPUT_EXT_INPUT5,          ///< DMX input from external input 5. note: Not support for all chip
594 
595     DMX_FLOW_INPUT_EXT_INPUT0_3WIRE,    ///< DMX input from external 3-wire input 0. note: Not support for all chip
596     DMX_FLOW_INPUT_EXT_INPUT1_3WIRE,    ///< DMX input from external 3-wire input 1. note: Not support for all chip
597     DMX_FLOW_INPUT_EXT_INPUT2_3WIRE,    ///< DMX input from external 3-wire input 2. note: Not support for all chip
598     DMX_FLOW_INPUT_EXT_INPUT3_3WIRE,    ///< DMX input from external 3-wire input 3. note: Not support for all chip
599     DMX_FLOW_INPUT_EXT_INPUT4_3WIRE,    ///< DMX input from external 3-wire input 4. note: Not support for all chip
600     DMX_FLOW_INPUT_EXT_INPUT5_3WIRE,    ///< DMX input from external 3-wire input 5. note: Not support for all chip
601     DMX_FLOW_INPUT_EXT_INPUT6_3WIRE,    ///< DMX input from external 3-wire input 6. note: Not support for all chip
602 
603     DMX_FLOW_INPUT_TSIO,                ///< DMX input from TSIO output
604 
605     DMX_FLOW_INPUT_EXT_INPUT6,          ///< DMX input from external input 6. note: Not support for all chip
606     DMX_FLOW_INPUT_EXT_INPUT7,          ///< DMX input from external input 7. note: Not support for all chip
607     DMX_FLOW_INPUT_EXT_INPUT7_3WIRE,    ///< DMX input from external 3-wire input 7. note: Not support for all chip
608 
609     DMX_FLOW_INPUT_DISABLE,             ///< DMX input disable
610 
611 } DMX_FLOW_INPUT;
612 
613 /// DMX output pad
614 typedef enum
615 {
616     DMX_FLOW_OUTPUT_NONE                = 0,
617     DMX_FLOW_OUTPUT_EXT_PAD1            = 1,            ///< DMX output to external pad 1
618     DMX_FLOW_OUTPUT_EXT_PAD3            = 3,            ///< DMX output to external pad 3
619 }DMX_FLOW_OUTPUT_PAD;
620 
621 /// DMX Transport Stream interface
622 typedef enum
623 {
624     DMX_TSIF_LIVE0, ///< TS interface for live streams number 0
625     DMX_TSIF_LIVE1, ///< TS interface for live streams number 1
626     DMX_TSIF_LIVE2, ///< TS interface for live streams number 2
627     DMX_TSIF_LIVE3, ///< TS interface for live streams number 3
628 
629     DMX_TSIF_FILE0, ///< TS interface for file input number 0
630     DMX_TSIF_FILE1, ///< TS interface for file input number 1
631     DMX_TSIF_FILE2, ///< TS interface for file input number 2
632     DMX_TSIF_FILE3, ///< TS interface for file input number 3
633 
634     DMX_TSIF_MMT,
635 
636     DMX_TSIF_LIVE4, ///< TS interface for live streams number 4
637     DMX_TSIF_LIVE5, ///< TS interface for live streams number 5
638     DMX_TSIF_LIVE6, ///< TS interface for live streams number 6
639 
640     DMX_TSIF_FILE4, ///< TS interface for file input number 4
641     DMX_TSIF_FILE5, ///< TS interface for file input number 5
642     DMX_TSIF_FILE6, ///< TS interface for file input number 6
643 
644     DMX_TSIF_MAX,
645 } DMX_TSIF;
646 
647 /// PVR recording engines - allow up to 6 simultaneous recordings
648 typedef enum
649 {
650     DMX_PVR_EGN0, ///< Engine 0
651     DMX_PVR_EGN1, ///< Engine 1
652     DMX_PVR_EGN2, ///< Engine 2
653     DMX_PVR_EGN3, ///< Engine 3
654     DMX_PVR_EGN4, ///< Engine 4
655     DMX_PVR_EGN5, ///< Engine 5
656 
657     DMX_PVR_TSO0,
658 
659     DMX_PVR_EGN6, ///< Engine 6
660     DMX_PVR_EGN7, ///< Engine 7
661     DMX_PVR_EGN8, ///< Engine 8
662     DMX_PVR_EGN9, ///< Engine 9
663 
664     DMX_PVR_ENG_NUM,
665 } DMX_PVR_ENG;
666 
667 #if 0
668 // make sure what you are doing before changing the value
669 /// DMX callback types
670 typedef enum
671 {
672     DMX_EVENT_DATA_READY           = 0x00000001, ///< DMX event ready
673     DMX_EVENT_BUF_OVERFLOW         = 0x00000002, ///< DMX event overflow
674     DMX_EVENT_PVRBUF_FULL          = 0x00000010, ///< DMX event PVR buffer overflow
675 
676     /// TSP self task callback // optional --> default is CB by poll
677     DMX_EVENT_CB_MASK              = 0x80000000, ///< DMX callback mask
678     DMX_EVENT_CB_POLL              = 0x00000000, ///< DMX callback by polling // OBSOLETE
679     DMX_EVENT_CB_SELF              = 0x80000000, ///< DMX callback by demux module
680     DMX_EVENT_CB_SELF_TYPE2        = 0xC0000000, ///< DMX callback by demux module , type 2
681 } DMX_EVENT;
682 #endif
683 
684 #define DMX_EVENT MS_U32                           ///< DMX event type
685 #define DMX_EVENT_DATA_READY          0x00000001UL ///< DMX event ready
686 #define DMX_EVENT_BUF_OVERFLOW        0x00000002UL ///< DMX event overflow
687 #define DMX_EVENT_SEC_CRCERROR        0x00000004UL ///< DMX event CRC error
688 #define DMX_EVENT_PVRBUF_FULL         0x00000010UL ///< DMX event PVR buffer overflow
689 #define DMX_EVENT_PVR1BUF_FULL        0x00000020UL ///< DMX event Channel Browser buffer overflow
690 #define DMX_EVENT_PVRBUF_SIZE_MET     0x00000040UL ///< DMX event PVR buffer callback size meet. note: Not support for all chips
691 
692 /// TSP self task callback                         ///< optional --> default is CB by poll
693 #define DMX_EVENT_CB_MASK             0x80000000UL ///< DMX callback mask
694 #define DMX_EVENT_CB_POLL             0x00000000UL ///< DMX callback by polling // OBSOLETE
695 #define DMX_EVENT_CB_SELF             0x80000000UL ///< DMX callback by demux module
696 #define DMX_EVENT_CB_SELF_TYPE2       0xC0000000UL ///< DMX callback by demux module
697 
698 /// DMX burst type
699 typedef enum
700 {
701     DMX_BURSTSINGLE                = 0x00, ///< Single byte
702     DMX_BURST2BYTE                 = 0x01, ///< 2 bytes
703     DMX_BURST4BYTE                 = 0x02, ///< 4 bytes
704     DMX_BURST8BYTE                 = 0x03, ///< 8 bytes
705 } DMX_BURSTTYPE;
706 
707 #if 0
708 // make sure what you are doing before changing the value
709 /// DMX section mode setting
710 typedef enum
711 {
712     DMX_SECT_MODE_CONTI            = 0x00000000, ///< DMX receive section contiguously
713     DMX_SECT_MODE_ONESHOT          = 0x00000001, ///< DMX only receive one section
714 
715     // optional
716     DMX_SECT_MODE_CRCCHK           = 0x00000002, ///< DMX enables CRC check
717     DMX_SECT_MODE_AUTO_ADDR        = 0x00000004, ///< DMX align read pointer to write pointer when get write pointer // OBSOLETE
718 } DMX_SECT_MODE;
719 #endif
720 
721 #define DMX_SECT_MODE MS_U32                           ///< DMX section mode type
722 #define DMX_SECT_MODE_CONTI               0x00000000UL ///< DMX receive section contiguously
723 #define DMX_SECT_MODE_ONESHOT             0x00000001UL ///< DMX only receive one section
724 #define DMX_SECT_MODE_PESSCMCHK           0x00000003UL ///< DMX checking PES SCMB status
725 
726 // optional
727 #define DMX_SECT_MODE_CRCCHK              0x00000002UL ///< DMX enables CRC check
728 #define DMX_SECT_MODE_AUTO_ADDR           0x00000004UL ///< DMX align read pointer to write pointer when get write pointer // OBSOLETE
729 #define DMX_SECT_MODE_AUTO_CRCCHK         0x00000008UL ///< DMX enables Auto CRC check, should not be set with DMX_SECT_MODE_CRCCHK together
730 
731 /// for MApi_DMX_AVFifo_Status return value u32FifoStatus
732 #define DMX_FIFO_STATUS            MS_U32              ///< DMX fifo status type
733 #define DMX_FIFO_STATUS_LV_MASK           0x0000000FUL ///< use this mask to get fifo level and use below macro to get current fifo status
734 #define DMX_FIFO_STATUS_LV_USAGE_MASK     0x0000000CUL ///< use this mask to get fifo level usage
735 #define DMX_FIFO_STATUS_LV_USAGE_SHIFT             2UL
736 #define DMX_FIFO_STATUS_LV_EMPTY          0x00000001UL ///< if fifo level status equal to this macro means fifo is empty
737 #define DMX_FIFO_STATUS_RST_MASK          0x80000000UL ///< use this mask to get fifo reset status
738 #define DMX_FIFO_STATUS_RST_EN            0x80000000UL ///< if fifo reset status equal to this macro means fifo reset is enabled.
739 
740 /// DMX filein Engine by path
741 typedef enum
742 {
743     DMX_FILEIN_TSIF0,    ///< File input path 0
744     DMX_FILEIN_TSIF1,    ///< File input path 1
745     DMX_FILEIN_TSIF2,    ///< File input path 2
746     DMX_FILEIN_TSIF3,    ///< File input path 3
747     DMX_FILEIN_TSIF4,    ///< File input path 4
748     DMX_FILEIN_TSIF5,    ///< File input path 5
749     DMX_FILEIN_TSIF6,    ///< File input path 6
750     DMX_FILEIN_INVALID,  ///< Invalid file input path
751 } DMX_FILEIN_PATH;
752 
753 
754 /// DMX filein destination types
755 typedef enum
756 {
757     DMX_PES_AUDIO2_FIFO     = 0,                       ///< DMX destination is audio2 fifo
758     DMX_PES_AUDIO_FIFO      = 1,                       ///< DMX destination is audio  fifo
759     DMX_PES_VIDEO_FIFO      = 2,                       ///< DMX destination is video  fifo
760     DMX_PES_NO_BYPASS_FIFO  = 3,                       ///< DMX destination with no bypass
761     DMX_PES_VIDEO3D_FIFO    = 4,                       ///< DMX destination is video3D fifo
762     DMX_PES_VIDEO2_FIFO     = DMX_PES_VIDEO3D_FIFO,    ///< DMX destination is video2  fifo
763     DMX_PES_AUDIO3_FIFO     = 5,                       ///< DMX destination is audio3 fifo
764     DMX_PES_AUDIO4_FIFO     = 6,                       ///< DMX destination is audio4 fifo
765     DMX_PES_VIDEO3_FIFO     = 7,                       ///< DMX destination is video3 fifo
766     DMX_PES_VIDEO4_FIFO     = 8,                       ///< DMX destination is video4 fifo
767     DMX_PES_AUDIO5_FIFO     = 9,                       ///< DMX destination is audio5 fifo
768     DMX_PES_AUDIO6_FIFO     = 10,                      ///< DMX destination is audio6 fifo
769     DMX_PES_VIDEO5_FIFO     = 11,                      ///< DMX destination is video5 fifo
770     DMX_PES_VIDEO6_FIFO     = 12,                      ///< DMX destination is video6 fifo
771     DMX_PES_VIDEO7_FIFO     = 13,                      ///< DMX destination is video7 fifo
772     DMX_PES_VIDEO8_FIFO     = 14,                      ///< DMX destination is video8 fifo
773 
774 } DMX_FILEIN_DST; ///<  DMXPESDATAFIFO;
775 
776 /// DMX callback prototype
777 typedef void (*DMX_NotifyCb)(MS_U8 u8DmxId, DMX_EVENT enEvent);                                ///< Callback type
778 /// DMX type 2 callback prototype
779 typedef void (*DMX_Type2NotifyCb)(MS_U8 u8DmxId, DMX_EVENT enEvent, MS_U32 NotifyParam1);      ///< Callback type 2
780 /// DMX type 2 callback prototype for filter number > 256
781 typedef void (*DMX_Type2NotifyCb_Ex)(MS_U32 u32DmxId, DMX_EVENT enEvent, void* NotifyParamEx); ///< Callback_Ex type 2
782 /// DMX callback used in copy data \ref MApi_DMX_CopyData
783 typedef MS_BOOL (*DMX_CheckCb)(MS_U8 u8DmxId, MS_U8* start, MS_U8* end, MS_U8* read, MS_U8* write);
784 
785 // dummy data structure
786 typedef struct
787 {
788     MS_U32                      streaminfo;
789 } DMX_Stream_info;
790 
791 /// DMX open information structure for filter number > 256
792 typedef struct DLL_PACKED
793 {
794     MS_U32                                  u32DmxInfoSize;  // total size of DMX_Info_EX data structure
795     DMX_FILTER_TYPE                         DmxFltType;
796 } DMX_Info_EX;
797 
798 /// DMX section filter information structure
799 #if defined(UFO_PUBLIC_HEADER_500_3)
800 typedef struct __attribute__((__packed__))
801 #else
802 typedef struct DLL_PACKED
803 #endif
804 {
805     MS_PHY                      SectBufAddr;        ///< DMX section buffer in physical address
806     MS_U32                      SectBufSize;        ///< DMX section buffer size
807     DMX_SECT_MODE               SectMode;           ///< DMX section mode
808     DMX_EVENT                   Event;              ///< DMX section event
809     DMX_NotifyCb                pNotify;            ///< DMX section callback
810 #if defined(UFO_PUBLIC_HEADER_500_3) || defined(UFO_PUBLIC_HEADER_700)
811 #if !defined (__aarch64__)
812     MS_U32                      u32AlignDummy0;   //align size for MI init share mem size check fail
813 #endif
814 #endif
815     DMX_Type2NotifyCb           pType2Notify;       ///< DMX section callback type 2
816 #if defined(UFO_PUBLIC_HEADER_500_3) || defined(UFO_PUBLIC_HEADER_700)
817 #if !defined (__aarch64__)
818     MS_U32                      u32AlignDummy1;   //align size for MI init share mem size check fail
819 #endif
820 #endif
821     MS_U32                      Type2NotifyParam1;  ///< DMX section callback type 2 user's data
822 } DMX_Sect_info;
823 
824 /// DMX section filter information structure for filter number > 256
825 typedef struct DLL_PACKED
826 {
827     MS_U32                      u32SectInfoSize;    // sizeof(DMX_Sect_info_Ex)
828     MS_PHY                      SectBufAddr;        ///< DMX section buffer in physical address
829     MS_U32                      SectBufSize;        ///< DMX section buffer size
830     DMX_SECT_MODE               SectMode;           ///< DMX section mode
831     DMX_EVENT                   Event;              ///< DMX section event
832     DMX_Type2NotifyCb_Ex        pType2Notify_Ex;    ///< DMX section callback type 2
833     void*                       pType2NotifyParamEx;///< DMX section callback type 2 user's data
834 } DMX_Sect_info_Ex;
835 
836 
837 /// DMX filter information structure
838 #if defined(UFO_PUBLIC_HEADER_500_3)
839 typedef struct __attribute__((__packed__))
840 #else
841 typedef struct DLL_PACKED
842 #endif
843 {
844     union {
845         DMX_Stream_info    StreamInfo; ///< DMX stream information for future use
846         DMX_Sect_info      SectInfo;   ///< DMX section information
847     } Info;
848 } DMX_Flt_info;
849 
850 /// DMX filter information structure for filter number > 256
851 typedef struct DLL_PACKED
852 {
853     MS_U32                  u32FltInfoSize; // sizeof(DMX_Flt_info_Ex)
854     MS_BOOL                 bSet;
855     DMX_Sect_info_Ex        SectInfoEx;
856     DMX_FILTER_TYPE         DmxFltType;
857 } DMX_Flt_info_Ex;
858 
859 /// DMX PVR information structure
860 #if defined(UFO_PUBLIC_HEADER_500_3)
861 typedef struct __attribute__((__packed__))
862 #else
863 typedef struct DLL_PACKED
864 #endif
865 {
866     MS_PHY                      pPvrBuf0;           ///< DMX PVR buffer 0 starting address
867     MS_PHY                      pPvrBuf1;           ///< DMX PVR buffer 1 starting address
868     MS_U32                      PvrBufSize0;        ///< DMX PVR buffer 0 size
869     MS_U32                      PvrBufSize1;        ///< DMX PVR buffer 1 size
870     DMX_EVENT                   Event;              ///< DMX PVR event
871     DMX_NotifyCb                pNotify;            ///< DMX PVR callback
872 
873     MS_U16                      u16CaPvrModel;      ///< DMX PVR CA mode
874     MS_BOOL                     bSpsEnable;         ///< DMX PVR CA mode
875 
876 } DMX_Pvr_info;
877 
878 /// DMX CAPVR mode
879 typedef enum
880 {
881     DMX_CA_PVR_TSP                          = 0x00000000UL,
882     DMX_CA_PVR_PROG0                        = 0x00000001UL,
883     DMX_CA_PVR_PROG1                        = 0x00000002UL,
884 }DMX_CA_PVRMODE;
885 
886 //----------------------------------
887 /// DMX debug table information structure
888 //----------------------------------
889 typedef struct DLL_PACKED
890 {
891     DMX_DEBUG_CMD               TspCmd;
892     DMX_DEBUG_SRC               TspSrc;
893     DMX_DEBUG_FIFO              TspFifo;
894 } DMX_DisContiCnt_info, DMX_DropPktCnt_info;
895 
896 typedef struct DLL_PACKED
897 {
898     DMX_DEBUG_CMD               TspCmd;
899     DMX_DEBUG_TSIF              TspTsif;
900 } DMX_LockPktCnt_info;
901 
902 typedef struct DLL_PACKED
903 {
904     DMX_DEBUG_CMD               TspCmd;
905     DMX_DEBUG_FIFO              TspFifo;
906     DMX_DEBUG_FIFO_SRC          TspFifoSrc;
907 } DMX_AVPktCnt_info;
908 
909 /// DMX capability query type, all the capabilities' info are returned by MS_U32* except DMX_CAP_*_RANGE,
910 /// and return MS_U32* data0 & data1(array) for DMX_CAP_*_RANGE
911 typedef enum
912 {
913     DMX_CAP_PID_FILTER_NUM          = 0,          ///< Get PID filter number
914     DMX_CAP_SEC_FILTER_NUM          = 1,          ///< Get section filter number
915     DMX_CAP_SEC_BUF_NUM             = 2,          ///< Get section buffer number
916 
917     DMX_CAP_PVR_ENG_NUM             = 3,          ///< Get pvr engine number
918     DMX_CAP_PVR_FILTER_NUM          = 4,          ///< Get pvr filter number
919     DMX_CAP_PVR1_FILTER_NUM         = 5,          ///< Get pvr1 filter number
920 
921     DMX_CAP_MMFI_AUDIO_FILTER_NUM   = 6,          ///< Get MM file in audio path filter number
922     DMX_CAP_MMFI_V3D_FILTER_NUM     = 7,          ///< Get MM file in video 3D path filter number
923 
924     DMX_CAP_MMFI0_FILTER_NUM        = 6,          ///< Get MM file in 0 path filter number
925     DMX_CAP_MMFI1_FILTER_NUM        = 7,          ///< Get MM file in 1 path filter number
926 
927     DMX_CAP_TSIF_NUM                = 8,          ///< Get ts interface number
928     DMX_CAP_DEMOD_NUM               = 9,          ///< Get demod support number
929     DMX_CAP_TS_PAD_NUM              = 10,         ///< Get TS pad support number
930     DMX_CAP_VQ_NUM                  = 11,         ///< Get virtual queue support number
931 
932     DMX_CAP_CA_FLT_NUM              = 12,         ///< Get descramble filter number
933     DMX_CAP_CA_KEY_NUM              = 13,         ///< Get total descramble key number
934 
935     DMX_CAP_FW_ALIGN                = 14,         ///< Get MIU alignment in bytes of DMX FW
936     DMX_CAP_VQ_ALIGN                = 15,         ///< Get MIU alignment in bytes of Virtual queue
937     DMX_CAP_VQ_PITCH                = 16,         ///< Get length in bytes in bytes of one VQ unit
938     DMX_CAP_SEC_BUF_ALIGN           = 17,         ///< Get MIU alignment in bytes of section buffer
939     DMX_CAP_PVR_ALIGN               = 18,         ///< Get miu alignment in bytes of record buffer
940 
941     DMX_CAP_PVRCA_PATH_NUM          = 19,         ///< Get the numbers of descramble record path
942 
943     DMX_CAP_SHAREKEY_FLT_RANGE      = 20,         ///< Get the range of sharekey descramble 0  filter id. data0 is start ID, data 1 is end ID
944     DMX_CAP_PVRCA0_FLT_RANGE        = 21,         ///< Get the range of PVRCA0 filter id. data0 is start ID, data 1 is end ID
945     DMX_CAP_PVRCA1_FLT_RANGE        = 22,         ///< Get the range of PVRCA1 filter id. data0 is start ID, data 1 is end ID
946     DMX_CAP_PVRCA2_FLT_RANGE        = 23,         ///< Get the range of PVRCA2 filter id. data0 is start ID, data 1 is end ID
947     DMX_CAP_SHAREKEY_FLT1_RANGE     = 24,         ///< Get the range of sharekey descramble 1 filter id. data0 is start ID, data 1 is end ID
948     DMX_CAP_SHAREKEY_FLT2_RANGE     = 25,         ///< Get the range of sharekey descramble 2 filter id. data0 is start ID, data 1 is end ID
949 
950     DMX_CAP_HW_TYPE                 = 26,         ///< Get the HW architecture type. 0xXXX0: No PVR, 0x100X: TV series, 0x200X: STB series
951 
952     DMX_CAP_RESOURCE_SIZE           = 27,         ///< Get DMX Private Resource data struct size (Share resource)
953 
954     DMX_CAP_VFIFO_NUM               = 28,         ///< Get VFIFO support number
955     DMX_CAP_AFIFO_NUM               = 29,         ///< Get AFIFO support number
956 
957     DMX_CAP_HWPCR_SUPPORT           = 30,         ///< Get HWPCR support status
958     DMX_CAP_PCRFLT_START_IDX        = 31,         ///< Get PCR start index
959     DMX_CAP_TSP_HWWP_SET_NUM        = 32,         ///< Get TSP write protect set numbers
960 
961     DMX_CAP_DSCMB_ENG_NUM           = 33,         ///< Get DSCMB engine numbers
962 
963     DMX_CAP_MAX_MERGESTR_NUM        = 34,         ///< Get Maxumum merge stream number
964 
965     DMX_CAP_MAX_SEC_FLT_DEPTH       = 35,
966     DMX_CAP_FW_BUF_SIZE             = 36,
967     DMX_CAP_FW_BUF_RANGE            = 37,
968     DMX_CAP_VQ_BUF_RANGE            = 38,
969     DMX_CAP_SEC_BUF_RANGE           = 39,
970     DMX_CAP_FIQ_NUM                 = 40,
971 
972     DMX_CAP_NULL,
973 } DMX_QUERY_TYPE;
974 
975 /// HW architecture type
976 typedef enum
977 {
978     DMX_HW_TYPE_NONE             = 0UL,
979     DMX_HW_TYPE_TV_SERIES        = 0x00001000UL,       ///< The HW architecture is TV series without PVR cunfction
980     DMX_HW_TYPE_TV_TYPE1         = 0x00001001UL,       ///< The HW architecture is TV series with Seperate PVR filters
981     DMX_HW_TYPE_TV_TYPE2         = 0x00001002UL,       ///< The HW architecture is TV series with general PVR filters
982     DMX_HW_TYPE_TV_TYPE2_CA2     = 0x00001006UL,       ///< The HW architecture is TV series with general PVR filters, with general dscmb filters, and merge stream
983     DMX_HW_TYPE_STB_SERIES       = 0x00002000UL,       ///< The HW architecture is BOX series without PVR cunfction
984     DMX_HW_TYPE_STB_TYPE1        = 0x00002001UL,       ///< The HW architecture is BOX series 1
985     DMX_HW_TYPE_STB_TYPE2        = 0x00002002UL,       ///< The HW architecture is BOX series 2
986     DMX_HW_TYPE_STB_TYPE3        = 0x00002003UL,       ///< The HW architecture is BOX series 3
987     DMX_HW_TYPE_STB_TYPE3_CASPS  = 0x80002003UL,       ///< The HW architecture is BOX series 3 with PVR CA SPS enable mode
988 } DMX_HW_TYPE;
989 
990 /// Time-stamping clock type
991 typedef enum
992 {
993     DMX_TIMESTAMP_CLK_90K       =  0x00000000UL,        ///< Original timestamp clock 90K
994     DMX_TIMESTAMP_CLK_27M       =  0x00000001UL,        ///< Original timestamp clock 27M
995 
996     DMX_TIMESTAMP_CLK_STC0_90K  =  0x00000100UL,        ///< Select STC0 90K clock for timestamp clock source
997     DMX_TIMESTAMP_CLK_STC0_27M  =  0x00000101UL,        ///< Select STC0 27M clock for timestamp clock source
998 
999     DMX_TIMESTAMP_CLK_STC1_90K  =  0x00000200UL,        ///< Select STC1 90K clock for timestamp clock source
1000     DMX_TIMESTAMP_CLK_STC1_27M  =  0x00000201UL,        ///< Select STC1 27M clock for timestamp clock source
1001 
1002     DMX_TIMESTAMP_CLK_STC2_90K  =  0x00000300UL,        ///< Select STC2 90K clock for timestamp clock source
1003     DMX_TIMESTAMP_CLK_STC2_27M  =  0x00000301UL,        ///< Select STC2 27M clock for timestamp clock source
1004 
1005     DMX_TIMESTAMP_CLK_STC3_90K  =  0x00000400UL,        ///< Select STC3 90K clock for timestamp clock source
1006     DMX_TIMESTAMP_CLK_STC3_27M  =  0x00000401UL,        ///< Select STC3 27M clock for timestamp clock source
1007 
1008     DMX_TIMESTAMP_CLK_STC4_90K  =  0x00000500UL,        ///< Select STC4 90K clock for timestamp clock source
1009     DMX_TIMESTAMP_CLK_STC4_27M  =  0x00000501UL,        ///< Select STC4 27M clock for timestamp clock source
1010 
1011     DMX_TIMESTAMP_CLK_STC5_90K  =  0x00000600UL,        ///< Select STC5 90K clock for timestamp clock source
1012     DMX_TIMESTAMP_CLK_STC5_27M  =  0x00000601UL,        ///< Select STC5 27M clock for timestamp clock source
1013 
1014     DMX_TIMESTAMP_CLK_STC6_90K  =  0x00000700UL,        ///< Select STC6 90K clock for timestamp clock source
1015     DMX_TIMESTAMP_CLK_STC6_27M  =  0x00000701UL,        ///< Select STC6 27M clock for timestamp clock source
1016 
1017     DMX_TIMESTAMP_CLK_STC7_90K  =  0x00000800UL,        ///< Select STC7 90K clock for timestamp clock source
1018     DMX_TIMESTAMP_CLK_STC7_27M  =  0x00000801UL         ///< Select STC7 27M clock for timestamp clock source
1019 
1020 } DMX_TimeStamp_Clk;
1021 
1022 /// TSP file in Packet mode
1023 typedef enum //_DMX_Filein_Packmode
1024 {
1025     DMX_PKTMODE_188         = 0x00000000UL,       ///< DMX live/file in packet size with 188 (Single stream)
1026     DMX_PKTMODE_192         = 0x00000001UL,       ///< DMX file in packet size with 192 (Single stream)
1027     DMX_PKTMODE_204         = 0x00000002UL,       ///< DMX file in packet size with 204 (Single stream)
1028     DMX_PKTMODE_130         = 0x00000003UL,       ///< DMX live/file in packet size with 130 (RVU/DSS)
1029     DMX_PKTMODE_134         = 0x00000004UL,       ///< DMX file in packet size with 134 (RVU with timestamp)
1030     DMX_PKTMODE_200         = 0x00000005UL,       ///< DMX live/file in packet size with 200 (Open cable Single stream)
1031 
1032     DMX_PKTMODE_MERG188     = 0x00000006UL,       ///< DMX live/file in packet size with 188 (Merge stream)
1033     DMX_PKTMODE_MERG192     = 0x00000007UL,       ///< DMX live/file in packet size with 192 (Merge stream)
1034     DMX_PKTMODE_MERG200     = 0x00000008UL,       ///< DMX live/file in packet size with 200 (Open cable Merge stream)
1035 
1036     DMX_PKTMODE_MXL192      = 0x00000009UL,       ///< DMX live/file in packet size with 192 (MxL 192 mode)
1037     DMX_PKTMODE_MXL196      = 0x0000000AUL,       ///< DMX live/file in packet size with 196 (MxL 196 mode)
1038     DMX_PKTMODE_MXL200      = 0x0000000BUL,       ///< DMX live/file in packet size with 196 (MxL 196 mode)
1039 
1040     DMX_PKTMODE_PES         = 0x00000100UL        ///< DMX pvr PES packet size
1041 } DMX_Filein_PacketMode;
1042 
1043 #define DMX_PacketMode DMX_Filein_PacketMode
1044 
1045 /// TSP file in information structure
1046 #if defined(UFO_PUBLIC_HEADER_500_3)
1047 typedef struct __attribute__((__packed__))
1048 #else
1049 typedef struct DLL_PACKED
1050 #endif
1051 {
1052     MS_U32                 Rate;   ///< DMX file in rate
1053     DMX_Filein_PacketMode  PKT_Mode;    ///< DMX file in packet size mode
1054 } DMX_Filein_info;
1055 
1056 /// TSP PVR record Packet mode
1057 #define DMX_Pvr_PacketMode DMX_Filein_PacketMode
1058 
1059 
1060 /// TSP Flow Input information structure
1061 /// For TSO_20 structure DMX_TSO_InputCfg
1062 #if defined(UFO_PUBLIC_HEADER_500_3)
1063 typedef struct __attribute__((__packed__))
1064 #else
1065 typedef struct DLL_PACKED
1066 #endif
1067 {
1068     DMX_FLOW_INPUT          Input;
1069     MS_BOOL                 bClkInv;
1070     MS_BOOL                 bExtSync;
1071     MS_BOOL                 bParallel;
1072 }DMX_FlowInput_Info;
1073 
1074 //MMFI Path
1075 #define DMX_MMFI_PATH       MS_U32                ///< DMX multimedia file input path type.
1076 #define DMX_MMFI_AUDIO      0UL                   ///< DMX destination with no bypass to MM Audio path
1077 #define DMX_MMFI_VIDEO      1UL                   ///< DMX destination with no bypass to MM Video path
1078 #define DMX_MMFI_PATH0      DMX_MMFI_AUDIO        ///< DMX MMFI path 0 to MM Audio path
1079 #define DMX_MMFI_PATH1      DMX_MMFI_VIDEO        ///< DMX MMFI path 1 to MM Video path
1080 
1081 /// Multimedia file input filter type
1082 /// must alignment with TSP_FIFO_XXX in halTSP.h
1083 typedef enum
1084 {
1085     DMX_MMFI_FLTTYPE_AUD    = 0x00,                   ///< Pid filter whose output is sent to Audio    decoder FIFO
1086     DMX_MMFI_FLTTYPE_AUDB   = 0x01,                   ///< Pid filter whose output is sent to Audio-B  decoder FIFO
1087     DMX_MMFI_FLTTYPE_VD3D   = 0x02,                   ///< Pid filter whose output is sent to Video 3D decoder FIFO
1088     DMX_MMFI_FLTTYPE_VD2    = DMX_MMFI_FLTTYPE_VD3D,  ///< Pid filter whose output is sent to Video-2  decoder FIFO
1089     DMX_MMFI_FLTTYPE_VD     = 0x03,                   ///< Pid filter whose output is sent to Video    decoder FIFO
1090     DMX_MMFI_FLTTYPE_AUDC   = 0x04,                   ///< Pid filter whose output is sent to Audio-C  decoder FIFO
1091     DMX_MMFI_FLTTYPE_AUDD   = 0x05,                   ///< Pid filter whose output is sent to Audio-D  decoder FIFO
1092     DMX_MMFI_FLTTYPE_VD3    = 0x06,                   ///< Pid filter whose output is sent to Video-3  decoder FIFO
1093     DMX_MMFI_FLTTYPE_VD4    = 0x07,                   ///< Pid filter whose output is sent to Video-4  decoder FIFO
1094     DMX_MMFI_FLTTYPE_AUDE   = 0x08,                   ///< Pid filter whose output is sent to Audio-E  decoder FIFO
1095     DMX_MMFI_FLTTYPE_AUDF   = 0x09,                   ///< Pid filter whose output is sent to Audio-F  decoder FIFO
1096     DMX_MMFI_FLTTYPE_VD5    = 0x0A,                   ///< Pid filter whose output is sent to Video-5  decoder FIFO
1097     DMX_MMFI_FLTTYPE_VD6    = 0x0B,                   ///< Pid filter whose output is sent to Video-6  decoder FIFO
1098     DMX_MMFI_FLTTYPE_VD7    = 0x0C,                   ///< Pid filter whose output is sent to Video-7  decoder FIFO
1099     DMX_MMFI_FLTTYPE_VD8    = 0x0D,                   ///< Pid filter whose output is sent to Video-8  decoder FIFO
1100 
1101     DMX_MMFI1_FLTTYPE_MASK  = 0x80,
1102 }DMX_MMFI_FLTTYPE;
1103 
1104 /// Multimedia file input destination
1105 typedef enum
1106 {
1107     DMX_MMFI_PES_NO_BYPASS_AU       = 0x0000, ///< No audio bypass
1108 
1109     DMX_MMFI_PES_PS_AU              = 0x0001, ///< Directly bypass file-in data to audio fifo without any check or transformation. Since there is a PES parser between audio fifo and audio decoder, the data format should be PES formated such that the file can be decoded correctly
1110     DMX_MMFI_PES_PS_AUB             = 0x0002, ///< Directly bypass file-in data to audio-B fifo without any check or transformation. Since there is a PES parser between audio-B fifo and audio decoder, the data format should be PES formated such that the data can be decoded correctly
1111 
1112     DMX_MMFI_PES_APID_BYPASS        = 0x0004, ///< Audio PES data with bypass of audio PID to audio FIFO
1113     DMX_MMFI_PES_APIDB_BYPASS       = 0x0008, ///< Audio-B PES data with bypass audio-B PID to audio-2 FIFO
1114 
1115     DMX_MMFI_PES_NO_BYPASS_V3D      = 0x0010, ///< Extract PES data from input Transport Stream to video 3D FIFO
1116     DMX_MMFI_PES_NO_BYPASS_VD2      = DMX_MMFI_PES_NO_BYPASS_V3D,
1117     DMX_MMFI_PES_PS_V3D             = 0x0020, ///< Extract PES data from input Program Stream to video 3D FIFO
1118     DMX_MMFI_PES_PS_VD2             = DMX_MMFI_PES_PS_V3D,
1119     DMX_MMFI_PES_V3DPID_BYPASS      = 0x0040, ///< Video 3D PES data with bypass of video 3D PID to video 3D FIFO
1120     DMX_MMFI_PES_V2PID_BYPASS       = DMX_MMFI_PES_V3DPID_BYPASS,
1121 
1122     DMX_MMFI_PES_NO_BYPASS_VD       = 0x0080, ///< No video bypass
1123     DMX_MMFI_PES_VPID_BYPASS        = 0x0100, ///< Directly bypass file-in data to video fifo without any check or transformation. Since there is a PES parser between video fifo and video decoder, the data format should be PES formated such that the file can be decoded correctly
1124 
1125     DMX_MMFI_PES_NO_BYPASS_TS       = 0x0200, ///< The file-in data need to be TS format. Only pid-hit packets will be sent to audio/audioB fifo. User can use MApi_DMX_MMFI_Pid_Open() to set the pid filter to audio or audioB
1126 
1127     DMX_MMFI_PES_PS_VD              = 0x0400, ///< Program stream audio PES data bypass to video FIFO
1128 
1129     DMX_MMFI_PES_PS_AUC             = 0x0800, ///< Program stream audio PES data bypass to audio-C FIFO
1130     DMX_MMFI_PES_PS_AUD             = 0x1000, ///< Program stream audio PES data bypass to audio-D FIFO
1131 
1132     DMX_MMFI_PES_PS_VD3             = 0x2000, ///< Program stream audio PES data bypass to video-3 FIFO
1133     DMX_MMFI_PES_PS_VD4             = 0x4000, ///< Program stream audio PES data bypass to video-4 FIFO
1134 
1135     DMX_MMFI_PES_PS_AUE             = 0x0003, ///< Program stream audio PES data bypass to audio-E FIFO
1136     DMX_MMFI_PES_PS_AUF             = 0x0005, ///< Program stream audio PES data bypass to audio-F FIFO
1137 
1138     DMX_MMFI_PES_PS_VD5             = 0x0006, ///< Program stream audio PES data bypass to video-5 FIFO
1139     DMX_MMFI_PES_PS_VD6             = 0x0007, ///< Program stream audio PES data bypass to video-6 FIFO
1140     DMX_MMFI_PES_PS_VD7             = 0x0009, ///< Program stream audio PES data bypass to video-7 FIFO
1141     DMX_MMFI_PES_PS_VD8             = 0x000A, ///< Program stream audio PES data bypass to video-8 FIFO
1142 
1143     DMX_MMFI1_PES_TYPE_MASK         = 0x8000,   ///<  Must set, when using MMFI1 path
1144 }DMX_MMFI_DST;
1145 
1146 /// DMX TSO Clk
1147 typedef enum
1148 {
1149     E_DMX_TSO_OUTCLK_DIV2N,
1150     E_DMX_TSO_OUTCLK_DIVN,
1151     E_DMX_TSO_OUTCLK_62M,
1152     E_DMX_TSO_OUTCLK_54M,
1153     E_DMX_TSO_OUTCLK_PTSOOUT,
1154     E_DMX_TSO_OUTCLK_PTSOOUT_DIV8,
1155     E_DMX_TSO_OUTCLK_Dmd,
1156     E_DMX_TSO_OUTCLK_27M,
1157     E_DMX_TSO_OUTCLK_108M,
1158     E_DMX_TSO_OUTCLK_123M,
1159 }DMX_TSO_OutClk;
1160 
1161 /// DMX TSO Clk Source
1162 typedef enum
1163 {
1164     E_DMX_TSO_OUTCLKSRC_172M_2N,    ///< E_DMX_TSO_OUTCLK_DIV2N
1165     E_DMX_TSO_OUTCLKSRC_288M_2N,    ///< E_DMX_TSO_OUTCLK_DIV2N
1166     E_DMX_TSO_OUTCLKSRC_432M_2N,    ///< E_DMX_TSO_OUTCLK_DIV2N
1167     E_DMX_TSO_OUTCLKSRC_216M_N,     ///< E_DMX_TSO_OUTCLK_DIVN
1168     E_DMX_TSO_OUTCLKSRC_P_TS0IN,    ///< E_DMX_TSO_OUTCLK_PTSOOUT or E_DMX_TSO_OUTCLK_PTSOOUT_DIV8
1169     E_DMX_TSO_OUTCLKSRC_P_TS1IN,    ///< E_DMX_TSO_OUTCLK_PTSOOUT or E_DMX_TSO_OUTCLK_PTSOOUT_DIV8
1170     E_DMX_TSO_OUTCLKSRC_P_TS2IN,    ///< E_DMX_TSO_OUTCLK_PTSOOUT or E_DMX_TSO_OUTCLK_PTSOOUT_DIV8
1171     E_DMX_TSO_OUTCLKSRC_P_TS3IN,    ///< E_DMX_TSO_OUTCLK_PTSOOUT or E_DMX_TSO_OUTCLK_PTSOOUT_DIV8
1172     E_DMX_TSO_OUTCLKSRC_P_TS4IN,    ///< E_DMX_TSO_OUTCLK_PTSOOUT or E_DMX_TSO_OUTCLK_PTSOOUT_DIV8
1173     E_DMX_TSO_OUTCLKSRC_P_TS5IN,    ///< E_DMX_TSO_OUTCLK_PTSOOUT or E_DMX_TSO_OUTCLK_PTSOOUT_DIV8
1174 }DMX_TSO_OutClkSrc;
1175 
1176 /// DMX TSO output packet size config. For TSO_20
1177 typedef enum
1178 {
1179     E_DMX_TSO_CFG_NONE         = 0x00000000UL,
1180     E_DMX_TSO_CFG_OPIF         = 0x00000001UL,
1181 }DMX_TSO_CfgCmd;
1182 
1183 /// DMX TSO Input Config. For TSO_20
1184 #if defined(UFO_PUBLIC_HEADER_500_3)
1185 typedef struct __attribute__((__packed__))
1186 #else
1187 typedef struct DLL_PACKED
1188 #endif
1189 {
1190     MS_U32                  u32Res;
1191     DMX_FLOW                eFlow;
1192     DMX_TSIF                eTSOInIf;
1193     DMX_FlowInput_Info      stInputInfo;
1194     MS_U8                   u8LocalStrId;
1195     MS_BOOL                 bBypassAll;
1196     MS_BOOL                 bEnable;
1197     MS_BOOL                 bSet;
1198 }DMX_TSO_InputCfg;
1199 
1200 /// DMX TSO Output Config. For TSO_20
1201 #if defined(UFO_PUBLIC_HEADER_500_3)
1202 typedef struct __attribute__((__packed__))
1203 #else
1204 typedef struct DLL_PACKED
1205 #endif
1206 {
1207     MS_U32                  u32Res;
1208     DMX_FLOW                eFlow;
1209     DMX_FLOW_OUTPUT_PAD     eOutPad;
1210     MS_U16                  u16OutPktSize;
1211     MS_BOOL                 bEnable;
1212 
1213     MS_BOOL                 bDefOutClk;
1214     MS_BOOL                 bOutClkInv;
1215     DMX_TSO_OutClk          eTsoOutClk;
1216     DMX_TSO_OutClkSrc       eTsoOutClkSrc;
1217     MS_U16                  u16DivNum;
1218     MS_BOOL                 bSet;
1219 }DMX_TSO_OutputCfg;
1220 
1221 /// DMX TSO Config. For TSO_20
1222 typedef struct DLL_PACKED
1223 {
1224     MS_U32                  u32Res;
1225     MS_U32                  u32TsoEng;
1226     MS_U32                  u32TsoCfgDataSize;  // total size of DMX_TSO_Cfg data structure
1227     MS_BOOL                 bSet;
1228 
1229     DMX_TSO_CfgCmd          eCfgCmd;
1230     MS_U32                  u32CmdData0;
1231 }DMX_TSO_Cfg;
1232 
1233 /// DMX FQ init infomation
1234 #if defined(UFO_PUBLIC_HEADER_500_3)
1235 typedef struct __attribute__((__packed__))
1236 #else
1237 typedef struct DLL_PACKED
1238 #endif
1239 {
1240     MS_U8    u8AddrMode;
1241     MS_PHY   u32BufStart;
1242     MS_U32   u32BufSize;
1243 } DMX_FQ_Info;
1244 
1245 /// File-in Queue data path skipping options
1246 typedef enum
1247 {
1248     E_DMX_FQ_SKIP_RUSH_DATA_PATH_NON        = 0x00000000UL, ///< None
1249     E_DMX_FQ_SKIP_APES_RUSH_DATA            = 0x00000008UL, ///< Audio-A data are filtered out
1250     E_DMX_FQ_SKIP_APES_B_RUSH_DATA          = 0x00000010UL, ///< Audio-B data are filtered out
1251     E_DMX_FQ_SKIP_VPES_RUSH_DATA            = 0x00000020UL, ///< Video data are filtered out
1252     E_DMX_FQ_SKIP_SEC_RUSH_DATA             = 0x00000040UL, ///< Sections data are filtered out
1253     E_DMX_FQ_SKIP_ADP_RUSH_DATA             = 0x00000080UL, ///< Reserved
1254     E_DMX_FQ_SKIP_PCR_RUSH_DATA             = 0x00000100UL, ///< PCR data is filtered out
1255     E_DMX_FQ_SKIP_RASP_RUSH_DATA            = 0x00000200UL, ///< RASP data are filtered out
1256     E_DMX_FQ_SKIP_PVR1_RUSH_DATA            = E_DMX_FQ_SKIP_RASP_RUSH_DATA,
1257     E_DMX_FQ_SKIP_PCR1_RUSH_DATA            = 0x00001000UL,
1258     E_DMX_FQ_SKIP_PVR3_RUSH_DATA            = E_DMX_FQ_SKIP_PCR1_RUSH_DATA,
1259     E_DMX_FQ_SKIP_CFG1_MASK                 = 0x80000000UL,
1260     E_DMX_FQ_SKIP_APES_C_RUSH_DATA          = 0x80000008UL, ///< Audio-C data are filtered out
1261     E_DMX_FQ_SKIP_APES_D_RUSH_DATA          = 0x80000010UL, ///< Audio-D data are filtered out
1262     E_DMX_FQ_SKIP_V3DPES_RUSH_DATA          = 0x80000020UL, ///< Video3D data are filtered out
1263     E_DMX_FQ_SKIP_V2PES_RUSH_DATA           = E_DMX_FQ_SKIP_V3DPES_RUSH_DATA,
1264     E_DMX_FQ_SKIP_PVR2_RUSH_DATA            = 0x80000200UL,
1265 }DMX_FQ_SkipPath;
1266 
1267 /// File-in Queue configuration options
1268 typedef enum
1269 {
1270     E_DMX_FQ_CFG_NONE                       = 0x00000000UL, ///< None
1271     E_DMX_FQ_CFG_SEL_SRCMUX                 = 0x000000001L, ///< File-in queue source selection
1272     E_DMX_FQ_CFG_FLT_NULL_PKT               = 0x000000002L
1273 
1274 }DMX_FQ_CfgCmd;
1275 
1276 /// File-in Queue configuration information
1277 #if defined(UFO_PUBLIC_HEADER_500_3)
1278 typedef struct __attribute__((__packed__))
1279 #else
1280 typedef struct DLL_PACKED
1281 #endif
1282 {
1283     MS_U32              u32Res;          ///< result field
1284     MS_U32              u32FQEng;        ///< File-in queue engine Id
1285     MS_U32              u32CfgDataSize;  ///< total size of DMX_FQ_Cfg data structure
1286     MS_BOOL             bSet;            ///< set (TRUE) or get (FALSE)
1287     DMX_FQ_CfgCmd       eCfgCmd;         ///< command field
1288     DMX_TSIF            eFqSrcSel;       ///< File-in queue source selection (transport stream input interface Id)
1289 }DMX_FQ_Cfg;
1290 
1291 /// DMX TEI  Remove Error Packet Infomation
1292 typedef enum
1293 {
1294     E_DMX_TEI_REMOVE_AUDIO_PKT,     ///< DMX TEI Remove Audio Packet
1295     E_DMX_TEI_REMOVE_VIDEO_PKT,     ///< DMX TEI Remove Video Packet
1296 
1297     E_DMX_TEI_REMOVE_PKT0_LIVE,
1298     E_DMX_TEI_REMOVE_PKT0_FILE,
1299     E_DMX_TEI_REMOVE_PKT1,
1300     E_DMX_TEI_REMOVE_PKT2,
1301 
1302     E_DMX_TEI_REMOVE_AUDIO2_PKT,    ///< DMX TEI Remove AudioB  Packet
1303     E_DMX_TEI_REMOVE_AUDIO3_PKT,    ///< DMX TEI Remove Audio3  Packet
1304     E_DMX_TEI_REMOVE_AUDIO4_PKT,    ///< DMX TEI Remove Audio4  Packet
1305 
1306     E_DMX_TEI_REMOVE_VIDEO2_PKT,    ///< DMX TEI Remove Video2  Packet
1307     E_DMX_TEI_REMOVE_VIDEO3_PKT ,   ///< DMX TEI Remove Video3  Packet
1308     E_DMX_TEI_REMOVE_VIDEO4_PKT ,   ///< DMX TEI Remove Video4  Packet
1309 
1310 }DMX_TEI_RmPktType;
1311 
1312 // DMX_RES_ALLOC_EN
1313 typedef enum
1314 {
1315     DMX_RES_NONE,
1316     DMX_RES_STC_ENG,                ///< STC engine: return data type (MS_U32)
1317     DMX_RES_FLOW_PB_LIVE,           ///< Live-in playback path: return data type (DMX_FLOW) , DMX_FLOW_PLAYBACK ~ DMX_FLOW_PLAYBACK3
1318     DMX_RES_FLOW_PB_FILE,           ///< File-in playback path: return data type (DMX_FLOW) , DMX_FLOW_PLAYBACK ~ DMX_FLOW_PLAYBACK3
1319     DMX_RES_FLOW_MMFI               ///< MMFI path: return data type (DMX_FLOW) , DMX_FLOW_MMFI0 ~ DMX_FLOW_MMFI1
1320 }DMX_RES_TYPE;
1321 
1322 //STC update Control Parameters define
1323 #define eStcUpdateCtrlMode                  MS_U8 ///< STC update control options
1324 #define DMX_STC_UPDATE_FW                   0x00  ///< Update STC by TSP FW (STC is updated by TSP FW running at AEON processor)
1325 #define DMX_STC_UPDATE_HK                   0x01  ///< Update STC by HK (STC is updated by TSP utopia driver running at ARM/MIPS processor)
1326 #define DMX_STC_UPDATE_UPDATEONCE           0x02  ///< Update STC Once when PCR reset
1327 
1328 //S2P Clock Option
1329 #define eS2PClkOpt                          MS_U32
1330 #define S2P_CLK_OPT_NONE                    0x00000000
1331 #define S2P_CLK_OPT_INVERT                  0x00000001
1332 #define S2P_CLK_OPT_NON_INVERT              0x00000002
1333 
1334 // Policy Manager
1335 typedef enum
1336 {
1337     DMX_PIPEID_GRP_NONE,
1338     DMX_PIPEID_GRP_PVR,
1339     DMX_PIPEID_GRP_FILE,
1340     DMX_PIPEID_GRP_MMFI,
1341     DMX_PIPEID_GRP_MAX_NUM,
1342 }DMX_PIPEID_GROUP;
1343 
1344 typedef union GENERAL_ENGID{
1345     DMX_PVR_ENG             PvrEng;         ///< PVR engine
1346     DMX_FILEIN_PATH         FileinPath;     ///< Filein Path
1347     DMX_MMFI_PATH           MmfiPath;
1348 } DMX_GENERAL_ENGID;
1349 
1350 ////////////////////////////////////////////////////////////////////////////////
1351 // include utopia v2  header files here
1352 ////////////////////////////////////////////////////////////////////////////////
1353 #ifdef DMX_UTOPIA_20
1354 #include "apiDMX_v2.h"
1355 #endif
1356 
1357 //-------------------------------------------------------------------------------------------------
1358 /// Initialize lib resource API
1359 /// @ingroup TSP_General
1360 /// @param pu32ResMemAddr       \b IN: Pointer to store resource memory addresses
1361 /// @return DMX_FILTER_STATUS_OK - Success
1362 /// @return DMX_FILTER_STATUS_ERROR - Failure
1363 //-------------------------------------------------------------------------------------------------
1364  DMX_FILTER_STATUS MApi_DMX_InitLibResource(void *pResMemAddr);
1365 //-------------------------------------------------------------------------------------------------
1366 /// Set TSP firmware address and size.
1367 /// @ingroup TSP_General
1368 /// @param pFwAddr       \b IN: TSP firmware address in DRAM physical address
1369 /// @param u32FwSize     \b IN: TSP firmware size
1370 /// @return DMX_FILTER_STATUS_OK - Success
1371 /// @return DMX_FILTER_STATUS_ERROR - Failure
1372 /// @note It should be called before calling any other Demux API functions.
1373 //-------------------------------------------------------------------------------------------------
1374 DMX_FILTER_STATUS MApi_DMX_SetFW(MS_PHY pFwAddr, MS_U32 u32FwSize); // In DRAM physical address
1375 //-------------------------------------------------------------------------------------------------
1376 /// Set the MIU address for TSP aeon (firmware) used.
1377 /// @ingroup TSP_General
1378 /// @param phyDataAddr       \b IN: MIU phsyical address
1379 /// @param u32size           \b IN: MIU buffer size
1380 /// @return DMX_FILTER_STATUS_OK - Success
1381 /// @return DMX_FILTER_STATUS_ERROR - Failure
1382 //-------------------------------------------------------------------------------------------------
1383 DMX_FILTER_STATUS MApi_DMX_SetFwDataAddr(MS_PHY phyDataAddr, MS_U32 u32size);
1384 /// Set TSP is work on HK or AEON.
1385 /// @ingroup TSP_General
1386 /// @param bIsHK       \b IN: TRUE: HK, FALSE: AEON
1387 /// @return DMX_FILTER_STATUS_OK - Success
1388 /// @return DMX_FILTER_STATUS_ERROR - Failure
1389 //-------------------------------------------------------------------------------------------------
1390 DMX_FILTER_STATUS MApi_DMX_SetHK(MS_BOOL bIsHK); // OBSOLETE
1391 //-------------------------------------------------------------------------------------------------
1392 /// Initialize Demux module.
1393 /// @ingroup TSP_General
1394 /// @return DMX_FILTER_STATUS_OK - Success
1395 /// @return DMX_FILTER_STATUS_ERROR - Failure
1396 /// @note It should be called before calling any other Demux API functions.
1397 //-------------------------------------------------------------------------------------------------
1398 DMX_FILTER_STATUS MApi_DMX_Init(void);
1399 //-------------------------------------------------------------------------------------------------
1400 /// Get init parameters of MApi_DMX_TSPInit
1401 /// @ingroup TSP_General
1402 /// @param pstParam       \b OUT: init parameters
1403 /// @return UTOPIA_STATUS_ERR_NOT_AVAIL: DMX not system init
1404 /// @return UTOPIA_STATUS_ERR_NOT_AVAIL: DMX system init ready
1405 //-------------------------------------------------------------------------------------------------
1406 MS_U32 SYMBOL_WEAK MApi_DMX_TSPInit_GetConfig(DMX_TSPParam *pstParam);
1407 //-------------------------------------------------------------------------------------------------
1408 /// Initialize Demux API for Virtual Quere Enable
1409 /// @ingroup TSP_General
1410 /// @param param          \b IN: Init Virtual Quere Setting
1411 /// @return DMX_FILTER_STATUS_OK - Success
1412 /// @return DMX_FILTER_STATUS_ERROR - Failure
1413 /// @note if want to use virtual quere, please call this API after calling MApi_DMX_Init. (VQ does not support for all chip)
1414 //-------------------------------------------------------------------------------------------------
1415 DMX_FILTER_STATUS MApi_DMX_TSPInit(DMX_TSPParam *param);
1416 //-------------------------------------------------------------------------------------------------
1417 /// Exit Demux API
1418 /// @ingroup TSP_General
1419 /// @return DMX_FILTER_STATUS_OK - Success
1420 /// @return DMX_FILTER_STATUS_ERROR - Failure
1421 //-------------------------------------------------------------------------------------------------
1422 DMX_FILTER_STATUS MApi_DMX_Exit(void);
1423 
1424 //-------------------------------------------------------------------------------------------------
1425 /// Force exit Demux API
1426 /// @ingroup TSP_General
1427 /// @return DMX_FILTER_STATUS_OK - Success
1428 /// @return DMX_FILTER_STATUS_ERROR - Failure
1429 /// @note It is special case for MM
1430 ///-------------------------------------------------------------------------------------------------
1431 DMX_FILTER_STATUS MApi_DMX_ForceExit(void);
1432 //-------------------------------------------------------------------------------------------------
1433 /// Save DMX driver states to DRAM.
1434 /// @ingroup DMX_STR
1435 /// @return DMX_FILTER_STATUS_OK - Success
1436 /// @return DMX_FILTER_STATUS_ERROR - Failure
1437 //-------------------------------------------------------------------------------------------------
1438 DMX_FILTER_STATUS MApi_DMX_Suspend(void);
1439 //-------------------------------------------------------------------------------------------------
1440 /// Restore DMX driver states from DRAM. And TSP need input the firmware info. to reload TSP FW.
1441 /// @ingroup DMX_STR
1442 /// @param phyFWAddr     \b IN: TSP firmware load address
1443 /// @param u32FWSize      \b IN: TSP firmware size
1444 /// @return DMX_FILTER_STATUS_OK - Success
1445 /// @return DMX_FILTER_STATUS_ERROR - Failure
1446 //-------------------------------------------------------------------------------------------------
1447 DMX_FILTER_STATUS MApi_DMX_Resume(MS_PHY phyFWAddr, MS_U32 u32FWSize);
1448 //-------------------------------------------------------------------------------------------------
1449 /// Check TSP is alive or not. (Firmware)
1450 /// @ingroup TSP_General
1451 /// @return DMX_FILTER_STATUS_OK - Success
1452 /// @return DMX_FILTER_STATUS_ERROR - Failure
1453 //-------------------------------------------------------------------------------------------------
1454 DMX_FILTER_STATUS MApi_DMX_ChkAlive(void);
1455 
1456 //-------------------------------------------------------------------------------------------------
1457 /// Reset TSP and MM. It will reset all filter and do HW reset.
1458 /// @ingroup TSP_General
1459 /// @return DMX_FILTER_STATUS_OK - Success
1460 /// @return DMX_FILTER_STATUS_ERROR - Failure
1461 //-------------------------------------------------------------------------------------------------
1462 DMX_FILTER_STATUS MApi_DMX_Reset(void);
1463 
1464 //-------------------------------------------------------------------------------------------------
1465 /// Release TSP driver HW lock semaphone
1466 /// @ingroup TSP_General
1467 /// @return DMX_FILTER_STATUS_OK - Success
1468 /// @return DMX_FILTER_STATUS_ERROR - Failure
1469 //-------------------------------------------------------------------------------------------------
1470 DMX_FILTER_STATUS MApi_DMX_ReleaseSemaphone(void);
1471 
1472 //-------------------------------------------------------------------------------------------------
1473 /// Enable/Disable TSP MIU internal write protect. Include PVR record buffer and section buffer.
1474 /// @ingroup TSP_General
1475 /// @param bEnable          \b IN: Enable/Disable protect
1476 /// @param pphyStartAddr    \b IN: Protect start address. Array[0-3]: [0]: PVR, [1-2]: Section, [3]: PVR1
1477 /// @param pphyEndAddr      \b IN: Protect end address. Array[0-3]: [0]: PVR, [1-2]: Section, [3]: PVR1
1478 /// @return DMX_FILTER_STATUS_OK - Success
1479 /// @return DMX_FILTER_STATUS_ERROR - Failure
1480 //-------------------------------------------------------------------------------------------------
1481 void              MApi_DMX_WriteProtect_Enable(MS_BOOL bEnable, MS_PHY* pphyStartAddr, MS_PHY* pphyEndAddr);
1482 
1483 //-------------------------------------------------------------------------------------------------
1484 /// Enable/Disable Demux MIU internal Firmware write protect.
1485 /// @ingroup TSP_General
1486 /// @param bEnable          \b IN: Enable/Disable protect
1487 /// @param phyStartAddr     \b IN: Protect start address.
1488 /// @param phyEndAddr       \b IN: Protect end address.
1489 /// @return DMX_FILTER_STATUS_OK - Success
1490 /// @return DMX_FILTER_STATUS_ERROR - Failure
1491 //-------------------------------------------------------------------------------------------------
1492 void              MApi_DMX_OrzWriteProtect_Enable(MS_BOOL bEnable, MS_PHY phyStartAddr, MS_PHY phyEndAddr);
1493 
1494 //-----------------
1495 // DMX_ToBeRemove
1496 //-----------------
1497 //-------------------------------------------------------------------------------------------------
1498 /// Read drop packet count of AV due to duplicate. (Use new debug function to get this information)
1499 /// @ingroup DMX_ToBeRemove
1500 /// @param  eDmxPktType       \b IN: The packet type wihch want to remove
1501 /// @param  bEnable           \b IN: Enable or Disable
1502 /// @return DMX_FILTER_STATUS_OK - Success
1503 /// @return DMX_FILTER_STATUS_ERROR - Failure
1504 //-------------------------------------------------------------------------------------------------
1505 DMX_FILTER_STATUS MApi_DMX_Read_DropPktCnt(MS_U16* pu16ADropCnt, MS_U16* pu16VDropCnt);
1506 
1507 //-------------------------------------------------------------------------------------------------
1508 /// Control DMX STR functions.
1509 /// @ingroup DMX_STR
1510 /// @param  u16PowerState  \b IN: STR power mode. (to control STR suspend & resume case.)
1511 /// @param phyFWAddr       \b IN: TSP firmware load address
1512 /// @param u32FWSize       \b IN: TSP firmware size
1513 /// @return : Utopia status - UTOPIA_STATUS_SUCCESS (Succeed) or UTOPIA_STATUS_FAIL (Fail)
1514 //-------------------------------------------------------------------------------------------------
1515 MS_U32            MApi_DMX_SetPowerState(EN_POWER_MODE u16PowerState, MS_PHY phyFWAddr, MS_U32 u32FWSize);
1516 
1517 //-------------------------------------------------------------------------------------------------
1518 /// @brief Remove TEI error packet
1519 /// @param eDmxPktType \b IN: DMX remove packet type
1520 /// @param bEnable     \b IN: TRUE: enable the feature, FALSE: disable it
1521 /// @return DMX_FILTER_STATUS_OK Success
1522 /// @return DMX_FILTER_STATUS_ERROR Failure
1523 //-------------------------------------------------------------------------------------------------
1524 DMX_FILTER_STATUS MApi_DMX_TEI_RemoveErrorPkt(DMX_TEI_RmPktType eDmxPktType, MS_BOOL bEnable);
1525 
1526 //-------------------------------------------------------------------------------------------------
1527 /// Set Demux Flow packet mode
1528 /// @ingroup TSP_General
1529 /// @param DmxFlow   \b IN: TSP flow path
1530 /// @param ePktMode  \b IN: Packet mode of flow path.
1531 /// @return DMX_FILTER_STATUS_OK - Success
1532 /// @return DMX_FILTER_STATUS_ERROR - Failure
1533 //-------------------------------------------------------------------------------------------------
1534 DMX_FILTER_STATUS MApi_DMX_SetPacketMode(DMX_FLOW DmxFlow, DMX_PacketMode ePktMode);
1535 
1536 //-------------------------------------------------------------------------------------------------
1537 /// Set Sync Byte value to Stream source ID or TS source ID.
1538 /// @ingroup TSP_Merge
1539 /// @param u32SrcID       \b IN: Index of stream source id or TS source id
1540 /// @param u8SyncByte     \b IN: Sync byte, defalut value is 0x47
1541 /// @return DMX_FILTER_STATUS_OK - Success
1542 /// @return DMX_FILTER_STATUS_ERROR - Failure
1543 /// @note:  u32SrcID - Stream source ID is from 0 ~7
1544 ///                              TS source ID is mapping TSIF index
1545 //-------------------------------------------------------------------------------------------------
1546 DMX_FILTER_STATUS MApi_DMX_SetMergeStrSyncByte(MS_U32 u32SrcID, MS_U8 u8SyncByte);
1547 
1548 //-------------------------------------------------------------------------------------------------
1549 /// Set enable/disable drop scramble packet of FIFO/PVR. If enable, scramble packet can't pass through FIFO/PVR.
1550 /// @ingroup TSP_General
1551 /// @param  pDmxFltType     \b IN: Type select: FIFO or PVR
1552 /// @param  bEnable         \b IN: Enable/Disable
1553 /// @return DMX_FILTER_STATUS_OK - Success
1554 /// @return DMX_FILTER_STATUS_ERROR - Failure
1555 //-------------------------------------------------------------------------------------------------
1556 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_DropScmbPkt(DMX_FILTER_TYPE pDmxFltType, MS_BOOL bEnable);
1557 
1558 //-------------------------------------------------------------------------------------------------
1559 /// Allocate DMX resource
1560 /// @ingroup TSP_General
1561 /// @param eResType      \b IN: Resource type to allocate
1562 /// @param pRes          \b OUT: Pointer to store resource content
1563 /// @return DMX_FILTER_STATUS_OK - Success
1564 /// @return DMX_FILTER_STATUS_ERROR - Failure
1565 /// @note
1566 //-------------------------------------------------------------------------------------------------
1567 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_ResAllocate(DMX_RES_TYPE eResType, void *pRes);
1568 
1569 //-------------------------------------------------------------------------------------------------
1570 /// Free  DMX resource
1571 /// @ingroup TSP_General
1572 /// @param eResType         \b IN: Resource type to free
1573 /// @param pRes             \b IN: Pointer to store resource content
1574 /// @return DMX_FILTER_STATUS_OK - Success
1575 /// @return DMX_FILTER_STATUS_ERROR - Failure
1576 /// @note
1577 //-------------------------------------------------------------------------------------------------
1578 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_ResFree(DMX_RES_TYPE eResType, void *pRes);
1579 
1580 //-------------------------------------------------------------------------------------------------
1581 /// Get STC engine which PCR PID index mapping to
1582 /// @ingroup TSP_General
1583 /// @param u32PcrFltId                \b IN: PCR PID index
1584 /// @param pu32StcEng                 \b OUT: STC engine id
1585 /// @return DMX_FILTER_STATUS_OK - Success
1586 /// @return DMX_FILTER_STATUS_ERROR - Failure
1587 /// @note
1588 //-------------------------------------------------------------------------------------------------
1589 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_Pcr_Get_MapSTC(MS_U32 u32PcrFltId, MS_U32 *pu32StcEng);
1590 
1591 // owner ship set/checking
1592 //--------------------------------------------------------------------------------------------------
1593 /// Set demux filter owner.
1594 /// @ingroup TSP_General
1595 /// @param  u32DmxIdStart     \b IN: Demux filter start index
1596 /// @param  u32DmxIdEnd       \b IN: Demux filter end index
1597 /// @param  bOwner            \b IN: TRUE for owner, FALSE for not owner
1598 /// @return DMX_FILTER_STATUS_OK - Success
1599 /// @return DMX_FILTER_STATUS_ERROR - Failure
1600 //--------------------------------------------------------------------------------------------------
1601 DMX_FILTER_STATUS MApi_DMX_SetOwner(MS_U32 u32DmxIdStart, MS_U32 u32DmxIdEnd, MS_BOOL bOwner); //OBSOLETE
1602 
1603 //--------------------------------------------------------------------------------------------------
1604 /// Query DMX specific hardware capability.
1605 /// @ingroup TSP_General
1606 /// @param  DmxQueryType           \b IN: query type
1607 /// @param  pOutput                \b OUT: answer of query type
1608 /// @return DMX_FILTER_STATUS_OK - Success
1609 /// @return DMX_FILTER_STATUS_ERROR - Failure
1610 //--------------------------------------------------------------------------------------------------
1611 DMX_FILTER_STATUS MApi_DMX_GetCap(DMX_QUERY_TYPE DmxQueryType, void* pOutput);
1612 
1613 //-----------------
1614 // DMX_ToBeModified
1615 //-----------------
1616 //--------------------------------------------------------------------------------------------------
1617 /// Query DMX specific hardware capability by string type.
1618 /// @ingroup DMX_ToBeModified_TSP
1619 /// @param  pstrQueryType          \b IN: String of capability item
1620 /// @param  s32Strlen              \b IN: String size of capability item
1621 /// @param  pOutput                \b OUT: answer of query type
1622 /// @param  ps32OutSize            \b OUT: Output data length
1623 /// @return DMX_FILTER_STATUS_OK - Success
1624 /// @return DMX_FILTER_STATUS_ERROR - Failure
1625 /// @note:  Keep MApi_DMX_GetCap function and refine interface for parameter
1626 //--------------------------------------------------------------------------------------------------
1627  DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_GetCap_Ex(char* pstrQueryType, MS_S32 s32Strlen, void* pOutput, MS_S32* ps32OutSize);
1628 
1629 //-------------------------------------------------------------------------------------------------
1630 /// Invert Demux parallel input bit order
1631 /// @ingroup TSP_General
1632 /// @param DmxFlow       \b IN: TSP flow path
1633 /// @param bInvert       \b IN: Invert bit order of TS parallel in. (TRUE: Invert, FALSE: Not invert)
1634 /// @return DMX_FILTER_STATUS_OK - Success
1635 /// @return DMX_FILTER_STATUS_ERROR - Failure
1636 //------------------------------------------------------------------------------------------------
1637 DMX_FILTER_STATUS MApi_DMX_Parl_Invert(DMX_FLOW DmxFlow, MS_BOOL bInvert);
1638 
1639 //-------------------------------------------------------------------------------------------------
1640 /// Set Demux DMA burst length.
1641 /// @ingroup TSP_General
1642 /// @param BurstType    \b IN: Burst length
1643 /// @return DMX_FILTER_STATUS_OK - Success
1644 /// @return DMX_FILTER_STATUS_ERROR - Failure
1645 //------------------------------------------------------------------------------------------------
1646 DMX_FILTER_STATUS MApi_DMX_SetBurstLen(DMX_BURSTTYPE BurstType);
1647 
1648 //-------------------------------------------------------------------------------------------------
1649 /// Enable/Disable TSP VQ.
1650 /// @ingroup TSP_General
1651 /// @param bEnable        \b IN: Enable/Disable
1652 /// @return DMX_FILTER_STATUS_OK - Success
1653 /// @return DMX_FILTER_STATUS_ERROR - Failure
1654 //-------------------------------------------------------------------------------------------------
1655  DMX_FILTER_STATUS MApi_DMX_VQ_Enable(MS_BOOL bEnable);
1656 
1657 //-----------------
1658 // TSP_Flow
1659 //-----------------
1660 //-------------------------------------------------------------------------------------------------
1661 /// Set Demux Flow config.
1662 /// @ingroup TSP_Flow
1663 /// @param DmxFlow          \b IN: TSP flow path
1664 /// @param DmxFlowInput     \b IN: Input port. (ex: external pad0, internal demod...etc)
1665 /// @param bClkInv          \b IN: TS-in options: clock phase inversion
1666 /// @param bExtSync         \b IN: TS-in options: sync by external signal
1667 /// @param bParallel        \b IN: TS-in is parallel interface or serial interface
1668 /// @return DMX_FILTER_STATUS_OK - Success
1669 /// @return DMX_FILTER_STATUS_ERROR - Failure
1670 //-------------------------------------------------------------------------------------------------
1671 DMX_FILTER_STATUS MApi_DMX_FlowSet(DMX_FLOW DmxFlow, DMX_FLOW_INPUT DmxFlowInput, MS_BOOL bClkInv, MS_BOOL bExtSync, MS_BOOL bParallel);
1672 
1673 //--------------------------------------------------------------------------------------------------
1674 /// Setting PVR flow.
1675 /// @ingroup TSP_Flow
1676 /// @param  Eng              \b IN: PVR Engine ID
1677 /// @param  ePvrSrcTSIf      \b IN: Select the record source
1678 /// @param  bDscmbRec        \b IN: TRUE for recording dscmbled stream; FALSE for recording orignal stream
1679 /// @return DMX_FILTER_STATUS_OK - Success
1680 /// @return DMX_FILTER_STATUS_ERROR - Failure
1681 //--------------------------------------------------------------------------------------------------
1682 DMX_FILTER_STATUS MApi_DMX_PVR_FlowSet(DMX_PVR_ENG Eng, DMX_TSIF ePvrSrcTSIf, MS_BOOL bDscmbRec);
1683 
1684 //-------------------------------------------------------------------------------------------------
1685 /// Get Demux Flow setting.
1686 /// @ingroup TSP_Flow
1687 /// @param DmxFlow            \b IN: TSP flow path
1688 /// @param pDmxFlowInput      \b OUT: pointer to store DMX input flow value.
1689 /// @param pbClkInv           \b OUT: pointer to store clock phase inversion
1690 /// @param pbExtSync          \b OUT: pointer to store sync by external signal
1691 /// @param pbParallel         \b OUT: pointer to store parallel interface or serial interface
1692 /// @return DMX_FILTER_STATUS_OK - Success
1693 /// @return DMX_FILTER_STATUS_ERROR - Failure
1694 //-------------------------------------------------------------------------------------------------
1695 DMX_FILTER_STATUS MApi_DMX_Get_FlowInput_Status(DMX_FLOW DmxFlow, DMX_FLOW_INPUT *pDmxFlowInput, MS_BOOL *pbClkInv, MS_BOOL *pbExtSync, MS_BOOL *pbParallel);
1696 
1697 //-------------------------------------------------------------------------------------------------
1698 /// Enable Demux flow path.
1699 /// @ingroup TSP_Flow
1700 /// @param DmxFlow             \b IN: TSP flow path
1701 /// @param bEnable             \b IN: TRUE: enable, FALSE: disable
1702 /// @return DMX_FILTER_STATUS_OK - Success
1703 /// @return DMX_FILTER_STATUS_ERROR - Failure
1704 //-------------------------------------------------------------------------------------------------
1705  DMX_FILTER_STATUS MApi_DMX_FlowEnable(DMX_FLOW DmxFlow, MS_BOOL bEnable);
1706 
1707 //-------------------------------------------------------------------------------------------------
1708 /// Enable liveAB config: TSIF1 path can use as live through TSIF0_FILE path. (Old arichtecture TSIF1 can't goto section)
1709 /// Only support on TSP 1.0
1710 /// @param bPF_EN              \b IN: Enable/Disable liveAB bit.
1711 /// @return DMX_FILTER_STATUS_OK - Success
1712 /// @return DMX_FILTER_STATUS_ERROR - Failure
1713 /// @note
1714 //-------------------------------------------------------------------------------------------------
1715 DMX_FILTER_STATUS MApi_DMX_LiveAB_En(MS_BOOL bPF_EN);
1716 
1717 //-------------------------------------------------------------------------------------------------
1718 /// Check liveAB config is enable or not
1719 /// Only support on TSP 1.0
1720 /// @return TRUE - LiveAB is enable
1721 /// @return FALSE - LiveAB is disable
1722 /// @note
1723 //-------------------------------------------------------------------------------------------------
1724 MS_BOOL           MApi_DMX_IsLiveAB_Enable(void);
1725 
1726 //-------------------------------------------------------------------------------------------------
1727 /// Set/Get DScmbler engine id depend on TSIF path
1728 /// @ingroup TSP_Flow
1729 /// @param  eTsIf                 \b IN: TSP flow path (interface)
1730 /// @param  pu32EngId             \b IN/OUT: pointer to store dscmb engine id
1731 /// @param  bSet                  \b IN: TRUE:Set dscmb engine id ; FALSE: Get dscmb engine id
1732 /// @return DMX_FILTER_STATUS_OK - Success
1733 /// @return DMX_FILTER_STATUS_ERROR - Failure
1734 //-------------------------------------------------------------------------------------------------
1735 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_Flow_DscmbEng(DMX_TSIF eTsIf, MS_U32* pu32EngId, MS_BOOL bSet);
1736 
1737 //-------------------------------------------------------------------------------------------------
1738 /// Configure TS output pad.
1739 /// @ingroup TSP_Flow
1740 /// @param  eOutPad           \b IN: Select output pad
1741 /// @param  eInSrcPad         \b IN: Select input source pad
1742 /// @param  bInParallel       \b IN: TRUE: input source is paralleled; FALSE: input source is serial in
1743 /// @param  u32ResvNum        \b IN: Reserved value of the number of reserved parameters for future using
1744 /// @param  pu32Resv          \b IN: Reserved pointer to store parameters for future using
1745 /// @return DMX_FILTER_STATUS_OK - Success
1746 /// @return DMX_FILTER_STATUS_ERROR - Failure
1747 /// @note Only EXT_PAD1 and EXT_PAD3 has output mode
1748 /// @note If output from S2P mode, input source should be external input pad only
1749 /// @note If output from TSO mode, eInputPad should be E_DRVTSP_PAD_TSO
1750 /// @note If input source is internal demod, output mode can be demod out or TSO out
1751 //-------------------------------------------------------------------------------------------------
1752 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TsOutputPadCfg(DMX_FLOW_OUTPUT_PAD eOutPad, DMX_FLOW_INPUT eInSrcPad, MS_BOOL bInParallel, MS_U32 u32ResvNum, MS_U32 *pu32Resv);
1753 
1754 //-------------------------------------------------------------------------------------------------
1755 /// Configure output pad
1756 /// Set S2P output clock phase and invert.
1757 /// @ingroup TSP_Flow
1758 /// @param  u16Val               \b IN: Value of phase
1759 /// @param  bEnable              \b IN: Enable/Disable phase tuning
1760 /// @param  u32Reserved          \b IN: Reserved for future using
1761 /// @return DMX_FILTER_STATUS_OK - Success
1762 /// @return DMX_FILTER_STATUS_ERROR - Failure
1763 /// @note Configure for S2P mode
1764 //-------------------------------------------------------------------------------------------------
1765 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TsS2POutputClkPhase(MS_U16 u16Val, MS_BOOL bEnable, MS_U32 u32S2pOpt);
1766 
1767 //-----------------
1768 // TSP_STC
1769 //-----------------
1770 //--------------------------------------------------------------------------------------------------
1771 /// Enable/Disable STC64 bit mode.
1772 /// @ingroup TSP_STC
1773 /// @param  bEnable              \b IN: Enable or Disable STC64 mode
1774 /// @return DMX_FILTER_STATUS_OK - Success
1775 /// @return DMX_FILTER_STATUS_ERROR - Failure
1776 /// @note This is also set by TSP init function.
1777 //--------------------------------------------------------------------------------------------------
1778 DMX_FILTER_STATUS MApi_DMX_STC64_Mode_Enable(MS_BOOL bEnable);
1779 
1780 //-------------------------------------------------------------------------------------------------
1781 /// Get STC counter.
1782 /// @ingroup DMX_ToBeRemove
1783 /// @param pu32Stc32       \b OUT: STC counter (bit 32)
1784 /// @param pu32Stc         \b OUT: STC counter (bit 31 to bit 0)
1785 /// @return DMX_FILTER_STATUS_OK - Success
1786 /// @return DMX_FILTER_STATUS_ERROR - Failure
1787 //-------------------------------------------------------------------------------------------------
1788 DMX_FILTER_STATUS MApi_DMX_Stc_Get(MS_U32* pu32Stc32, MS_U32* pu32Stc);
1789 
1790 //-------------------------------------------------------------------------------------------------
1791 /// Set STC counter.
1792 /// @ingroup DMX_ToBeRemove
1793 /// @param u32Stc32       \b OUT: STC counter (bit 32)
1794 /// @param u32Stc         \b OUT: STC counter (bit 31 to bit 0)
1795 /// @return DMX_FILTER_STATUS_OK - Success
1796 /// @return DMX_FILTER_STATUS_ERROR - Failure
1797 //-------------------------------------------------------------------------------------------------
1798 DMX_FILTER_STATUS MApi_DMX_Stc_Set(MS_U32 u32Stc32, MS_U32 u32Stc);
1799 
1800 //-------------------------------------------------------------------------------------------------
1801 /// Get PCR value.
1802 /// @ingroup DMX_ToBeRemove
1803 /// @param pu32Pcr32     \b OUT: PCR counter (bit 32)
1804 /// @param pu32Pcr       \b OUT: PCR counter (bit 31 to bit 0)
1805 /// @return DMX_FILTER_STATUS_OK - Success
1806 /// @return DMX_FILTER_STATUS_ERROR - Failure
1807 //-------------------------------------------------------------------------------------------------
1808 DMX_FILTER_STATUS MApi_DMX_Pcr_Get(MS_U32* pu32Pcr32, MS_U32* pu32Pcr);
1809 
1810 //-------------------------------------------------------------------------------------------------
1811 /// Select STC Engine.
1812 /// @ingroup TSP_STC
1813 /// @param eFltSrc         \b IN: Fliter Source type and Filter source ID
1814 /// @param u32StcEng       \b IN: STC engine ID (0, 1)
1815 /// @return DMX_FILTER_STATUS_OK - Success
1816 /// @return DMX_FILTER_STATUS_ERROR - Failure
1817 /// @note Only support in driver version 3.0.
1818 //-------------------------------------------------------------------------------------------------
1819 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_Stc_Select(DMX_FILTER_TYPE eFltSrc, MS_U32 u32StcEng);
1820 
1821 //-------------------------------------------------------------------------------------------------
1822 /// Get STC counter.
1823 /// @ingroup TSP_STC
1824 /// @param u8Eng             \b IN: STC Engine ID
1825 /// @param pu32Stc32         \b OUT: STC counter (bit 32)
1826 /// @param pu32Stc           \b OUT: STC counter (bit 31 to bit 0)
1827 /// @return DMX_FILTER_STATUS_OK - Success
1828 /// @return DMX_FILTER_STATUS_ERROR - Failure
1829 //-------------------------------------------------------------------------------------------------
1830 DMX_FILTER_STATUS MApi_DMX_Stc_Eng_Get(MS_U8 u8Eng, MS_U32* pu32Stc32, MS_U32* pu32Stc);
1831 
1832 //-------------------------------------------------------------------------------------------------
1833 /// Set STC counter.
1834 /// @ingroup TSP_STC
1835 /// @param u8Eng          \b IN: STC Engine ID
1836 /// @param u32Stc32       \b OUT: STC counter (bit 32)
1837 /// @param u32Stc         \b OUT: STC counter (bit 31 to bit 0)
1838 /// @return DMX_FILTER_STATUS_OK - Success
1839 /// @return DMX_FILTER_STATUS_ERROR - Failure
1840 //-------------------------------------------------------------------------------------------------
1841 DMX_FILTER_STATUS MApi_DMX_Stc_Eng_Set(MS_U8 u8Eng, MS_U32 u32Stc32, MS_U32 u32Stc);
1842 
1843 //-------------------------------------------------------------------------------------------------
1844 /// Get PCR.
1845 /// @ingroup TSP_STC
1846 /// @param u8PcrEng      \b INPUT: PCR Eng
1847 /// @param pu32Pcr32     \b OUT: PCR counter (bit 32)
1848 /// @param pu32Pcr       \b OUT: PCR counter (bit 31 to bit 0)
1849 /// @return DMX_FILTER_STATUS_OK - Success
1850 /// @return DMX_FILTER_STATUS_ERROR - Failure
1851 //-------------------------------------------------------------------------------------------------
1852 DMX_FILTER_STATUS MApi_DMX_Pcr_Eng_Get(MS_U8 u8PcrEng, MS_U32* pu32Pcr32, MS_U32* pu32Pcr);
1853 
1854 //-------------------------------------------------------------------------------------------------
1855 /// Set STC control.
1856 /// @ingroup TSP_STC
1857 /// @param u8Eng             \b IN: STC Engine ID
1858 /// @param eMode             \b IN: STC update control options
1859 /// @return DMX_FILTER_STATUS_OK - Success
1860 /// @return DMX_FILTER_STATUS_ERROR - Failure
1861 /// @note eMode: 0x00 -> Update STC by TSP FW
1862 /// @note             0x01 -> Update STC by HK
1863 /// @note             0x02 -> Update STC Once when PCR reset
1864 //-------------------------------------------------------------------------------------------------
1865 DMX_FILTER_STATUS MApi_DMX_STC_UpdateCtrl(MS_U8 u8Eng, eStcUpdateCtrlMode eMode);
1866 
1867 //-------------------------------------------------------------------------------------------------
1868 /// Add or subtract STC Offset.
1869 /// @ingroup TSP_STC
1870 /// @param u32Eng              \b IN: STC Engine ID
1871 /// @param u32Offset           \b IN: STC offset value
1872 /// @param bAdd                \b IN: If TRUE, add the offset value; otherwise subtract the offset value
1873 /// @return DMX_FILTER_STATUS_OK - Success
1874 /// @return DMX_FILTER_STATUS_ERROR - Failure
1875 //-------------------------------------------------------------------------------------------------
1876  DMX_FILTER_STATUS MApi_DMX_Stc_Eng_SetOffset(MS_U32 u32Eng, MS_U32 u32Offset, MS_BOOL bAdd);
1877 
1878 //-------------------------------------------------------------------------------------------------
1879 /// Adjust STC Clock.
1880 /// @ingroup TSP_STC
1881 /// @param u32EngId            \b IN: STC Engine ID
1882 /// @param bUpClk              \b IN: If TRUE, Clk will be faster, and if FALSE, Clk will be slower
1883 /// @param u32Percentage       \b IN: The percentage of STC clock ratio
1884 /// @return DMX_FILTER_STATUS_OK - Success
1885 /// @return DMX_FILTER_STATUS_ERROR - Failure
1886 //-------------------------------------------------------------------------------------------------
1887 DMX_FILTER_STATUS MApi_DMX_Stc_Clk_Adjust(MS_U32 u32EngId, MS_BOOL bUpClk, MS_U32 u32Percentage);
1888 
1889 //-----------------
1890 // TSP_Filter
1891 //-----------------
1892 //-------------------------------------------------------------------------------------------------
1893 /// Open a demux filter.
1894 /// @ingroup TSP_Filter
1895 /// @param DmxFltType    \b IN: The filter information to allocate
1896 /// @param pu8DmxId      \b OUT: The available demux filer index
1897 /// @return DMX_FILTER_STATUS_OK - Success
1898 /// @return DMX_FILTER_STATUS_ERROR - Failure
1899 //-------------------------------------------------------------------------------------------------
1900 DMX_FILTER_STATUS MApi_DMX_Open(DMX_FILTER_TYPE DmxFltType, MS_U8* pu8DmxId);
1901 
1902 //-------------------------------------------------------------------------------------------------
1903 /// Open a demux filter.
1904 /// @ingroup TSP_Filter
1905 /// @param pDmxInfo      \b IN: The filter information to allocate
1906 /// @param pu32DmxId     \b OUT: The available demux filer index
1907 /// @return DMX_FILTER_STATUS_OK - Success
1908 /// @return DMX_FILTER_STATUS_ERROR - Failure
1909 //-------------------------------------------------------------------------------------------------
1910 DMX_FILTER_STATUS MApi_DMX_Open_Ex(DMX_Info_EX *pDmxInfo, MS_U32* pu32DmxId);
1911 
1912 //-------------------------------------------------------------------------------------------------
1913 /// Close a demux filter.
1914 /// @ingroup TSP_Filter
1915 /// @param u32DmxId        \b IN: the demux filer index to free
1916 /// @return DMX_FILTER_STATUS_OK - Success
1917 /// @return DMX_FILTER_STATUS_ERROR - Failure
1918 //-------------------------------------------------------------------------------------------------
1919 DMX_FILTER_STATUS MApi_DMX_Close(MS_U32 u32DmxId);
1920 
1921 //-------------------------------------------------------------------------------------------------
1922 /// Activate a demux filter.
1923 /// @ingroup TSP_Filter
1924 /// @param u32DmxId        \b IN: the demux filer index to activate
1925 /// @return DMX_FILTER_STATUS_OK - Success
1926 /// @return DMX_FILTER_STATUS_ERROR - Failure
1927 //-------------------------------------------------------------------------------------------------
1928 DMX_FILTER_STATUS MApi_DMX_Start(MS_U32 u32DmxId);
1929 
1930 //-------------------------------------------------------------------------------------------------
1931 /// Deactivate a demux filter.
1932 /// @ingroup TSP_Filter
1933 /// @param u32DmxId         \b IN: the demux filer index to deactivate
1934 /// @return DMX_FILTER_STATUS_OK - Success
1935 /// @return DMX_FILTER_STATUS_ERROR - Failure
1936 //-------------------------------------------------------------------------------------------------
1937 DMX_FILTER_STATUS MApi_DMX_Stop(MS_U32 u32DmxId);
1938 
1939 //-------------------------------------------------------------------------------------------------
1940 /// Get/set a demultiplexer filter information
1941 /// @param  u32DmxId    \b IN: The ID of the demultiplexer filter
1942 /// @param  pDmxFltInfo \b IN/OUT: The demultiplexer filter information
1943 /// @param  pDmxFltType \b IN/OUT: The demultiplexer filter type
1944 /// @param  bSet        \b IN: set (TRUE) or get (FALSE)
1945 /// @return DMX_FILTER_STATUS_OK Success
1946 /// @return DMX_FILTER_STATUS_ERROR Failure
1947 /// @note If \b pDmxFltType is equal to \ref DMX_FILTER_TYPE_VIDEO, \ref DMX_FILTER_TYPE_AUDIO or \ref DMX_FILTER_TYPE_AUDIO2 :
1948 /// - If \b bSet is equal to TRUE, pDmxFltInfo->StreamInfo shall be filled-in (for future usage)
1949 /// - If \b bSet is equal to FALSE, then the previously set stream information will be returned in pDmxFltInfo->StreamInfo
1950 /// @note If \b pDmxFltType is equal to \ref DMX_FILTER_TYPE_SECTION, \ref DMX_FILTER_TYPE_TELETEXT, \ref DMX_FILTER_TYPE_PES, \ref DMX_FILTER_TYPE_PACKET or \ref DMX_FILTER_TYPE_PCR :
1951 /// - If \b bSet is equal to TRUE, pDmxFltInfo->SectInfo shall be filled-in
1952 /// - If \b bSet is equal to FALSE, then the previously set information will be returned in pDmxFltInfo->SectInfo
1953 /// - The members in pDmxFltInfo->SectInfo structure shall be set as follows: \n
1954 ///      SectBufAddr : the section buffer physical address \n
1955 ///      SectBufSize : the section buffer size \n
1956 ///      SectMode    : OR combination of the following: (DMX_SECT_MODE_CONTI and DMX_SECT_MODE_ONESHOT are exclusive) \n
1957 ///                    \ref DMX_SECT_MODE_CONTI : Receive section data continuously \n
1958 ///                    \ref DMX_SECT_MODE_ONESHOT : Receive one section only \n
1959 ///                    \ref DMX_SECT_MODE_CRCCHK : Ask DMX hardware to check CRC32 value of section data and to drop incorrect sections \n
1960 ///      Event       : OR combination of the following ( \ref DMX_EVENT_CB_POLL, \ref DMX_EVENT_CB_SELF and \ref DMX_EVENT_CB_SELF_TYPE2 are exclusive) \n
1961 ///                    \ref DMX_EVENT_CB_POLL : use polling mode \n
1962 ///                    \ref DMX_EVENT_CB_SELF : User set events will be notified to the user using the callback set in the \b pNotify field \n
1963 ///                    \ref DMX_EVENT_CB_SELF_TYPE2 : User set events will be notified to the user using the callback set in the \b pType2Notify field. The caller may specify specific user data using the \b Type2NotifyParam1 field \n
1964 ///                    \ref DMX_EVENT_DATA_READY : If set, an event will be raised (and notified through callback if \ref DMX_EVENT_CB_SELF or \ref DMX_EVENT_CB_SELF_TYPE2 are set) when one or more complete section data has been captured in the section buffer \n
1965 ///                    \ref DMX_EVENT_BUF_OVERFLOW : If set, an event will be raised (and notified through callback if \ref DMX_EVENT_CB_SELF or \ref DMX_EVENT_CB_SELF_TYPE2 are set) if the section buffer overflows \n
1966 ///                    \ref DMX_EVENT_DATA_READY : If set, an event will be raised (and notified through callback if \ref DMX_EVENT_CB_SELF or \ref DMX_EVENT_CB_SELF_TYPE2 are set) if CRC32 check fails (assuming \ref DMX_SECT_MODE_CRCCHK has been set in \b SectMode) \n
1967 //-------------------------------------------------------------------------------------------------
1968 DMX_FILTER_STATUS MApi_DMX_Info(MS_U32 u32DmxId, DMX_Flt_info* pDmxFltInfo, DMX_FILTER_TYPE* pDmxFltType, MS_BOOL bSet);
1969 
1970 //-------------------------------------------------------------------------------------------------
1971 /// Get/set a demultiplexer filter information for filter number > 256
1972 /// @param u32DmxId    \b IN: The ID of the demultiplexer filter
1973 /// @param pDmxFltInfo \b IN/OUT: The demultiplexer filter information
1974 /// @return DMX_FILTER_STATUS_OK Success
1975 /// @return DMX_FILTER_STATUS_ERROR Failure
1976 /// - The members in pDmxFltInfo->SectInfoEx structure shall be set as follows: \n
1977 ///      SectBufAddr : the section buffer physical address \n
1978 ///      SectBufSize : the section buffer size \n
1979 ///      SectMode    : OR combination of the following: (DMX_SECT_MODE_CONTI and DMX_SECT_MODE_ONESHOT are exclusive) \n
1980 ///                    \ref DMX_SECT_MODE_CONTI : Receive section data continuously \n
1981 ///                    \ref DMX_SECT_MODE_ONESHOT : Receive one section only \n
1982 ///                    \ref DMX_SECT_MODE_CRCCHK : Ask DMX hardware to check CRC32 value of section data and to drop incorrect sections \n
1983 ///      Event       : OR combination of the following ( \ref DMX_EVENT_CB_POLL, \ref DMX_EVENT_CB_SELF and \ref DMX_EVENT_CB_SELF_TYPE2 are exclusive) \n
1984 ///                    \ref DMX_EVENT_CB_POLL : use polling mode \n
1985 ///                    \ref DMX_EVENT_CB_SELF : User set events will be notified to the user using the callback set in the \b pNotify field \n
1986 ///                    \ref DMX_EVENT_CB_SELF_TYPE2 : User set events will be notified to the user using the callback set in the \b pType2Notify field. The caller may specify specific user data using the \b Type2NotifyParam1 field \n
1987 ///                    \ref DMX_EVENT_DATA_READY : If set, an event will be raised (and notified through callback if \ref DMX_EVENT_CB_SELF or \ref DMX_EVENT_CB_SELF_TYPE2 are set) when one or more complete section data has been captured in the section buffer \n
1988 ///                    \ref DMX_EVENT_BUF_OVERFLOW : If set, an event will be raised (and notified through callback if \ref DMX_EVENT_CB_SELF or \ref DMX_EVENT_CB_SELF_TYPE2 are set) if the section buffer overflows \n
1989 ///                    \ref DMX_EVENT_DATA_READY : If set, an event will be raised (and notified through callback if \ref DMX_EVENT_CB_SELF or \ref DMX_EVENT_CB_SELF_TYPE2 are set) if CRC32 check fails (assuming \ref DMX_SECT_MODE_CRCCHK has been set in \b SectMode) \n
1990 //-------------------------------------------------------------------------------------------------
1991 DMX_FILTER_STATUS MApi_DMX_Info_Ex(MS_U32 u32DmxId, DMX_Flt_info_Ex* pDmxFltInfo);
1992 
1993 //-------------------------------------------------------------------------------------------------
1994 /// Set a demux filter PID.
1995 /// @ingroup TSP_Filter
1996 /// @param u32DmxId      \b IN: the demux filer index
1997 /// @param pu16Pid        \b IN/OUT: PID
1998 /// @param bSet             \b IN: set/get
1999 /// @return DMX_FILTER_STATUS_OK - Success
2000 /// @return DMX_FILTER_STATUS_ERROR - Failure
2001 //-------------------------------------------------------------------------------------------------
2002 DMX_FILTER_STATUS MApi_DMX_Pid(MS_U32 u32DmxId, MS_U16* pu16Pid, MS_BOOL bSet);
2003 
2004 //-------------------------------------------------------------------------------------------------
2005 /// Get a demux filter status.
2006 /// @ingroup TSP_Filter
2007 /// @param u32DmxId       \b IN: the demux filer index
2008 /// @param pbEnable       \b OUT: the demux filer enable/disable
2009 /// @return DMX_FILTER_STATUS_OK - Success
2010 /// @return DMX_FILTER_STATUS_ERROR - Failure
2011 //-------------------------------------------------------------------------------------------------
2012 DMX_FILTER_STATUS MApi_DMX_IsStart(MS_U32 u32DmxId, MS_BOOL* pbEnable);
2013 
2014 //--------------------------------------------------------------------------------------------------
2015 /// @brief Copy section data from section buffer to user-assigned buffer
2016 /// @param   u32DmxId               \b IN:  demultiplexer filter ID
2017 /// @param   pu8Buf                 \b OUT: address of the user-assigned destination buffer
2018 /// @param   u32BufSize             \b IN:  size of the user-assigned destination buffer
2019 /// @param   pu32ActualSize         \b OUT: actual copied data size
2020 /// @param   pu32RmnSize            \b OUT: section buffer remainning data size
2021 /// @param   pfCheckCB              \b IN:  callback function to check data correctness (NOTE: callback function must return to avoid blocking)
2022 /// @pre The filter type of the filter corresponding to \b u32DmxId shall be one of \ref DMX_FILTER_TYPE_SECTION, \ref DMX_FILTER_TYPE_PES, \ref DMX_FILTER_TYPE_TELETEXT or \ref DMX_FILTER_TYPE_PACKET
2023 /// @return DMX_FILTER_STATUS_OK - Success
2024 /// @return DMX_FILTER_STATUS_ERROR - Failure
2025 /// @note If the filter type of the filter corresponding to \b u32DmxId is equal to \ref DMX_FILTER_TYPE_SECTION :
2026 /// - If the data size in the section buffer is smaller than a complete section data length, then this function will return \ref DMX_FILTER_STATUS_ERROR. \n
2027 /// - If \b u32BufSize is smaller than a complete section data length, then this function will print error message and remove a complete section data from the section buffer, without any copy operation.\n
2028 /// - If the data size in the section buffer and \b u32BufSize are both larger than a complete section data length, then this function will copy a complete section data from the section buffer to \b pu8Buf. \n
2029 /// @note If the filter type is equal to \ref DMX_FILTER_TYPE_SECTION, \ref DMX_FILTER_TYPE_PES, \ref DMX_FILTER_TYPE_TELETEXT or \ref DMX_FILTER_TYPE_PACKET :
2030 /// - If \b u32BufSize is larger than all data in the section buffer, the function will copy all data in the section buffer to \b pu8Buf.\n
2031 /// - If \b u32BufSize is smaller than all data in section buffer, the function will copy \b u32BufSize bytes to \b pu8Buf.
2032 //--------------------------------------------------------------------------------------------------
2033 DMX_FILTER_STATUS MApi_DMX_CopyData(MS_U32 u32DmxId, MS_U8* pu8Buf, MS_U32 u32BufSize, MS_U32* pu32ActualSize, MS_U32* pu32RmnSize, DMX_CheckCb pfCheckCB);
2034 
2035 //--------------------------------------------------------------------------------------------------
2036 /// Ask demuxer to process section/pvr data for Non-OS driver.
2037 /// @ingroup TSP_Filter
2038 /// @param  u32DmxId  \b IN: ID of the filter to be processed, or 0xFFFFFFFF for all filters
2039 /// @param  pEvent    \b IN: Pointer to DMX event.
2040 /// @return DMX_FILTER_STATUS_OK - Success
2041 /// @return DMX_FILTER_STATUS_ERROR - Failure
2042 /// @note Calling this function in OS environment causes nothing
2043 //--------------------------------------------------------------------------------------------------
2044 DMX_FILTER_STATUS MApi_DMX_Proc(MS_U32 u32DmxId, DMX_EVENT* pEvent);
2045 
2046 //--------------------------------------------------------------------------------------------------
2047 /// Change DMX filter source type.
2048 /// @ingroup TSP_Filter
2049 /// @param  u32DmxId             \b IN: DMX filter ID
2050 /// @param  DmxFltSrcType        \b IN: DMX filter Source Type and filter source id
2051 /// @return DMX_FILTER_STATUS_OK - Success
2052 /// @return DMX_FILTER_STATUS_ERROR - Failure
2053 //--------------------------------------------------------------------------------------------------
2054 DMX_FILTER_STATUS MApi_DMX_Change_FilterSource(MS_U32 u32DmxId, DMX_FILTER_TYPE DmxFltSrcType);
2055 
2056 //--------------------------------------------------------------------------------------------------
2057 ///MApi_DMX_FilterFlowSwitch : Switch filter source from one channel to another.
2058 /// @ingroup TSP_Filter
2059 /// @param  TgtFlow        \b IN: chagne to this path setting
2060 /// @return DMX_FILTER_STATUS_OK - Success
2061 /// @return DMX_FILTER_STATUS_ERROR - Failure
2062 /// @note TSP 1.0:
2063 /// @note DMX_FILTER_SOURCE_TYPE_LIVE
2064 /// @note DMX_FILTER_SOURCE_TYPE_TS1
2065 /// @note TSP 2.0:
2066 /// @note DMX_FILTER_SOURCE_TYPE_PLAYBACK
2067 /// @note DMX_FILTER_SOURCE_TYPE_PVR0
2068 /// @note DMX_FILTER_SOURCE_TYPE_PVR1
2069 /// @note TSP 4.0:
2070 /// @note DMX_FILTER_SOURCE_TYPE_LIVE
2071 /// @note DMX_FILTER_SOURCE_TYPE_FILE
2072 /// @note DMX_FILTER_SOURCE_TYPE_TS1
2073 /// @note DMX_FILTER_SOURCE_TYPE_TS2
2074 /// @note DMX_FILTER_SOURCE_TYPE_TS3
2075 //--------------------------------------------------------------------------------------------------
2076 DMX_FILTER_STATUS MApi_DMX_LiveSrcSwitch(DMX_FILTER_TYPE TgtFlow);
2077 
2078 //--------------------------------------------------------------------------------------------------
2079 /// @brief Get demux filter owner
2080 /// @param  u32DmxId            \b IN: demux ID
2081 /// @param  pbOwner             \b IN: pointer to store return value of owner flag
2082 /// @return DMX_FILTER_STATUS
2083 //--------------------------------------------------------------------------------------------------
2084 DMX_FILTER_STATUS MApi_DMX_GetOwner(MS_U32 u32DmxId, MS_BOOL* pbOwner); //OBSOLETE
2085 
2086 //-----------------
2087 // TSP_SCMB
2088 //-----------------
2089 //-------------------------------------------------------------------------------------------------
2090 /// Get PID filter scramble status.
2091 /// @ingroup TSP_SCMB
2092 /// @param  FltSrc                 \b IN    : Filter source
2093 /// @param  u32FltGroupId          \b IN    : Pid filter group id, every 32 filter for 1 group. 0: filter 0~31, 1: 32~63, 2: 64~95, 3: 96~127
2094 /// @param  PidFltId               \b IN    : Pid filter id for getting. If 0xFFFFFFFF, means getting the status of all filters of the same group
2095 /// @param  pu32ScmbSts            \b OUT : The scrmabling status of pid filter.
2096 /// @return TSP_Result
2097 /// @note pu32ScmbSts: If getting all group status, every bit means one status of every filter.
2098 /// @note If only checking one filter,  1 means scrambled status and 0 means non-scrambled status.
2099 //-------------------------------------------------------------------------------------------------
2100 DMX_FILTER_STATUS MApi_DMX_Get_FltScmbSts(DMX_FILTER_TYPE FltSrc, MS_U32 u32FltGroupId, MS_U32 PidFltId, MS_U32 *pu32ScmbSts);
2101 
2102 //-------------------------------------------------------------------------------------------------
2103 /// Get the PES scrambling control status.
2104 /// @ingroup TSP_SCMB
2105 /// @param u32DmxId       \b IN: the demux filer Id
2106 /// @param pu8scmb        \b OUT: the PES scrambling status. bit 0~ bit3, Every bit indicates one status of one packet. bit4 ~ bit7, packet count
2107 /// @return DMX_FILTER_STATUS_OK - Success
2108 /// @return DMX_FILTER_STATUS_ERROR - Failure
2109 /// @note Must open and start filter with DMX_FILTER_TYPE_PACKET type and DMX_SECT_MODE_PESSCMCHK mode
2110 //-------------------------------------------------------------------------------------------------
2111 DMX_FILTER_STATUS MApi_DMX_Get_PesScmbSts(MS_U32 u32DmxId, MS_U8* pu8scmb);
2112 
2113 //-------------------------------------------------------------------------------------------------
2114 /// Get the TS scrambling control status.
2115 /// @ingroup TSP_SCMB
2116 /// @param u32DmxId        \b IN: the demux filer Id
2117 /// @param pu8ScmSts       \b OUT: TS scrambling status. bit 0~ bit3, Every bit indicates one status of one packet. bit4 ~ bit7, packet count
2118 /// @return DMX_FILTER_STATUS_OK - Success
2119 /// @return DMX_FILTER_STATUS_ERROR - Failure
2120 /// @note Must open and start filter with DMX_FILTER_TYPE_PACKET type and DMX_SECT_MODE_PESSCMCHK mode
2121 //-------------------------------------------------------------------------------------------------
2122 DMX_FILTER_STATUS MApi_DMX_Get_TsScmbSts(MS_U32 u32DmxId, MS_U8* pu8ScmSts);
2123 
2124 //-----------------
2125 // TSP_STB
2126 //-----------------
2127 // ---------------- [NOTE] API for TSP Ver2.0 HW architecture.-------------
2128 //-------------------------------------------------------------------------------------------------
2129 /// Open a demux filter and attach to a existed filter and buffer
2130 /// @ingroup TSP_STB
2131 /// @param DmxFltType         \b IN: the filter information to allocate
2132 /// @param pu8DmxId           \b OUT: the available demux filer Id
2133 /// @param u8TargetDmxId      \b IN: the target demux filer Id
2134 /// @return DMX_FILTER_STATUS_OK - Success
2135 /// @return DMX_FILTER_STATUS_ERROR - Failure
2136 /// @note Only use on TSP 2.0 (STB)
2137 /// @note API for U4 TSP N filter to 1 Buffer HW architecture.
2138 //-------------------------------------------------------------------------------------------------
2139  DMX_FILTER_STATUS MApi_DMX_Open_MultiFlt( DMX_FILTER_TYPE DmxFltType , MS_U8* pu8DmxId, MS_U8 u8TargetDmxId);
2140 
2141 //-------------------------------------------------------------------------------------------------
2142 /// Enable drop section filter packet.
2143 /// @ingroup TSP_STB
2144 /// @param bSet          \b IN: TRUE: enable, FALSE: disable
2145 /// @return DMX_FILTER_STATUS_OK - Success
2146 /// @return DMX_FILTER_STATUS_ERROR - Failure
2147 /// @note Only use on TSP 2.0 (STB)
2148 //-------------------------------------------------------------------------------------------------
2149  DMX_FILTER_STATUS MApi_DMX_Drop_Enable(MS_BOOL bSet);
2150 //--------------------------------------------------------------------------------
2151 
2152 //-----------------
2153 // TSP_SecFilter
2154 //-----------------
2155 //-------------------------------------------------------------------------------------------------
2156 /// Reset demux filer buffer.
2157 /// @ingroup TSP_SecFilter
2158 /// @param u32DmxId        \b IN: the target demux filer index
2159 /// @return DMX_FILTER_STATUS_OK - Success
2160 /// @return DMX_FILTER_STATUS_ERROR - Failure
2161 //-------------------------------------------------------------------------------------------------
2162 DMX_FILTER_STATUS MApi_DMX_SectReset(MS_U32 u32DmxId);
2163 
2164 //-------------------------------------------------------------------------------------------------
2165 /// Set the read pointer of demux filer buffer.
2166 /// @ingroup TSP_SecFilter
2167 /// @param u32DmxId          \b IN: the target demux filer index
2168 /// @param Read              \b IN: the read pointer to be set
2169 /// @return DMX_FILTER_STATUS_OK - Success
2170 /// @return DMX_FILTER_STATUS_ERROR - Failure
2171 //-------------------------------------------------------------------------------------------------
2172 DMX_FILTER_STATUS MApi_DMX_SectReadSet(MS_U32 u32DmxId, MS_PHY Read);
2173 
2174 //-------------------------------------------------------------------------------------------------
2175 /// Get the read pointer of demux filer buffer.
2176 /// @ingroup TSP_SecFilter
2177 /// @param u32DmxId        \b IN: the target demux filer index
2178 /// @param pRead           \b OUT: the pointer to store the obtained read pointer
2179 /// @return DMX_FILTER_STATUS_OK - Success
2180 /// @return DMX_FILTER_STATUS_ERROR - Failure
2181 //-------------------------------------------------------------------------------------------------
2182 DMX_FILTER_STATUS MApi_DMX_SectReadGet(MS_U32 u32DmxId, MS_PHY* pRead);
2183 
2184 //-------------------------------------------------------------------------------------------------
2185 /// Get the write pointer of demux filer buffer.
2186 /// @ingroup TSP_SecFilter
2187 /// @param u32DmxId        \b IN: the target demux filer index
2188 /// @param pWrite          \b OUT: the pointer to store the obtained write pointer
2189 /// @return DMX_FILTER_STATUS_OK - Success
2190 /// @return DMX_FILTER_STATUS_ERROR - Failure
2191 //-------------------------------------------------------------------------------------------------
2192 DMX_FILTER_STATUS MApi_DMX_SectWriteGet(MS_U32 u32DmxId, MS_PHY* pWrite);
2193 //-------------------------------------------------------------------------------------------------
2194 /// Get the start pointer of demux filer buffer.
2195 /// @ingroup TSP_SecFilter
2196 /// @param u32DmxId        \b IN: the target demux filer index
2197 /// @param pStart          \b OUT: the pointer to store the obtained start pointer
2198 /// @return DMX_FILTER_STATUS_OK - Success
2199 /// @return DMX_FILTER_STATUS_ERROR - Failure
2200 //-------------------------------------------------------------------------------------------------
2201 DMX_FILTER_STATUS MApi_DMX_SectStartGet(MS_U32 u32DmxId, MS_PHY* pStart);
2202 //-------------------------------------------------------------------------------------------------
2203 /// Get the end pointer of demux filer buffer.
2204 /// @ingroup TSP_SecFilter
2205 /// @param u32DmxId        \b IN: the target demux filer index
2206 /// @param pEnd            \b OUT: the pointer to store the obtained end pointer
2207 /// @return DMX_FILTER_STATUS_OK - Success
2208 /// @return DMX_FILTER_STATUS_ERROR - Failure
2209 //-------------------------------------------------------------------------------------------------
2210 DMX_FILTER_STATUS MApi_DMX_SectEndGet(MS_U32 u32DmxId, MS_PHY* pEnd);
2211 //-------------------------------------------------------------------------------------------------
2212 /// Set demux filer match patterns.
2213 /// @ingroup TSP_SecFilter
2214 /// @param u32DmxId         \b IN: the target demux filer index
2215 /// @param pPattern         \b IN: the match patterns
2216 /// @param pMask            \b IN: the bit mask for match patterns
2217 /// @param pu8NotMask       \b IN: the bit mask for negative match patterns
2218 /// @param MatchSize        \b IN: the size in bytes for match patterns.
2219 /// @return DMX_FILTER_STATUS_OK - Success
2220 /// @return DMX_FILTER_STATUS_ERROR - Failure
2221 /// @note The match pattern size is 16 bytes
2222 /// @note       match mask      -- must set 1 to be compare (customer request)
2223 /// @note       not match mask -- must set 1 to compare
2224 //-------------------------------------------------------------------------------------------------
2225 DMX_FILTER_STATUS MApi_DMX_SectPatternSet(MS_U32 u32DmxId, MS_U8* pPattern, MS_U8* pMask, MS_U8 *pu8NotMask, MS_U32 MatchSize);
2226 
2227 //-----------------
2228 // TSP_TTX
2229 //-----------------
2230 //-------------------------------------------------------------------------------------------------
2231 /// Get Teltext section buffer write address.
2232 /// @ingroup TSP_TTX
2233 /// @param u32DmxId          \b IN: the target demux filer index
2234 /// @param pWrite            \b OUT: the pointer to store the obtained write pointer
2235 /// @return DMX_FILTER_STATUS_OK - Success
2236 /// @return DMX_FILTER_STATUS_ERROR - Failure
2237 /// @note Special case for TTX due to it can't use HW lock to do indirect read/write. (co-processer)
2238 //-------------------------------------------------------------------------------------------------
2239 DMX_FILTER_STATUS MApi_DMX_TTX_WriteGet(MS_U32 u32DmxId, MS_PHY* pWrite);
2240 
2241 //-------------------------------------------------------------------------------------------------
2242 /// Check can access TSP or not due to different CPU co-process. (HK and AEON)
2243 /// @ingroup TSP_TTX
2244 /// @param u32Try        \b IN: TRUE: check, FALSE: not check
2245 /// @return DMX_FILTER_STATUS_OK - Success
2246 /// @return DMX_FILTER_STATUS_ERROR - Failure
2247 //-------------------------------------------------------------------------------------------------
2248 DMX_FILTER_STATUS MApi_DMX_GetAccess(MS_U32 u32Try); //OBSOLETE
2249 //-------------------------------------------------------------------------------------------------
2250 /// Unlock HW semaphore.
2251 /// @ingroup TSP_TTX
2252 /// @return DMX_FILTER_STATUS_OK - Success
2253 /// @return DMX_FILTER_STATUS_ERROR - Failure
2254 //-------------------------------------------------------------------------------------------------
2255 DMX_FILTER_STATUS MApi_DMX_ReleaseAccess(void); //OBSOLETE
2256 
2257 //-----------------
2258 // TSP_FIFO
2259 //-----------------
2260 //--------------------------------------------------------------------------------------------------
2261 /// Reset AVFIFO.
2262 /// @ingroup TSP_FIFO
2263 /// @param  DmxFltType       \b IN: demux type
2264 /// @param  bFlush           \b IN: section buffer size
2265 /// @return DMX_FILTER_STATUS_OK - Success
2266 /// @return DMX_FILTER_STATUS_ERROR - Failure
2267 //--------------------------------------------------------------------------------------------------
2268 DMX_FILTER_STATUS MApi_DMX_AVFifo_Reset(DMX_FILTER_TYPE DmxFltType, MS_BOOL bFlush);
2269 
2270 //--------------------------------------------------------------------------------------------------
2271 /// Get AVFIFO status (Level).
2272 /// @ingroup TSP_FIFO
2273 /// @param  DmxFltType       \b IN: demux type
2274 /// @param  u32FifoLevel     \b OUT: fifo level
2275 /// @return DMX_FILTER_STATUS_OK - Success
2276 /// @return DMX_FILTER_STATUS_ERROR - Failure
2277 //--------------------------------------------------------------------------------------------------
2278 DMX_FILTER_STATUS MApi_DMX_AVFifo_Status(DMX_FILTER_TYPE DmxFltType, DMX_FIFO_STATUS* u32FifoLevel);
2279 //--------------------------------------------------------------------------------------------------
2280 /// Enable remove duplicate A/V packets.
2281 /// @ingroup DMX_ToBeRemove
2282 /// @param  bEnable          \b IN: Enable or Disable
2283 /// @return DMX_FILTER_STATUS_OK - Success
2284 /// @return DMX_FILTER_STATUS_ERROR - Failure
2285 /// @note It will apply to all FIFO.
2286 //--------------------------------------------------------------------------------------------------
2287 DMX_FILTER_STATUS MApi_DMX_RemoveDupAVPkt(MS_BOOL bEnable);
2288 
2289 //--------------------------------------------------------------------------------------------------
2290 /// Enable remove duplicate A/V Fifo packets.
2291 /// @ingroup TSP_FIFO
2292 /// @param  DmxFltType    \b IN: demux type
2293 /// @param  bEnable       \b IN: Enable or Disable
2294 /// @return DMX_FILTER_STATUS_OK - Success
2295 /// @return DMX_FILTER_STATUS_ERROR - Failure
2296 //--------------------------------------------------------------------------------------------------
2297 DMX_FILTER_STATUS MApi_DMX_RemoveDupAVFifoPkt(DMX_FILTER_TYPE DmxFltType, MS_BOOL bEnable);
2298 
2299 //--------------------------------------------------------------------------------------------------
2300 /// Enable/Disable Audio AB S
2301 /// @ingroup TSP_FIFO
2302 /// @param bEnable           \b IN: Enable/Disable
2303 /// @return DMX_FILTER_STATUS_OK - Success
2304 /// @return DMX_FILTER_STATUS_ERROR - Failure
2305 //--------------------------------------------------------------------------------------------------
2306 DMX_FILTER_STATUS MApi_DMX_AU_BD_Mode_Enable(MS_BOOL bEnable);
2307 
2308 //--------------------------------------------------------------------------------------------------
2309 /// Enable/Disable AV FIFO block mechanism.
2310 /// @ingroup TSP_FIFO
2311 /// @param  DmxFltType       \b IN: demux type
2312 /// @param  bEnable            \b IN: TRUR: Enable block mechanism, FALSE: Disable block mechanism
2313 /// @return DMX_FILTER_STATUS_OK - Success
2314 /// @return DMX_FILTER_STATUS_ERROR - Failure
2315 /// @note Not supprot for all chips
2316 //--------------------------------------------------------------------------------------------------
2317 DMX_FILTER_STATUS MApi_DMX_AVFifo_BlockEnable(DMX_FILTER_TYPE DmxFltType, MS_BOOL bEnable);
2318 
2319 //--------------------------------------------------------------------------------------------------
2320 /// Bypass TS Header to AV Fifo
2321 /// @param  DmxFltType       \b IN: demux type
2322 /// @param  bEnable            \b IN: TRUR: Enable TS header bypass, FALSE: Disable TS header bypass
2323 /// @return DMX_FILTER_STATUS_OK - Success
2324 /// @return DMX_FILTER_STATUS_ERROR - Failure
2325 /// @note Not supprot for all chips
2326 //--------------------------------------------------------------------------------------------------
2327 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_AVFifo_BypassTsHD(DMX_FILTER_TYPE DmxFltType, MS_BOOL bEnable);
2328 
2329 // PVR Record API (Old)
2330 //-------------------------------------------------------------------------------------------------
2331 /// Set up the recording parameters.
2332 /// @ingroup DMX_ToBeRemove
2333 /// @param pPvrInfo      \b IN: the recording parameters
2334 /// @return DMX_FILTER_STATUS_OK - Success
2335 /// @return DMX_FILTER_STATUS_ERROR - Failure
2336 /// @note Keep the function which have engine parameter.
2337 //-------------------------------------------------------------------------------------------------
2338 DMX_FILTER_STATUS MApi_DMX_Pvr_Open(DMX_Pvr_info* pPvrInfo);
2339 //-------------------------------------------------------------------------------------------------
2340 /// Clear the recording parameters.
2341 /// @ingroup DMX_ToBeRemove
2342 /// @return DMX_FILTER_STATUS_OK - Success
2343 /// @return DMX_FILTER_STATUS_ERROR - Failure
2344 /// @note Keep the function which have engine parameter.
2345 //-------------------------------------------------------------------------------------------------
2346 DMX_FILTER_STATUS MApi_DMX_Pvr_Close(void);
2347 //-------------------------------------------------------------------------------------------------
2348 /// Pause/Resume PVR engine.
2349 /// @ingroup DMX_ToBeRemove
2350 /// @param bPause          \b IN: TRUE: pause, FALSE: resume
2351 /// @return DMX_FILTER_STATUS_OK - Success
2352 /// @return DMX_FILTER_STATUS_ERROR - Failure
2353 /// @note Keep the function which have engine parameter.
2354 //-------------------------------------------------------------------------------------------------
2355 DMX_FILTER_STATUS MApi_DMX_Pvr_Pause(MS_BOOL bPause);
2356 //-------------------------------------------------------------------------------------------------
2357 /// Set the PID to be recorded.
2358 /// @ingroup DMX_ToBeRemove
2359 /// @param Pid                 \b IN: The target PID to be recorded
2360 /// @param pu8DmxId            \b OUT: The demux filter Id for this recorded PID
2361 /// @return DMX_FILTER_STATUS_OK - Success
2362 /// @return DMX_FILTER_STATUS_ERROR - Failure
2363 /// @note Keep the function which have engine parameter.
2364 //-------------------------------------------------------------------------------------------------
2365 DMX_FILTER_STATUS MApi_DMX_Pvr_Pid_Open(MS_U32 Pid, MS_U8* pu8DmxId);
2366 
2367 //-------------------------------------------------------------------------------------------------
2368 /// Free the PID to be recorded.
2369 /// @ingroup DMX_ToBeRemove
2370 /// @param u8DmxId        \b IN: The demux filter Id from MApi_DMX_Pvr_Pid_Open
2371 /// @return DMX_FILTER_STATUS_OK - Success
2372 /// @return DMX_FILTER_STATUS_ERROR - Failure
2373 /// @note Keep the function which have engine parameter.
2374 //-------------------------------------------------------------------------------------------------
2375 DMX_FILTER_STATUS MApi_DMX_Pvr_Pid_Close(MS_U8 u8DmxId);
2376 
2377 //-------------------------------------------------------------------------------------------------
2378 /// Start to record.
2379 /// @ingroup DMX_ToBeRemove
2380 /// @param bPvrAll           \b IN: TRUE to record original bit stream, FALSE to recording the PIDs of interests
2381 /// @return DMX_FILTER_STATUS_OK - Success
2382 /// @return DMX_FILTER_STATUS_ERROR - Failure
2383 /// @note Keep the function which have engine parameter.
2384 //-------------------------------------------------------------------------------------------------
2385 DMX_FILTER_STATUS MApi_DMX_Pvr_Start(MS_BOOL bPvrAll);
2386 
2387 //-------------------------------------------------------------------------------------------------
2388 /// Stop recording.
2389 /// @ingroup DMX_ToBeRemove
2390 /// @return DMX_FILTER_STATUS_OK - Success
2391 /// @return DMX_FILTER_STATUS_ERROR - Failure
2392 /// @note Keep the function which have engine parameter.
2393 //-------------------------------------------------------------------------------------------------
2394 DMX_FILTER_STATUS MApi_DMX_Pvr_Stop(void);
2395 
2396 //-------------------------------------------------------------------------------------------------
2397 /// Get write pointer of recording buffer.
2398 /// @ingroup DMX_ToBeRemove
2399 /// @param pphyWrite       \b OUT: the pointer to store the obtained write pointer
2400 /// @return DMX_FILTER_STATUS_OK - Success
2401 /// @return DMX_FILTER_STATUS_ERROR - Failure
2402 /// @note Keep the function which have engine parameter.
2403 //-------------------------------------------------------------------------------------------------
2404 DMX_FILTER_STATUS MApi_DMX_Pvr_WriteGet(MS_PHY* pphyWrite);
2405 
2406 //-------------------------------------------------------------------------------------------------
2407 /// Set recording packet mode.
2408 /// @ingroup DMX_ToBeRemove
2409 /// @param bSet               \b IN: TRUE: enable 192 mode, FALSE: disable 192 mode
2410 /// @return DMX_FILTER_STATUS_OK - Success
2411 /// @return DMX_FILTER_STATUS_ERROR - Failure
2412 /// @note Keep the function which have engine parameter.
2413 //-------------------------------------------------------------------------------------------------
2414 DMX_FILTER_STATUS MApi_DMX_PVR_SetPacketMode(MS_BOOL bSet);
2415 
2416 //-------------------------------------------------------------------------------------------------
2417 /// Set recording starting time stamp.
2418 /// @ingroup DMX_ToBeRemove
2419 /// @param u32Stamp       \b IN: Record time-stamp (LPCR)
2420 /// @return DMX_FILTER_STATUS_OK - Success
2421 /// @return DMX_FILTER_STATUS_ERROR - Failure
2422 /// @note Keep the function which have engine parameter.
2423 //-------------------------------------------------------------------------------------------------
2424 DMX_FILTER_STATUS MApi_DMX_Pvr_SetRecordStamp(MS_U32 u32Stamp);
2425 
2426 //-------------------------------------------------------------------------------------------------
2427 /// Get current recording time stamp.
2428 /// @ingroup DMX_ToBeRemove
2429 /// @param pu32Stamp     \b OUT: the pointer to store the obtained record time-stamp (LPCR)
2430 /// @return DMX_FILTER_STATUS_OK - Success
2431 /// @return DMX_FILTER_STATUS_ERROR - Failure
2432 /// @note Keep the function which have engine parameter.
2433 //-------------------------------------------------------------------------------------------------
2434 DMX_FILTER_STATUS MApi_DMX_Pvr_GetRecordStamp(MS_U32* pu32Stamp);
2435 
2436 //-------------------------------------------------------------------------------------------------
2437 /// Enable MOBF encrypt.
2438 /// @ingroup DMX_ToBeRemove
2439 /// @param bEnable          \b IN: PVR MOBF Enable/Disable
2440 /// @param u32key0          \b IN: MOBF encrypt key0
2441 /// @param u32key1          \b IN: MOBF encrypt key1
2442 /// @return DMX_FILTER_STATUS_OK - Success
2443 /// @return DMX_FILTER_STATUS_ERROR - Failure
2444 /// @note Keep the function which have engine parameter.
2445 //-------------------------------------------------------------------------------------------------
2446 DMX_FILTER_STATUS MApi_DMX_Pvr_MOBF_Enable(MS_BOOL bEnable, MS_U32 u32key0, MS_U32 u32key1);
2447 
2448 //PVR Playback API (Old)
2449 //-------------------------------------------------------------------------------------------------
2450 /// Set playback time stamp.
2451 /// @ingroup TSP_FILEIN_PVR
2452 /// @param u32Stamp        \b IN: time stamp
2453 /// @return DMX_FILTER_STATUS_OK - Success
2454 /// @return DMX_FILTER_STATUS_ERROR - Failure
2455 //-------------------------------------------------------------------------------------------------
2456 DMX_FILTER_STATUS MApi_DMX_Pvr_SetPlaybackStamp(MS_U32 u32Stamp);
2457 //-------------------------------------------------------------------------------------------------
2458 /// Get playback time stamp
2459 /// @ingroup TSP_FILEIN_PVR
2460 /// @param pu32Stamp        \b OUT: time stamp
2461 /// @return DMX_FILTER_STATUS_OK - Success
2462 /// @return DMX_FILTER_STATUS_ERROR - Failure
2463 //-------------------------------------------------------------------------------------------------
2464 DMX_FILTER_STATUS MApi_DMX_Pvr_GetPlaybackStamp(MS_U32* pu32Stamp);
2465 //-------------------------------------------------------------------------------------------------
2466 /// Enable filein time stamp. (filein use 192 mode)
2467 /// @ingroup DMX_ToBeModified_TSP
2468 /// @return DMX_FILTER_STATUS_OK - Success
2469 /// @return DMX_FILTER_STATUS_ERROR - Failure
2470 /// @note:  Merge with MApi_DMX_Pvr_TimeStampDisable
2471 //-------------------------------------------------------------------------------------------------
2472 DMX_FILTER_STATUS MApi_DMX_Pvr_TimeStampEnable(void);
2473 //-------------------------------------------------------------------------------------------------
2474 /// Disable filein time stamp. (filein not use 192 mode)
2475 /// @ingroup DMX_ToBeModified_TSP
2476 /// @return DMX_FILTER_STATUS_OK - Success
2477 /// @return DMX_FILTER_STATUS_ERROR - Failure
2478 /// @note:  Merge with MApi_DMX_Pvr_TimeStampEnable
2479 //-------------------------------------------------------------------------------------------------
2480 DMX_FILTER_STATUS MApi_DMX_Pvr_TimeStampDisable(void);
2481 
2482 
2483 //-----------------
2484 // TSP_PVR_General
2485 //-----------------
2486 //-------------------------------------------------------------------------------------------------
2487 /// Set up the recording parameters.
2488 /// @ingroup TSP_PVR_General
2489 /// @param Eng               \b IN: PVR engine ID
2490 /// @param pPvrInfo          \b IN: the recording parameters
2491 /// @return DMX_FILTER_STATUS_OK - Success
2492 /// @return DMX_FILTER_STATUS_ERROR - Failure
2493 //-------------------------------------------------------------------------------------------------
2494 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Open(DMX_PVR_ENG Eng ,DMX_Pvr_info* pPvrInfo);
2495 
2496 //-------------------------------------------------------------------------------------------------
2497 /// Clear the recording parameters.
2498 /// @ingroup TSP_PVR_General
2499 /// @param Eng               \b IN: PVR engine ID
2500 /// @return DMX_FILTER_STATUS_OK - Success
2501 /// @return DMX_FILTER_STATUS_ERROR - Failure
2502 //-------------------------------------------------------------------------------------------------
2503 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Close(DMX_PVR_ENG Eng );
2504 
2505 //-------------------------------------------------------------------------------------------------
2506 /// Pause/Resume PVR engine.
2507 /// @ingroup TSP_PVR_General
2508 /// @param Eng               \b IN: PVR engine ID
2509 /// @param bPause            \b IN: TRUE: pause, FALSE: resume
2510 /// @return DMX_FILTER_STATUS_OK - Success
2511 /// @return DMX_FILTER_STATUS_ERROR - Failure
2512 //-------------------------------------------------------------------------------------------------
2513  DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Pause(DMX_PVR_ENG Eng ,MS_BOOL bPause);
2514 
2515 //-------------------------------------------------------------------------------------------------
2516 /// Set the PID to be recorded.
2517 /// @ingroup TSP_PVR_General
2518 /// @param Eng                 \b IN: PVR engine ID
2519 /// @param Pid                 \b IN: The target PID to be recorded
2520 /// @param pu8DmxId            \b OUT: The demux filter Id for this recorded PID
2521 /// @return DMX_FILTER_STATUS_OK - Success
2522 /// @return DMX_FILTER_STATUS_ERROR - Failure
2523 //-------------------------------------------------------------------------------------------------
2524 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Pid_Open(DMX_PVR_ENG Eng ,MS_U32 Pid, MS_U8* pu8DmxId);
2525 
2526 //-------------------------------------------------------------------------------------------------
2527 /// Free the PID to be recorded.
2528 /// @ingroup TSP_PVR_General
2529 /// @param Eng                \b IN: PVR engine ID
2530 /// @param u8DmxId            \b IN: The demux filter Id from MApi_DMX_Pvr_Pid_Open
2531 /// @return DMX_FILTER_STATUS_OK - Success
2532 /// @return DMX_FILTER_STATUS_ERROR - Failure
2533 //-------------------------------------------------------------------------------------------------
2534 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Pid_Close(DMX_PVR_ENG Eng ,MS_U8 u8DmxId);
2535 
2536 //-------------------------------------------------------------------------------------------------
2537 /// Start to record.
2538 /// @ingroup TSP_PVR_General
2539 /// @param Eng                \b IN: PVR engine ID
2540 /// @param bPvrAll            \b IN: TRUE to record original bit stream, FALSE to recording the PIDs of interests
2541 /// @return DMX_FILTER_STATUS_OK - Success
2542 /// @return DMX_FILTER_STATUS_ERROR - Failure
2543 //-------------------------------------------------------------------------------------------------
2544 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Start(DMX_PVR_ENG Eng ,MS_BOOL bPvrAll);
2545 
2546 //-------------------------------------------------------------------------------------------------
2547 /// Stop recording.
2548 /// @ingroup TSP_PVR_General
2549 /// @param Eng                \b IN: PVR engine ID
2550 /// @return DMX_FILTER_STATUS_OK - Success
2551 /// @return DMX_FILTER_STATUS_ERROR - Failure
2552 //-------------------------------------------------------------------------------------------------
2553 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Stop(DMX_PVR_ENG Eng );
2554 
2555 //-------------------------------------------------------------------------------------------------
2556 /// Get write pointer of recording buffer.
2557 /// @ingroup TSP_PVR_General
2558 /// @param Eng                \b IN: PVR engine ID
2559 /// @param pphyWrite       \b OUT: the pointer to store the obtained write pointer
2560 /// @return DMX_FILTER_STATUS_OK - Success
2561 /// @return DMX_FILTER_STATUS_ERROR - Failure
2562 //-------------------------------------------------------------------------------------------------
2563 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_WriteGet(DMX_PVR_ENG Eng ,MS_PHY* pphyWrite);
2564 
2565 //-------------------------------------------------------------------------------------------------
2566 /// Set recording packet mode.
2567 /// @ingroup TSP_PVR_General
2568 /// @param Eng                \b IN: PVR engine ID
2569 /// @param bSet               \b IN: TRUE: enable 192 mode, FALSE: disable 192 mode
2570 /// @return DMX_FILTER_STATUS_OK - Success
2571 /// @return DMX_FILTER_STATUS_ERROR - Failure
2572 //-------------------------------------------------------------------------------------------------
2573 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_SetPacketMode(DMX_PVR_ENG Eng ,MS_BOOL bSet);
2574 
2575 //-------------------------------------------------------------------------------------------------
2576 /// Set recording packet mode(extension ver.).
2577 /// @ingroup TSP_PVR_General
2578 /// @param Eng                \b IN: PVR engine ID
2579 /// @param ePvrPktMode        \b IN: DMX record packet type
2580 /// @return DMX_FILTER_STATUS_OK - Success
2581 /// @return DMX_FILTER_STATUS_ERROR - Failure
2582 //-------------------------------------------------------------------------------------------------
2583 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_Pvr_Eng_SetPacketMode_Ex(DMX_PVR_ENG Eng, DMX_Pvr_PacketMode ePvrPktMode);
2584 
2585 //-------------------------------------------------------------------------------------------------
2586 /// Set recording starting time stamp.
2587 /// @ingroup TSP_PVR_General
2588 /// @param Eng                \b IN: PVR engine ID
2589 /// @param u32Stamp           \b IN: Record time-stamp (LPCR)
2590 /// @return DMX_FILTER_STATUS_OK - Success
2591 /// @return DMX_FILTER_STATUS_ERROR - Failure
2592 //-------------------------------------------------------------------------------------------------
2593 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_SetRecordStamp(DMX_PVR_ENG Eng ,MS_U32 u32Stamp);
2594 
2595 //-------------------------------------------------------------------------------------------------
2596 /// Get current recording time stamp.
2597 /// @ingroup TSP_PVR_General
2598 /// @param Eng                \b IN: PVR engine ID
2599 /// @param pu32Stamp          \b OUT: the pointer to store the obtained record time-stamp (LPCR)
2600 /// @return DMX_FILTER_STATUS_OK - Success
2601 /// @return DMX_FILTER_STATUS_ERROR - Failure
2602 //-------------------------------------------------------------------------------------------------
2603 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_GetRecordStamp(DMX_PVR_ENG Eng ,MS_U32* pu32Stamp);
2604 
2605 //-------------------------------------------------------------------------------------------------
2606 /// Enable MOBF encrypt.
2607 /// @ingroup TSP_PVR_General
2608 /// @param u8Eng               \b IN: PVR engine ID
2609 /// @param bEnable             \b IN: PVR MOBF Enable/Disable
2610 /// @param u32key0             \b IN: MOBF encrypt key0
2611 /// @param u32key1             \b IN: MOBF encrypt key1
2612 /// @return DMX_FILTER_STATUS_OK - Success
2613 /// @return DMX_FILTER_STATUS_ERROR - Failure
2614 //-------------------------------------------------------------------------------------------------
2615 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_MOBF_Enable(MS_U8 u8Eng, MS_BOOL bEnable, MS_U32 u32key0, MS_U32 u32key1);
2616 
2617 //-------------------------------------------------------------------------------------------------
2618 /// Check if PVR engine is started.
2619 /// @ingroup TSP_PVR_General
2620 /// @param Eng                 \b IN: PVR engine ID
2621 /// @param pbIsStart           \b OUT: Pointer to store PVR engine starting status
2622 /// @return DMX_FILTER_STATUS_OK - Success
2623 /// @return DMX_FILTER_STATUS_ERROR - Failure
2624 //-------------------------------------------------------------------------------------------------
2625 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_IsStart(DMX_PVR_ENG Eng, MS_BOOL *pbIsStart);
2626 
2627 //-----------------
2628 // TSP_PVR_STB
2629 //-----------------
2630 //-------------------------------------------------------------------------------------------------
2631 /// Set/Get PVR PID filter PID.
2632 /// @ingroup TSP_PVR_STB
2633 /// @param Eng                 \b IN: PVR engine ID
2634 /// @param u8DmxId             \b IN: PID filter index
2635 /// @param Pid                 \b IN: PID value
2636 /// @param bSet                \b IN: TRUE: set, FALSE: get
2637 /// @return DMX_FILTER_STATUS_OK - Success
2638 /// @return DMX_FILTER_STATUS_ERROR - Failure
2639 /// @note Only TSP 2.0/4.0 use this function now.
2640 //-------------------------------------------------------------------------------------------------
2641  DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_Pid(DMX_PVR_ENG Eng ,MS_U8 u8DmxId , MS_U32 *Pid, MS_BOOL bSet);
2642 //-------------------------------------------------------------------------------------------------
2643 /// Set PVR time-stamp clock.
2644 /// @ingroup TSP_PVR_General
2645 /// @param Eng                \b IN: PVR engine ID
2646 /// @param eClk               \b IN: select 90K or 27M
2647 /// @return DMX_FILTER_STATUS_OK - Success
2648 /// @return DMX_FILTER_STATUS_ERROR - Failure
2649 //-------------------------------------------------------------------------------------------------
2650 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_SetRecordStampClk(DMX_PVR_ENG Eng, DMX_TimeStamp_Clk eClk);
2651 //-------------------------------------------------------------------------------------------------
2652 /// Set RASP callback engine size.
2653 /// @ingroup TSP_PVR_STB
2654 /// @param Eng                \b IN: PVR engine ID
2655 /// @param pu32CallbackSize               \b IN: select 90K or 27M
2656 /// @param bSet
2657 /// @return DMX_FILTER_STATUS_OK - Success
2658 /// @return DMX_FILTER_STATUS_ERROR - Failure
2659 /// @note Only TSP 2.0 use this function now.
2660 //-------------------------------------------------------------------------------------------------
2661  DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_CallbackSize(DMX_PVR_ENG Eng, MS_U32* pu32CallbackSize, MS_BOOL bSet);
2662 //-------------------------------------------------------------------------------------------------
2663 ///Set PVR CA SPS enable mode
2664 /// @ingroup TSP_PVR_STB
2665 /// @param Eng                  \b IN: PVR Engine ID
2666 /// @param eCaMode              \b IN: CA PVR Selection, 0: from TSP, 1: from ca program0, 2: from ca program1
2667 /// @param bspsEnable           \b IN: SPS mode enabled flag
2668 /// @return DMX_FILTER_STATUS_OK - Success
2669 /// @return DMX_FILTER_STATUS_ERROR - Failure
2670 //-------------------------------------------------------------------------------------------------
2671  DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_SetCaMode(DMX_PVR_ENG Eng, DMX_CA_PVRMODE eCaMode, MS_BOOL bspsEnable);
2672 
2673 //-------------------------------------------------------------------------------------------------
2674 /// Set playback time-stamp clock.
2675 /// @ingroup TSP_FILEIN_PVR
2676 /// @param u8Eng              \b IN: PVR engine ID
2677 /// @param eClk               \b IN: select 90K or 27M
2678 /// @return DMX_FILTER_STATUS_OK - Success
2679 /// @return DMX_FILTER_STATUS_ERROR - Failure
2680 //-------------------------------------------------------------------------------------------------
2681 DMX_FILTER_STATUS MApi_DMX_Pvr_Eng_SetPlaybackStampClk(MS_U8 u8Eng, DMX_TimeStamp_Clk eClk);
2682 
2683 //PVR CA API (Old)
2684 //-------------------------------------------------------------------------------------------------
2685 /// Open PVR PID filter for recording scramble stream depended on Engine ID.
2686 /// @ingroup DMX_ToBeRemove
2687 /// @param Pid                         \b IN: PID to record
2688 /// @param pu8DmxId                    \b IN: Pointer to store PVR PID filter index
2689 /// @return DMX_FILTER_STATUS_OK - Success
2690 /// @return DMX_FILTER_STATUS_ERROR - Failure
2691 /// @note Keep the function which have engine parameter.
2692 //-------------------------------------------------------------------------------------------------
2693 DMX_FILTER_STATUS MApi_DMX_PvrCA_Pid_Open(MS_U32 Pid, MS_U8* pu8DmxId);
2694 
2695 //-------------------------------------------------------------------------------------------------
2696 /// Close PVR PID filter depended on Engine ID.
2697 /// @ingroup DMX_ToBeRemove
2698 /// @param u8DmxId         \b IN: PID filter index to close
2699 /// @return DMX_FILTER_STATUS_OK - Success
2700 /// @return DMX_FILTER_STATUS_ERROR - Failure
2701 /// @note Keep the function which have engine parameter.
2702 //-------------------------------------------------------------------------------------------------
2703 DMX_FILTER_STATUS MApi_DMX_PvrCA_Pid_Close(MS_U8 u8DmxId);
2704 
2705 //-------------------------------------------------------------------------------------------------
2706 /// Start to record scramble stream depend on engine id.
2707 /// @ingroup DMX_ToBeRemove
2708 /// @param bPvrAll             \b IN: If true, record all stream data; if false, record data by PIDs
2709 /// @return DMX_FILTER_STATUS_OK - Success
2710 /// @return DMX_FILTER_STATUS_ERROR - Failure
2711 /// @note Keep the function which have engine parameter.
2712 //-------------------------------------------------------------------------------------------------
2713 DMX_FILTER_STATUS MApi_DMX_PvrCA_Start(MS_BOOL bPvrAll);
2714 //-------------------------------------------------------------------------------------------------
2715 /// Stop to record scramble stream.
2716 /// @ingroup DMX_ToBeRemove
2717 /// @return DMX_FILTER_STATUS_OK - Success
2718 /// @return DMX_FILTER_STATUS_ERROR - Failure
2719 /// @note Keep the function which have engine parameter.
2720 //-------------------------------------------------------------------------------------------------
2721 DMX_FILTER_STATUS MApi_DMX_PvrCA_Stop(void);
2722 
2723 //-----------------
2724 // TSP_PVR_CA
2725 //-----------------
2726 //-------------------------------------------------------------------------------------------------
2727 /// Open PVR PID filter for recording scramble stream depended on Engine ID.
2728 /// @ingroup TSP_PVR_CA
2729 /// @param Eng                         \b IN: PVR engine ID
2730 /// @param Pid                         \b IN: PID to record
2731 /// @param pu8DmxId                    \b IN: Pointer to store PVR PID filter index
2732 /// @param u8ShareKeyType              \b IN: PID filter share key type. 0: Not use sharekey filters.
2733 /// @return DMX_FILTER_STATUS_OK - Success
2734 /// @return DMX_FILTER_STATUS_ERROR - Failure
2735 //-------------------------------------------------------------------------------------------------
2736 DMX_FILTER_STATUS MApi_DMX_PvrCA_Eng_Pid_Open(DMX_PVR_ENG Eng, MS_U32 Pid, MS_U8* pu8DmxId, MS_U8 u8ShareKeyType);
2737 //-------------------------------------------------------------------------------------------------
2738 /// Close PVR PID filter depended on Engine ID.
2739 /// @ingroup TSP_PVR_CA
2740 /// @param Eng                 \b IN: PVR engine ID
2741 /// @param u8DmxId             \b IN: PID filter index to close
2742 /// @return DMX_FILTER_STATUS_OK - Success
2743 /// @return DMX_FILTER_STATUS_ERROR - Failure
2744 //-------------------------------------------------------------------------------------------------
2745 DMX_FILTER_STATUS MApi_DMX_PvrCA_Eng_Pid_Close(DMX_PVR_ENG Eng, MS_U8 u8DmxId);
2746 //-------------------------------------------------------------------------------------------------
2747 /// Start to record scramble stream depend on engine id.
2748 /// @ingroup TSP_PVR_CA
2749 /// @param Eng                  \b IN: PVR engine ID
2750 /// @param bPvrAll              \b IN: If true, record all stream data; if false, record data by PIDs
2751 /// @return DMX_FILTER_STATUS_OK - Success
2752 /// @return DMX_FILTER_STATUS_ERROR - Failure
2753 //-------------------------------------------------------------------------------------------------
2754 DMX_FILTER_STATUS MApi_DMX_PvrCA_Eng_Start(DMX_PVR_ENG Eng, MS_BOOL bPvrAll);
2755 //-------------------------------------------------------------------------------------------------
2756 /// Stop to record scramble stream.
2757 /// @ingroup TSP_PVR_CA
2758 /// @param Eng                  \b IN: PVR engine ID
2759 /// @return DMX_FILTER_STATUS_OK - Success
2760 /// @return DMX_FILTER_STATUS_ERROR - Failure
2761 //-------------------------------------------------------------------------------------------------
2762 DMX_FILTER_STATUS MApi_DMX_PvrCA_Eng_Stop(DMX_PVR_ENG Eng);
2763 //---------------------------------------------
2764 
2765 //-----------------
2766 // TSP_FILEIN_PVR
2767 //-----------------
2768 //-------------------------------------------------------------------------------------------------
2769 /// Open & set pid filter for file-in PVR using.
2770 /// @ingroup TSP_FILEIN_PVR
2771 /// @param Eng                             \b IN   : PVR eigine id
2772 /// @param Pid                             \b IN   : PVR PID to record
2773 /// @param pu8DmxId                        \b OUT: Pointer to store PID filter index
2774 /// @param u8ShareKeyType                  \b IN   : The flag of sharekey filter using. if 0, not use sharekey filters
2775 /// @return DMX_FILTER_STATUS_OK - Success
2776 /// @return DMX_FILTER_STATUS_ERROR - Failure
2777 //-------------------------------------------------------------------------------------------------
2778 DMX_FILTER_STATUS MApi_DMX_Filein_Pvr_Eng_Pid_Open(DMX_PVR_ENG Eng, MS_U32 Pid, MS_U8* pu8DmxId, MS_U8 u8ShareKeyType);
2779 
2780 //-------------------------------------------------------------------------------------------------
2781 /// Close pid filter of file-in PVR.
2782 /// @ingroup TSP_FILEIN_PVR
2783 /// @param Eng                        \b IN   : PVR eigine id
2784 /// @param u8DmxId                    \b IN   : PID filter id
2785 /// @return DMX_FILTER_STATUS_OK - Success
2786 /// @return DMX_FILTER_STATUS_ERROR - Failure
2787 //-------------------------------------------------------------------------------------------------
2788  DMX_FILTER_STATUS MApi_DMX_Filein_Pvr_Eng_Pid_Close(DMX_PVR_ENG Eng, MS_U8 u8DmxId);
2789 
2790 //-------------------------------------------------------------------------------------------------
2791 /// Start file-in PVR recording.
2792 /// @ingroup TSP_FILEIN_PVR
2793 /// @param Eng                         \b IN   : PVR eigine id
2794 /// @param bPvrAll                     \b IN   : FALSE is record PID, TRUE is record All ts data
2795 /// @return DMX_FILTER_STATUS_OK - Success
2796 /// @return DMX_FILTER_STATUS_ERROR - Failure
2797 //-------------------------------------------------------------------------------------------------
2798 DMX_FILTER_STATUS MApi_DMX_Filein_Pvr_Eng_Start(DMX_PVR_ENG Eng, MS_BOOL bPvrAll);
2799 
2800 //-------------------------------------------------------------------------------------------------
2801 /// Stop file-in PVR recording.
2802 /// @ingroup TSP_FILEIN_PVR
2803 /// @param Eng                         \b IN   : PVR eigine id
2804 /// @return DMX_FILTER_STATUS_OK - Success
2805 /// @return DMX_FILTER_STATUS_ERROR - Failure
2806 //-------------------------------------------------------------------------------------------------
2807  DMX_FILTER_STATUS MApi_DMX_Filein_Pvr_Eng_Stop(DMX_PVR_ENG Eng);
2808 //---------------------------------------------
2809 
2810 
2811 // File-in API (Old)
2812 //-------------------------------------------------------------------------------------------------
2813 /// Start to get bit stream from memory.
2814 /// @ingroup DMX_ToBeRemove
2815 /// @param Dst              \b IN: file in destination type
2816 /// @param pBuf             \b IN: the memory containing the bit stream
2817 /// @param u32BufSize       \b IN: the size the memory to get
2818 /// @return DMX_FILTER_STATUS_OK - Success
2819 /// @return DMX_FILTER_STATUS_ERROR - Failure
2820 /// @note Keep the function which have path parameter.
2821 //-------------------------------------------------------------------------------------------------
2822 DMX_FILTER_STATUS MApi_DMX_Filein_Start(DMX_FILEIN_DST Dst, MS_PHY pBuf, MS_U32 u32BufSize);   // msAPI_DMX_PESPlayback/msAPI_DMX_TSPlayback will integrate into it
2823 //-------------------------------------------------------------------------------------------------
2824 /// Stop to get bit stream from memeory.
2825 /// @ingroup DMX_ToBeRemove
2826 /// @return DMX_FILTER_STATUS_OK - Success
2827 /// @return DMX_FILTER_STATUS_ERROR - Failure
2828 /// @note Keep the function which have path parameter.
2829 //-------------------------------------------------------------------------------------------------
2830 DMX_FILTER_STATUS MApi_DMX_Filein_Stop(void);
2831 
2832 //-------------------------------------------------------------------------------------------------
2833 /// Set up parameters for input bit stream from memory.
2834 /// @ingroup DMX_ToBeRemove
2835 /// @param pFileinInfo      \b IN: the file in parameters
2836 /// @return DMX_FILTER_STATUS_OK - Success
2837 /// @return DMX_FILTER_STATUS_ERROR - Failure
2838 /// @note Keep the function which have path parameter.
2839 //-------------------------------------------------------------------------------------------------
2840 DMX_FILTER_STATUS MApi_DMX_Filein_Info(DMX_Filein_info *pFileinInfo);
2841 //-------------------------------------------------------------------------------------------------
2842 /// Pause to get bit stream by memeory.
2843 /// @ingroup DMX_ToBeRemove
2844 /// @return DMX_FILTER_STATUS_OK - Success
2845 /// @return DMX_FILTER_STATUS_ERROR - Failure
2846 /// @note Keep the function which have path parameter.
2847 //-------------------------------------------------------------------------------------------------
2848 DMX_FILTER_STATUS MApi_DMX_Filein_Pause(void);
2849 //-------------------------------------------------------------------------------------------------
2850 /// Pause to get bit stream by memeory.
2851 /// @ingroup DMX_ToBeRemove
2852 /// @return DMX_FILTER_STATUS_OK - Success
2853 /// @return DMX_FILTER_STATUS_ERROR - Failure
2854 /// @note Keep the function which have path parameter.
2855 //-------------------------------------------------------------------------------------------------
2856 DMX_FILTER_STATUS MApi_DMX_Filein_Resume(void);
2857 
2858 //-------------------------------------------------------------------------------------------------
2859 /// Check if no memory transfer is under going.
2860 /// @ingroup DMX_ToBeRemove
2861 /// @return TRUE - if idle
2862 /// @return FALSE - otherwise
2863 /// @note Keep the function which have path parameter.
2864 //-------------------------------------------------------------------------------------------------
2865 MS_BOOL           MApi_DMX_Filein_IsIdle(void);
2866 
2867 //-------------------------------------------------------------------------------------------------
2868 /// Check if memory transfer is under going.
2869 /// @ingroup DMX_ToBeRemove
2870 /// @return TRUE - if idle
2871 /// @return FALSE - otherwise
2872 /// @note Keep the function which have path parameter.
2873 //-------------------------------------------------------------------------------------------------
2874 MS_BOOL           MApi_DMX_Filein_IsBusy(void);
2875 
2876 //-------------------------------------------------------------------------------------------------
2877 /// Check if memory transfer is paused.
2878 /// @ingroup DMX_ToBeRemove
2879 /// @return TRUE - if idle
2880 /// @return FALSE - otherwise
2881 /// @note Keep the function which have path parameter.
2882 //-------------------------------------------------------------------------------------------------
2883 MS_BOOL           MApi_DMX_Filein_IsPause(void);
2884 
2885 //-------------------------------------------------------------------------------------------------
2886 /// Reset CMDQ.
2887 /// @ingroup DMX_ToBeRemove
2888 /// @return DMX_FILTER_STATUS_OK - Success
2889 /// @return DMX_FILTER_STATUS_ERROR - Failure
2890 /// @note Keep the function which have path parameter.
2891 //-------------------------------------------------------------------------------------------------
2892 DMX_FILTER_STATUS MApi_DMX_Filein_CMDQ_Reset(void);
2893 
2894 //-------------------------------------------------------------------------------------------------
2895 /// Get the number of CMDQ empty slot.
2896 /// @ingroup DMX_ToBeRemove
2897 /// @param pu32EmptySlot      \b OUT: empty slot number
2898 /// @return DMX_FILTER_STATUS_OK - Success
2899 /// @return DMX_FILTER_STATUS_ERROR - Failure
2900 /// @note Keep the function which have path parameter.
2901 //-------------------------------------------------------------------------------------------------
2902 DMX_FILTER_STATUS MApi_DMX_Filein_CMDQ_GetEmptyNum(MS_U32 *pu32EmptySlot);
2903 
2904 //-------------------------------------------------------------------------------------------------
2905 /// Get Command queue FIFO level.
2906 /// @ingroup DMX_ToBeRemove
2907 /// @param  pu8CmdQStatus   \b OUT: fifo level, 0~3
2908 /// @return DMX_FILTER_STATUS_OK - Success
2909 /// @return DMX_FILTER_STATUS_ERROR - Failure
2910 /// @note Keep the function which have path parameter.
2911 //-------------------------------------------------------------------------------------------------
2912 DMX_FILTER_STATUS MApi_DMX_Filein_CMDQ_FIFOWriteLevel(MS_U8 *pu8CmdQStatus);
2913 
2914 //-------------------------------------------------------------------------------------------------
2915 /// Disable 192 mode blovk scheme to bypass fill-in timestamp
2916 /// @ingroup DMX_ToBeRemove
2917 /// @param bbypass     \b IN: TRUE: bypass file-in timestamp, FALSE: not bypass
2918 /// @return None
2919 /// @note Keep the function which have path parameter.
2920 //-------------------------------------------------------------------------------------------------
2921 void MApi_DMX_BypassFileInTimeStamp(MS_BOOL bbypass);
2922 //-------------------------------------------------------------------------------------------------
2923 /// Get Command queue FIFO level.
2924 /// @ingroup DMX_ToBeRemove
2925 /// @param  pu8CmdQStatus   \b OUT: fifo level, 0~3
2926 /// - 0: 0 to 25% full
2927 /// - 1: 25 to 50% full
2928 /// - 2: 50 to 75% full
2929 /// - 3: 75 to 100% full
2930 /// @return DMX_FILTER_STATUS_OK - Success
2931 /// @return DMX_FILTER_STATUS_ERROR - Failure
2932 /// @note Keep the function which have path parameter.
2933 //-------------------------------------------------------------------------------------------------
2934 DMX_FILTER_STATUS MApi_DMX_Filein_CMDQ_FIFOWriteLevel(MS_U8 *pu8CmdQStatus);
2935 
2936 //-------------------------------------------------------------------------------------------------
2937 /// Get filein time stamp. (Current time stamp from TS packet). It is used on 192 packet mode.
2938 /// @ingroup DMX_ToBeRemove
2939 /// @param pu32FileInTS     \b OUT: pointer to store time-stamp value
2940 /// @return DMX_FILTER_STATUS_OK - Success
2941 /// @return DMX_FILTER_STATUS_ERROR - Failure
2942 /// @note Keep the function which have path parameter.
2943 //-------------------------------------------------------------------------------------------------
2944 DMX_FILTER_STATUS MApi_DMX_GetFileInTimeStamp(MS_U32 *pu32FileInTS);
2945 
2946 //-------------------------------------------------------------------------------------------------
2947 /// Get playback read address.
2948 /// @ingroup DMX_ToBeRemove
2949 /// @param pphyRead        \b OUT: pointer to store read address
2950 /// @return DMX_FILTER_STATUS_OK - Success
2951 /// @return DMX_FILTER_STATUS_ERROR - Failure
2952 /// @note Keep the function which have path parameter.
2953 //-------------------------------------------------------------------------------------------------
2954 DMX_FILTER_STATUS MApi_DMX_Filein_GetReadAddr(MS_PHY* pphyRead);
2955 
2956 //-------------------------------------------------------------------------------------------------
2957 /// Enable MOBF decrypt key.
2958 /// @ingroup DMX_ToBeRemove
2959 /// @param bEnable    \b IN: File-in MOBF Enable/Disable
2960 /// @param u32key     \b IN: MOBF dyncrypt u32key
2961 /// @return DMX_FILTER_STATUS_OK - Success
2962 /// @return DMX_FILTER_STATUS_ERROR - Failure
2963 /// @note Keep the function which have path parameter.
2964 //-------------------------------------------------------------------------------------------------
2965 DMX_FILTER_STATUS MApi_DMX_Filein_MOBF_Enable(MS_BOOL bEnable, MS_U32 u32key);
2966 
2967 //-----------------
2968 // TSP_Playback
2969 //-----------------
2970 //-------------------------------------------------------------------------------------------------
2971 /// Start to get bit stream from memory.
2972 /// @ingroup TSP_Playback
2973 /// @param ePath            \b IN: file in path (TSIF)
2974 /// @param Dst              \b IN: file in destination type
2975 /// @param pBuf             \b IN: the memory containing the bit stream
2976 /// @param u32BufSize       \b IN: the size the memory to get
2977 /// @return DMX_FILTER_STATUS_OK - Success
2978 /// @return DMX_FILTER_STATUS_ERROR - Failure
2979 //-------------------------------------------------------------------------------------------------
2980 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_Start(DMX_FILEIN_PATH ePath, DMX_FILEIN_DST Dst, MS_PHY pBuf, MS_U32 u32BufSize);   // msAPI_DMX_PESPlayback/msAPI_DMX_TSPlayback will integrate into it
2981 //-------------------------------------------------------------------------------------------------
2982 /// Stop to get bit stream from memeory.
2983 /// @ingroup TSP_Playback
2984 /// @param ePath            \b IN: file in path (TSIF)
2985 /// @return DMX_FILTER_STATUS_OK - Success
2986 /// @return DMX_FILTER_STATUS_ERROR - Failure
2987 //-------------------------------------------------------------------------------------------------
2988  DMX_FILTER_STATUS MApi_DMX_Filein_Eng_Stop(DMX_FILEIN_PATH ePath);
2989 //-------------------------------------------------------------------------------------------------
2990 /// Set up parameters for input bit stream from memory.
2991 /// @ingroup TSP_Playback
2992 /// @param ePath             \b IN: file in path (TSIF)
2993 /// @param pFileinInfo       \b IN: the file in parameters
2994 /// @return DMX_FILTER_STATUS_OK - Success
2995 /// @return DMX_FILTER_STATUS_ERROR - Failure
2996 //-------------------------------------------------------------------------------------------------
2997 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_Info(DMX_FILEIN_PATH ePath, DMX_Filein_info *pFileinInfo);
2998 //-------------------------------------------------------------------------------------------------
2999 /// Pause to get bit stream by memeory.
3000 /// @ingroup TSP_Playback
3001 /// @param ePath             \b IN: file in path (TSIF)
3002 /// @return DMX_FILTER_STATUS_OK - Success
3003 /// @return DMX_FILTER_STATUS_ERROR - Failure
3004 //-------------------------------------------------------------------------------------------------
3005 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_Pause(DMX_FILEIN_PATH ePath);
3006 //-------------------------------------------------------------------------------------------------
3007 /// Pause to get bit stream by memeory.
3008 /// @ingroup TSP_Playback
3009 /// @param ePath             \b IN: file in path (TSIF)
3010 /// @return DMX_FILTER_STATUS_OK - Success
3011 /// @return DMX_FILTER_STATUS_ERROR - Failure
3012 //-------------------------------------------------------------------------------------------------
3013 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_Resume(DMX_FILEIN_PATH ePath);
3014 
3015 //-------------------------------------------------------------------------------------------------
3016 /// Check if no memory transfer is under going.
3017 /// @ingroup TSP_Playback
3018 /// @param ePath             \b IN: file in path (TSIF)
3019 /// @return TRUE - if idle
3020 /// @return FALSE - otherwise
3021 //-------------------------------------------------------------------------------------------------
3022 MS_BOOL           MApi_DMX_Filein_Eng_IsIdle(DMX_FILEIN_PATH ePath);
3023 //-------------------------------------------------------------------------------------------------
3024 /// Check if memory transfer is under going.
3025 /// @ingroup TSP_Playback
3026 /// @param ePath             \b IN: file in path (TSIF)
3027 /// @return TRUE - if idle
3028 /// @return FALSE - otherwise
3029 //-------------------------------------------------------------------------------------------------
3030  MS_BOOL          MApi_DMX_Filein_Eng_IsBusy(DMX_FILEIN_PATH ePath);
3031 //-------------------------------------------------------------------------------------------------
3032 /// Check if memory transfer is paused.
3033 /// @ingroup TSP_Playback
3034 /// @param ePath             \b IN: file in path (TSIF)
3035 /// @return TRUE - if idle
3036 /// @return FALSE - otherwise
3037 //-------------------------------------------------------------------------------------------------
3038  MS_BOOL          MApi_DMX_Filein_Eng_IsPause(DMX_FILEIN_PATH ePath);
3039 //-------------------------------------------------------------------------------------------------
3040 /// Reset CMDQ.
3041 /// @ingroup TSP_Playback
3042 /// @param ePath             \b IN: file in path (TSIF)
3043 /// @return DMX_FILTER_STATUS_OK - Success
3044 /// @return DMX_FILTER_STATUS_ERROR - Failure
3045 //-------------------------------------------------------------------------------------------------
3046 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_CMDQ_Reset(DMX_FILEIN_PATH ePath);
3047 //-------------------------------------------------------------------------------------------------
3048 /// Get the number of CMDQ empty slot.
3049 /// @ingroup TSP_Playback
3050 /// @param ePath                   \b IN: file in path (TSIF)
3051 /// @param pu32EmptySlot           \b OUT: empty slot number
3052 /// @return DMX_FILTER_STATUS_OK - Success
3053 /// @return DMX_FILTER_STATUS_ERROR - Failure
3054 //-------------------------------------------------------------------------------------------------
3055 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_CMDQ_GetEmptyNum(DMX_FILEIN_PATH ePath, MS_U32 *pu32EmptySlot);
3056 //-------------------------------------------------------------------------------------------------
3057 /// Disable 192 mode blovk scheme to bypass fill-in timestamp
3058 /// @ingroup TSP_Playback
3059 /// @param ePath         \b IN: file in path (TSIF)
3060 /// @param bbypass       \b IN: TRUE: bypass file-in timestamp, FALSE: not bypass
3061 /// @return None
3062 //-------------------------------------------------------------------------------------------------
3063 void              MApi_DMX_Filein_Eng_BypassFileInTimeStamp(DMX_FILEIN_PATH ePath, MS_BOOL bbypass);
3064 //-------------------------------------------------------------------------------------------------
3065 /// Get Command queue FIFO level.
3066 /// @ingroup TSP_Playback
3067 /// @param ePath                   \b IN: file in path (TSIF)
3068 /// @param  pu8CmdQStatus          \b OUT: fifo level, 0~3
3069 /// @return DMX_FILTER_STATUS_OK - Success
3070 /// @return DMX_FILTER_STATUS_ERROR - Failure
3071 //-------------------------------------------------------------------------------------------------
3072 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_CMDQ_FIFOWriteLevel(DMX_FILEIN_PATH ePath, MS_U8 *pu8CmdQStatus);
3073 //-------------------------------------------------------------------------------------------------
3074 /// Get filein time stamp. (Current time stamp from TS packet). It is used on 192 packet mode.
3075 /// @ingroup TSP_Playback
3076 /// @param ePath                \b IN: file in path (TSIF)
3077 /// @param pu32FileInTS         \b OUT: pointer to store time-stamp value
3078 /// @return DMX_FILTER_STATUS_OK - Success
3079 /// @return DMX_FILTER_STATUS_ERROR - Failure
3080 //-------------------------------------------------------------------------------------------------
3081 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_GetFileInTimeStamp(DMX_FILEIN_PATH ePath, MS_U32 *pu32FileInTS);
3082 
3083 //-------------------------------------------------------------------------------------------------
3084 /// Get playback read address.
3085 /// @ingroup TSP_Playback
3086 /// @param ePath              \b IN: file in path (TSIF)
3087 /// @param pphyRead           \b OUT: pointer to store read address
3088 /// @return DMX_FILTER_STATUS_OK - Success
3089 /// @return DMX_FILTER_STATUS_ERROR - Failure
3090 //-------------------------------------------------------------------------------------------------
3091 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_GetReadAddr(DMX_FILEIN_PATH ePath, MS_PHY* pphyRead);
3092 //-------------------------------------------------------------------------------------------------
3093 /// Enable MOBF decrypt key.
3094 /// @ingroup TSP_Playback
3095 /// @param ePath        \b IN: file in path (TSIF)
3096 /// @param bEnable      \b IN: File-in MOBF Enable/Disable
3097 /// @param u32key       \b IN: MOBF dyncrypt u32key
3098 /// @return DMX_FILTER_STATUS_OK - Success
3099 /// @return DMX_FILTER_STATUS_ERROR - Failure
3100 //-------------------------------------------------------------------------------------------------
3101 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_MOBF_Enable(DMX_FILEIN_PATH ePath, MS_BOOL bEnable, MS_U32 u32key);
3102 
3103 //-------------------------------------------------------------------------------------------------
3104 /// Enable FileEng Playback time stamp.
3105 /// @ingroup TSP_Playback
3106 /// @param ePath         \b IN: file in path (TSIF)
3107 /// @return DMX_FILTER_STATUS_OK - Success
3108 /// @return DMX_FILTER_STATUS_ERROR - Failure
3109 //-------------------------------------------------------------------------------------------------
3110 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_PlaybackTimeStampEnable(DMX_FILEIN_PATH ePath);
3111 
3112 //-------------------------------------------------------------------------------------------------
3113 /// Disable fileEng Playback time stamp.
3114 /// @ingroup TSP_Playback
3115 /// @param ePath         \b IN: file in path (TSIF)
3116 /// @return DMX_FILTER_STATUS_OK - Success
3117 /// @return DMX_FILTER_STATUS_ERROR - Failure
3118 //-------------------------------------------------------------------------------------------------
3119 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_PlaybackTimeStampDisable(DMX_FILEIN_PATH ePath);
3120 
3121 //-------------------------------------------------------------------------------------------------
3122 /// Set playback time stamp. (LPCR)
3123 /// @ingroup TSP_Playback
3124 /// @param ePath              \b IN: file in path (TSIF)
3125 /// @param u32Stamp           \b IN: time-stamp value
3126 /// @return DMX_FILTER_STATUS_OK - Success
3127 /// @return DMX_FILTER_STATUS_ERROR - Failure
3128 //-------------------------------------------------------------------------------------------------
3129 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_SetPlaybackStamp(DMX_FILEIN_PATH ePath,MS_U32 u32Stamp);
3130 //-------------------------------------------------------------------------------------------------
3131 /// Get playback time stamp. (LPCR)
3132 /// @ingroup TSP_Playback
3133 /// @param ePath              \b IN: file in path (TSIF)
3134 /// @param pu32Stamp          \b OUT: pointer to store time-stamp value
3135 /// @return DMX_FILTER_STATUS_OK - Success
3136 /// @return DMX_FILTER_STATUS_ERROR - Failure
3137 //-------------------------------------------------------------------------------------------------
3138 DMX_FILTER_STATUS MApi_DMX_Filein_Eng_GetPlaybackStamp(DMX_FILEIN_PATH ePath,MS_U32* pu32Stamp);
3139 
3140 
3141 //-------------------------------------------------------------
3142 //MMFI & MINITSP API
3143 //-----------------
3144 // TSP_MM
3145 //-----------------
3146 //-------------------------------------------------------------------------------------------------
3147 /// Check mmfi engine is ilde or not.
3148 /// @ingroup TSP_MM
3149 /// @param  ePath     \b IN: MM File-in Path
3150 /// @return TRUE - Idle
3151 /// @return FALSE - not idle
3152 //-------------------------------------------------------------------------------------------------
3153 MS_BOOL           MApi_DMX_MMFI_Filein_IsIdle(DMX_MMFI_PATH ePath);
3154 
3155 //-------------------------------------------------------------------------------------------------
3156 /// Check mmfi engine is busy or not.
3157 /// @ingroup TSP_MM
3158 /// @param  ePath      \b IN: MM File-in Path
3159 /// @return TRUE - Busy
3160 /// @return FALSE - not busy
3161 //-------------------------------------------------------------------------------------------------
3162 MS_BOOL          MApi_DMX_MMFI_Filein_IsBusy(DMX_MMFI_PATH ePath);
3163 
3164 //-------------------------------------------------------------------------------------------------
3165 /// Reset MMFilein Command queue
3166 /// @ingroup TSP_MM
3167 /// @param  ePath       \b IN: MM File-in Path
3168 /// @return DMX_FILTER_STATUS_OK - Success
3169 /// @return DMX_FILTER_STATUS_ERROR - Failure
3170 //-------------------------------------------------------------------------------------------------
3171 DMX_FILTER_STATUS MApi_DMX_MMFI_Filein_CMDQ_Reset(DMX_MMFI_PATH ePath);
3172 
3173 //-------------------------------------------------------------------------------------------------
3174 /// Get the MMFilein CMDQ empty slot number.
3175 /// @ingroup TSP_MM
3176 /// @param  ePath                  \b IN: MM File-in Path
3177 /// @param  pu32EmptySlot          \b OUT: Empty slot
3178 /// @return DMX_FILTER_STATUS_OK - Success
3179 /// @return DMX_FILTER_STATUS_ERROR - Failure
3180 /// @note The user can use MApi_DMX_MMFI_Filein_Start() as a multimedia file-in command to input data from memory to the demultiplexer. \n
3181 /// The DMX engine allows to add multimedia file-in command without having to wait that the previous multimedia file-in command have been processed completely. \n
3182 /// In this mode the waited multimedia file-in commands are stored to the so-called multimedia file-in command queue. \n
3183 /// However, the size of the command queue is limited and each multimedia file-in command will consumes 5 slots in the multimedia file-in command queue. \n
3184 /// Therefore, the caller has to check the number of empty slots in the multimedia file-in command queue with MApi_DMX_MMFI_Filein_CMDQ_GetEmptyNum()
3185 /// before adding a new multimedia file-in command.
3186 //-------------------------------------------------------------------------------------------------
3187 DMX_FILTER_STATUS MApi_DMX_MMFI_Filein_CMDQ_GetEmptyNum(DMX_MMFI_PATH ePath, MS_U32 *pu32EmptySlot);
3188 
3189 //-------------------------------------------------------------------------------------------------
3190 /// Start to get bit stream by memeory.
3191 /// @ingroup TSP_MM
3192 /// @param eDst             \b IN: file in destination path
3193 /// @param pBuf             \b IN: the memory containing the bit stream
3194 /// @param u32BufSize       \b IN: the size the memory to get
3195 /// @return DMX_FILTER_STATUS_OK - Success
3196 /// @return DMX_FILTER_STATUS_ERROR - Failure
3197 //-------------------------------------------------------------------------------------------------
3198 DMX_FILTER_STATUS MApi_DMX_MMFI_Filein_Start(DMX_MMFI_DST eDst, MS_PHY pBuf, MS_U32 u32BufSize);
3199 
3200 //-------------------------------------------------------------------------------------------------
3201 /// Set up parameters for input bit stream from memory.
3202 /// @ingroup TSP_MM
3203 /// @param  ePath           \b IN: MM File-in Path
3204 /// @param pFileinInfo      \b IN: the file in parameters
3205 /// @return DMX_FILTER_STATUS_OK - Success
3206 /// @return DMX_FILTER_STATUS_ERROR - Failure
3207 //-------------------------------------------------------------------------------------------------
3208 DMX_FILTER_STATUS MApi_DMX_MMFI_Filein_Info(DMX_MMFI_PATH ePath, DMX_Filein_info *pFileinInfo);
3209 
3210 //-------------------------------------------------------------------------------------------------
3211 /// Disable 192 mode blovk scheme to bypass fill-in timestamp
3212 /// @ingroup TSP_MM
3213 /// @param  ePath       \b IN: MM File-in Path
3214 /// @param bbypass      \b IN: If true, bypass file-in timestamp.
3215 /// @return None
3216 //-------------------------------------------------------------------------------------------------
3217 void             MApi_DMX_MMFI_Filein_BypassTimeStamp(DMX_MMFI_PATH ePath, MS_BOOL bbypass);
3218 //-------------------------------------------------------------------------------------------------
3219 /// Free the PID of MM Filein.
3220 /// @ingroup TSP_MM
3221 /// @param  ePath                \b IN: MM File-in Path
3222 /// @param pu32FileInTS          \b OUT: pointer for timestamp value
3223 /// @return DMX_FILTER_STATUS_OK - Success
3224 /// @return DMX_FILTER_STATUS_ERROR - Failure
3225 //-------------------------------------------------------------------------------------------------
3226 DMX_FILTER_STATUS MApi_DMX_MMFI_GetFileInTimeStamp(DMX_MMFI_PATH ePath, MS_U32 *pu32FileInTS);
3227 
3228 //MMFI  (MMFI Only) API
3229 //-------------------------------------------------------------------------------------------------
3230 /// Set the PID to be MM File-in
3231 /// @ingroup TSP_MM
3232 /// @param flttype         \b IN: MMFI filter type
3233 /// @param u16Pid          \b IN: The target PID for MM Filein
3234 /// @param pu8DmxId        \b OUT: The demux filter Id for this MMFilein PID
3235 /// @return DMX_FILTER_STATUS_OK - Success
3236 /// @return DMX_FILTER_STATUS_ERROR - Failure
3237 //-------------------------------------------------------------------------------------------------
3238 DMX_FILTER_STATUS MApi_DMX_MMFI_Pid_Open(DMX_MMFI_FLTTYPE flttype, MS_U16 u16Pid, MS_U8* pu8DmxId);
3239 
3240 //-------------------------------------------------------------------------------------------------
3241 /// Free the PID of MM Filein.
3242 /// @ingroup TSP_MM
3243 /// @param u8DmxId      \b IN: The demux filter Id from MApi_DMX_Pvr_Pid_Open
3244 /// @return DMX_FILTER_STATUS_OK - Success
3245 /// @return DMX_FILTER_STATUS_ERROR - Failure
3246 //-------------------------------------------------------------------------------------------------
3247 DMX_FILTER_STATUS MApi_DMX_MMFI_Pid_Close(MS_U8 u8DmxId);
3248 
3249 //-------------------------------------------------------------------------------------------------
3250 /// Get MMFilein Command queue fifo level.
3251 /// @ingroup TSP_MM
3252 /// @param  ePath                   \b IN: MM File-in Path
3253 /// @param  pu8CmdQStatus           \b OUT: fifo level, 0~3
3254 /// - 0: 0 to 25% full
3255 /// - 1: 25 to 50% full
3256 /// - 2: 50 to 75% full
3257 /// - 3: 75 to 100% full
3258 /// @return DMX_FILTER_STATUS_OK - Success
3259 /// @return DMX_FILTER_STATUS_ERROR - Failure
3260 //-------------------------------------------------------------------------------------------------
3261 DMX_FILTER_STATUS MApi_DMX_MMFI_Filein_CMDQ_FIFOWriteLevel(DMX_MMFI_PATH ePath, MS_U8 *pu8CmdQStatus);
3262 
3263 //-------------------------------------------------------------------------------------------------
3264 /// Set MMFI playback timestamp.
3265 /// @ingroup TSP_MM
3266 /// @param  ePath          \b IN: MM File-in Path
3267 /// @param u32pcr2         \b IN: LPCR2 value
3268 /// @return DMX_FILTER_STATUS_OK - Success
3269 /// @return DMX_FILTER_STATUS_ERROR - Failure
3270 //-------------------------------------------------------------------------------------------------
3271 DMX_FILTER_STATUS MApi_DMX_MMFI_SetPlaybackTimeStamp(DMX_MMFI_PATH ePath, MS_U32 u32pcr2);
3272 
3273 //-------------------------------------------------------------------------------------------------
3274 /// Get MMFI Playback timestamp.
3275 /// @ingroup TSP_MM
3276 /// @param ePath               \b IN: MM File-in Path
3277 /// @param pu32pcr2            \b OUT: pointer to store LCPR2 value
3278 /// @return DMX_FILTER_STATUS_OK - Success
3279 /// @return DMX_FILTER_STATUS_ERROR - Failure
3280 //-------------------------------------------------------------------------------------------------
3281 DMX_FILTER_STATUS MApi_DMX_MMFI_GetPlaybackTimeStamp(DMX_MMFI_PATH ePath, MS_U32 *pu32pcr2);
3282 
3283 //-------------------------------------------------------------------------------------------------
3284 /// Enable remove duplicate A/V packets.
3285 /// @ingroup TSP_MM
3286 /// @param  bEnable           \b IN: Enable or Disable
3287 /// @return DMX_FILTER_STATUS_OK - Success
3288 /// @return DMX_FILTER_STATUS_ERROR - Failure
3289 //-------------------------------------------------------------------------------------------------
3290 DMX_FILTER_STATUS MApi_DMX_MMFI_RemoveDupAVPkt(MS_BOOL bEnable);
3291 //-------------------------------------------------------------------------------------------------
3292 /// Enable MMFI timestamp mode.
3293 /// @ingroup DMX_ToBeModified_MM
3294 /// @param ePath               \b IN: MM File-in Path
3295 /// @return DMX_FILTER_STATUS_OK - Success
3296 /// @return DMX_FILTER_STATUS_ERROR - Failure
3297 /// @note:  Merge with MApi_DMX_MMFI_TimeStampDisable
3298 //-------------------------------------------------------------------------------------------------
3299 DMX_FILTER_STATUS MApi_DMX_MMFI_TimeStampEnable(DMX_MMFI_PATH ePath);
3300 //-------------------------------------------------------------------------------------------------
3301 /// Disable MMFI timestamp mode.
3302 /// @ingroup DMX_ToBeModified_MM
3303 /// @param ePath               \b IN: MM File-in Path
3304 /// @return DMX_FILTER_STATUS_OK - Success
3305 /// @return DMX_FILTER_STATUS_ERROR - Failure
3306 /// @note:  Merge with MApi_DMX_MMFI_TimeStampEnable
3307 //-------------------------------------------------------------------------------------------------
3308 DMX_FILTER_STATUS MApi_DMX_MMFI_TimeStampDisable(DMX_MMFI_PATH ePath);
3309 //-------------------------------------------------------------------------------------------------
3310 /// Enable/Disable MMFI MOBF function and set MOBF key index.
3311 /// @ingroup TSP_MM
3312 /// @param ePath              \b IN: MM File-in Path
3313 /// @param  bEnable           \b IN: Enable or Disable
3314 /// @param  u32key            \b IN: MOBF key index
3315 /// @return DMX_FILTER_STATUS_OK - Success
3316 /// @return DMX_FILTER_STATUS_ERROR - Failure
3317 //-------------------------------------------------------------------------------------------------
3318 DMX_FILTER_STATUS MApi_DMX_MMFI_MOBF_Enable(DMX_MMFI_PATH ePath, MS_BOOL bEnable, MS_U32 u32key);
3319 
3320 //-------------------------------------------------------------------------------------------------
3321 /// Set MMFI MOBF level.
3322 /// @ingroup TSP_MM
3323 /// @param epath              \b IN: MM File-in Path
3324 /// @param  u8level           \b IN: the value of MOBF level
3325 /// @return DMX_FILTER_STATUS_OK - Success
3326 /// @return DMX_FILTER_STATUS_ERROR - Failure
3327 /// @note only used on TSP 1.0
3328 //-------------------------------------------------------------------------------------------------
3329 DMX_FILTER_STATUS MApi_DMX_MMFI_MOBF_SetLevel(DMX_MMFI_PATH epath, MS_U8 u8level);
3330 //-------------------------------------------------------------------------------------------------
3331 /// Set MMFI TimeStamp Clk.
3332 /// @ingroup TSP_MM
3333 /// @param ePath              \b IN: MM File-in Path
3334 /// @param eClk               \b IN: select 90K or 27M
3335 /// @return DMX_FILTER_STATUS_OK - Success
3336 /// @return DMX_FILTER_STATUS_ERROR - Failure
3337 /// @note only used on TSP 1.0
3338 //-------------------------------------------------------------------------------------------------
3339 DMX_FILTER_STATUS MApi_DMX_MMFI_TimeStampClk(DMX_MMFI_PATH ePath, DMX_TimeStamp_Clk eClk);
3340 
3341 //-------------------------------------------------------------
3342 
3343 
3344 //-----------------
3345 // TSO_General
3346 //-----------------
3347 //-------------------------------------------------------------------------------------------------
3348 /// Set up parameters for input bit stream from memory of TSO path.
3349 /// @ingroup TSO_General
3350 /// @param u8Eng          \b IN: TSO engine ID
3351 /// @param pFileinInfo    \b IN: the file in parameters
3352 /// @return DMX_FILTER_STATUS_OK - Success
3353 /// @return DMX_FILTER_STATUS_ERROR - Failure
3354 //-------------------------------------------------------------------------------------------------
3355 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Filein_Info(MS_U8 u8Eng, DMX_Filein_info *pFileinInfo);
3356 
3357 //-------------------------------------------------------------------------------------------------
3358 /// Check if no memory transfer is under going of TSO path
3359 /// @ingroup TSO_General
3360 /// @param u8Eng       \b IN: TSO engine ID
3361 /// @return TRUE - if idle
3362 /// @return FALSE - otherwise
3363 //-------------------------------------------------------------------------------------------------
3364 MS_BOOL SYMBOL_WEAK MApi_DMX_TSO_Filein_IsIdle(MS_U8 u8Eng);
3365 
3366 //-------------------------------------------------------------------------------------------------
3367 /// Get TSO file-in CMDQ empty number.
3368 /// @ingroup TSO_General
3369 /// @param u8Eng             \b IN: TSO engine ID
3370 /// @param pu32EmptySlot     \b OUT: pointer to store CMDQ empty slot number
3371 /// @return DMX_FILTER_STATUS_OK - Success
3372 /// @return DMX_FILTER_STATUS_ERROR - Failure
3373 //-------------------------------------------------------------------------------------------------
3374 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Filein_CMDQ_GetEmptyNum(MS_U8 u8Eng, MS_U32 *pu32EmptySlot);
3375 
3376 //-------------------------------------------------------------------------------------------------
3377 /// Get TSO file-in CMDQ reset.
3378 /// @ingroup TSO_General
3379 /// @param u8Eng           \b IN: TSO engine ID
3380 /// @return DMX_FILTER_STATUS_OK - Success
3381 /// @return DMX_FILTER_STATUS_ERROR - Failure
3382 //-------------------------------------------------------------------------------------------------
3383 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Filein_CMDQ_Reset(MS_U8 u8Eng);
3384 
3385 //-------------------------------------------------------------------------------------------------
3386 /// Start to get bit stream by memeory of TSO path.
3387 /// @ingroup TSO_General
3388 /// @param u8Eng             \b IN: TSO engine ID
3389 /// @param pBuf              \b IN: the memory containing the bit stream
3390 /// @param u32BufSize        \b IN: the size the memory to get
3391 /// @return DMX_FILTER_STATUS_OK - Success
3392 /// @return DMX_FILTER_STATUS_ERROR - Failure
3393 //-------------------------------------------------------------------------------------------------
3394 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Filein_Start(MS_U8 u8Eng, MS_PHY pBuf, MS_U32 u32BufSize);
3395 
3396 //-------------------------------------------------------------------------------------------------
3397 /// Stop to get bit stream by memeory of TSO path.
3398 /// @ingroup TSO_General
3399 /// @param u8Eng            \b IN: TSO engine ID
3400 /// @return DMX_FILTER_STATUS_OK - Success
3401 /// @return DMX_FILTER_STATUS_ERROR - Failure
3402 //-------------------------------------------------------------------------------------------------
3403 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Filein_Stop(MS_U8 u8Eng);
3404 
3405 //-------------------------------------------------------------------------------------------------
3406 /// Set TSO playback time stamp. (LPCR)
3407 /// @ingroup TSO_General
3408 /// @param u8Eng             \b IN: TSO engine ID
3409 /// @param u32Stamp          \b OUT: pointer to store timestamp value
3410 /// @return DMX_FILTER_STATUS_OK - Success
3411 /// @return DMX_FILTER_STATUS_ERROR - Failure
3412 //-------------------------------------------------------------------------------------------------
3413 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_SetPlaybackTimeStamp(MS_U8 u8Eng, MS_U32 u32Stamp);
3414 
3415 //-------------------------------------------------------------------------------------------------
3416 /// Get TSO file-in  time stamp. (LPCR)
3417 /// @ingroup TSO_General
3418 /// @param u8Eng              \b IN: TSO engine ID
3419 /// @param pu32Stamp          \b OUT: pointer to store timestamp value
3420 /// @return DMX_FILTER_STATUS_OK - Success
3421 /// @return DMX_FILTER_STATUS_ERROR - Failure
3422 //-------------------------------------------------------------------------------------------------
3423 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_GetPlaybackStamp(MS_U8 u8Eng, MS_U32* pu32Stamp);
3424 
3425 //-------------------------------------------------------------------------------------------------
3426 /// Get TSO file-in  time stamp.
3427 /// @ingroup TSO_General
3428 /// @param u8Eng              \b IN: TSO engine ID
3429 /// @param pu32Stamp          \b OUT: pointer to store timestamp value
3430 /// @return DMX_FILTER_STATUS_OK - Success
3431 /// @return DMX_FILTER_STATUS_ERROR - Failure
3432 //-------------------------------------------------------------------------------------------------
3433 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_GetFileInTimeStamp(MS_U8 u8Eng, MS_U32 *pu32Stamp);
3434 
3435 //-------------------------------------------------------------------------------------------------
3436 /// Disable 192 mode block scheme to bypass fill-in timestamp.
3437 /// @ingroup TSO_General
3438 /// @param u8Eng           \b IN: TSO engine id.
3439 /// @param bbypass         \b IN: If true, bypass file-in timestamp.
3440 /// @return DMX_FILTER_STATUS_OK - Success
3441 /// @return DMX_FILTER_STATUS_ERROR - Failure
3442 //-------------------------------------------------------------------------------------------------
3443 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_BypassFileInTimeStamp(MS_U8 u8Eng, MS_BOOL bbypass);
3444 //-------------------------------------------------------------------------------------------------
3445 /// Enable TSO file in  time stamp.
3446 /// @ingroup DMX_ToBeModified_MM_TSO
3447 /// @param u8Eng           \b IN: TSO engine id.
3448 /// @return DMX_FILTER_STATUS_OK - Success
3449 /// @return DMX_FILTER_STATUS_ERROR - Failure
3450 //-------------------------------------------------------------------------------------------------
3451 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_TimeStampEnable(MS_U8 u8Eng);
3452 
3453 //-------------------------------------------------------------------------------------------------
3454 /// Disable TSO file in time stamp
3455 /// @ingroup DMX_ToBeModified_MM_TSO
3456 /// @param u8Eng           \b IN: TSO engine id.
3457 /// @return DMX_FILTER_STATUS_OK - Success
3458 /// @return DMX_FILTER_STATUS_ERROR - Failure
3459 //-------------------------------------------------------------------------------------------------
3460 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_TimeStampDisable(MS_U8 u8Eng);
3461 //-------------------------------------------------------------------------------------------------
3462 /// Set TSO Out Clock.
3463 /// @ingroup TSO_General
3464 /// @param  u8Eng               \b IN: TSO engine ID
3465 /// @param  eTsOutClk           \b IN: TSO out clock select
3466 /// @param  eTsOutClkSrc        \b IN: TSO out clock source select
3467 /// @param  u16DivNum           \b IN: If select DMPLLDIV source, setting Divide number
3468 /// @param  bClkInv             \b IN: If Out Clock invert
3469 /// @return DMX_FILTER_STATUS_OK - Success
3470 /// @return DMX_FILTER_STATUS_ERROR - Failure
3471 /// @note If eTsOutClk is E_DMX_TSO_OUTCLK_DIV2N, eTsOutClkSrc could be E_DMX_TSO_OUTCLKSRC_172M_2N/E_DMX_TSO_OUTCLKSRC_288M_2N/E_DMX_TSO_OUTCLKSRC_432M_2N,
3472 /// @note and user should set u16DivNum to generate final output clock.
3473 /// @note If eTsOutClk is E_DMX_TSO_OUTCLK_DIVN, eTsOutClkSrc could be E_DMX_TSO_OUTCLKSRC_216M_N, and user should set u16DivNum to generate final output clock.
3474 /// @note If eTsOutClk is E_DMX_TSO_OUTCLK_PTSOOUT/E_DMX_TSO_OUTCLK_PTSOOUT_DIV8, eTsOutClkSrc could be E_DMX_TSO_OUTCLKSRC_P_TS0IN/E_DMX_TSO_OUTCLKSRC_P_TS1IN, etc,
3475 /// @note and this colck is from external pad
3476 /// @note E_DMX_TSO_OUTCLK_62M/E_DMX_TSO_OUTCLK_54M/E_DMX_TSO_OUTCLK_27M/E_DMX_TSO_OUTCLK_Dmd are const
3477 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_SetOutClk(MS_U8 u8Eng, DMX_TSO_OutClk eTsOutClk, DMX_TSO_OutClkSrc eTsOutClkSrc, MS_U16 u16DivNum, MS_BOOL bClkInv);
3478 
3479 //-------------------------------------------------------------------------------------------------
3480 /// Enable or disable TSO output.
3481 /// @ingroup TSO_General
3482 /// @param  u8Eng                 \b IN: TSO engine ID
3483 /// @param  bEnable               \b IN: TRUE is enable, FALSE is disable
3484 /// @return DMX_FILTER_STATUS_OK - Success
3485 /// @return DMX_FILTER_STATUS_ERROR - Failure
3486 //-------------------------------------------------------------------------------------------------
3487 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_OutputEnable(MS_U8 u8Eng, MS_BOOL bEnable);
3488 
3489 //TSO2 API
3490 //-------------------------------------------------------------------------------------------------
3491 /// Set or get local stream ID of TSO Out.
3492 /// @ingroup TSO_General
3493 /// @param  u8Eng              \b IN: TSO engine ID
3494 /// @param  eIf                \b IN: TSO input TSIF
3495 /// @param  pu8StrId           \b IN or OUT: pointer to store local stream ID, default value is 0x47
3496 /// @param  bSet               \b IN: If TRUE, set local stream id, otherwise get local stream id
3497 /// @return DMX_FILTER_STATUS_OK - Success
3498 /// @return DMX_FILTER_STATUS_ERROR - Failure
3499 //-------------------------------------------------------------------------------------------------
3500 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_LocalStreamId(MS_U8 u8Eng, DMX_TSIF eIf, MS_U8* pu8StrId, MS_BOOL bSet);
3501 
3502 //-------------------------------------------------------------------------------------------------
3503 /// Set TSO virtual queue buffer.
3504 /// @ingroup TSO_General
3505 /// @param  u8Eng           \b IN: TSO engine ID
3506 /// @param  phyAddr         \b IN: TSO VQ buffer address
3507 /// @param  u32BufSize    \b IN: TSO VQ buffer size
3508 /// @return DMX_FILTER_STATUS_OK - Success
3509 /// @return DMX_FILTER_STATUS_ERROR - Failure
3510 //-------------------------------------------------------------------------------------------------
3511 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_SVQBuf_Set(MS_U8 u8Eng, MS_PHY phyAddr, MS_U32 u32BufSize);
3512 
3513 //-------------------------------------------------------------------------------------------------
3514 ///TSO (TS output) Demux Flow input sources configure getting and setting.
3515 /// @ingroup TSO_General
3516 /// @param pstInputCfg                \b IN/OUT: Pointer of storing TSO input configure data
3517 /// @return DMX_FILTER_STATUS_OK - Success
3518 /// @return DMX_FILTER_STATUS_ERROR - Failure
3519 /// - The members in pstInputCfg structure
3520 ///     eFlow                         \b IN: DMX TSO playback flow,  DMX_FLOW_TSO_PLAYBACK/DMX_FLOW_TSO_PLAYBACK1
3521 ///     eTSOInIf                      \b IN: TSO input interface,  DMX_TSIF_LIVE0/DMX_TSIF_LIVE1/DMX_TSIF_LIVE2/DMX_TSIF_FILE0/DMX_TSIF_FILE1
3522 ///     stInputInfo.Input             \b IN/OUT: TSO input interface source,  enum item of DMX_FLOW_INPUT
3523 ///     stInputInfo.bClkInv           \b IN/OUT: If TSO input interface source is from demod, please set clock invert type
3524 ///     stInputInfo.bExtSync          \b IN/OUT: If TSO input interface source is from demod, please set external sync type
3525 ///     stInputInfo.bParallel         \b IN/OUT: If TSO input interface source is from demod, please set parallel or serial type
3526 ///     u8LocalStrId                  \b IN/OUT: The local stream ID (TS output sync byte) value, default is 0x47
3527 ///     bBypassAll                    \b IN/OUT: TRUE means bypass all ts data for TSO playback; FALSE means tso will output ts data by PIDs
3528 ///     bEnable                       \b IN/OUT: TRUE means enable TSO input now; FALSE means disable this TSO input fource
3529 
3530 /// @note This API is for TSO 2.0 HW architecture.
3531 /// @note Serval TSO input will be merge to be one TSO output. This API is for configuring one of TSO input.
3532 /// @note If there are 3 TSO input source, you shold call this API 3 times for every TSO input path configure.
3533 //-------------------------------------------------------------------------------------------------
3534 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Flow_InputCfg(DMX_TSO_InputCfg* pstInputCfg);
3535 
3536 //-------------------------------------------------------------------------------------------------
3537 /// TSO (TS output) Demux Flow output path configure
3538 /// @ingroup TSO_General
3539 /// @param pstOutputCfg              \b IN/OUT: Pointer of storing TSO output configure data
3540 /// @return DMX_FILTER_STATUS_OK - Success
3541 /// @return DMX_FILTER_STATUS_ERROR - Failure
3542 /// - The members in pstOutputCfg structure
3543 ///     eFlow                        \b IN: DMX TSO playback flow,  DMX_FLOW_TSO_PLAYBACK/DMX_FLOW_TSO_PLAYBACK1
3544 ///     eOutPad                      \b IN: TSO output pad  select,  DMX_FLOW_OUTPUT_EXT_PAD1/DMX_FLOW_OUTPUT_EXT_PAD3///
3545 ///     u16OutPktSize                \b IN/OUT: TSO output packet size. default vale is 188 bytes
3546 ///     bEnable                      \b IN/OUT: TRUE means enable TSO output now; FALSE means disable TSO output
3547 ///     bDefOutClk                   \b IN: TURE means using default clock setting given by driver; FALSE means set output clock by user parameters
3548 ///     bOutClkInv                   \b IN/OUT: Set inver type of TSO output clock
3549 ///     eTsoOutClk                   \b IN/OUT: Select TSO output clock, enum item of DMX_TSO_OutClk
3550 ///     eTsoOutClkSrc                \b IN/OUT: Select TSO output clock source, enum item of DMX_TSO_OutClkSrc
3551 ///     u16DivNum                    \b IN/OUT: If TSO output clock source is E_DMX_TSO_OUTCLK_DIV2N/E_DMX_TSO_OUTCLK_DIVN, set this value for clock generatng.
3552 ///     bSet                         \b IN: TURE: set, FALSE: get
3553 /// @note This API is for TSO 2.0 HW architecture.
3554 /// @note Serval TSO input will be merge to be one TSO output. This API is for configuring TSO output path.
3555 /// @note TSO output clock source selection, please also refer to MApi_DMX_TSO_SetOutClk API.
3556 //-------------------------------------------------------------------------------------------------
3557 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Flow_OutputCfg(DMX_TSO_OutputCfg* pstOutputCfg);
3558 
3559 //-------------------------------------------------------------------------------------------------
3560 ///TSO configuration
3561 /// @param pstTsoCfg                  \b IN/OUT: Pointer of storing TSO configure data
3562 ///
3563 /// @return DMX_FILTER_STATUS_OK - Success
3564 /// @return DMX_FILTER_STATUS_ERROR - Failure
3565 ///
3566 /// @note This API is for TSO2 HW architecture
3567 //-------------------------------------------------------------------------------------------------
3568 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Configure(DMX_TSO_Cfg* pstTsoCfg);
3569 
3570 //-------------------------------------------------------------------------------------------------
3571 /// TSO (TS output) input pid filter open.
3572 /// @ingroup TSO_General
3573 /// @param u8Eng              \b IN: TSO engine ID
3574 /// @param eTSOInSrc          \b IN: TSO PID filter source
3575 /// @param u16Pid             \b IN: PID value of TSO PID filter
3576 /// @param pu16DmxId          \b IN: Pointer to store PID filter ID
3577 /// @return DMX_FILTER_STATUS_OK - Success
3578 /// @return DMX_FILTER_STATUS_ERROR - Failure
3579 //-------------------------------------------------------------------------------------------------
3580 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Pid_Open(MS_U8 u8Eng, DMX_TSIF eTSOInSrc, MS_U16 u16Pid, MS_U16* pu16DmxId);
3581 
3582 //-------------------------------------------------------------------------------------------------
3583 /// TSO (TS output) input pid filter close.
3584 /// @ingroup TSO_General
3585 /// @param u8Eng             \b IN: TSO engine ID
3586 /// @param u16DmxId          \b IN: TSO PID filter source
3587 /// @return DMX_FILTER_STATUS_OK - Success
3588 /// @return DMX_FILTER_STATUS_ERROR - Failure
3589 //-------------------------------------------------------------------------------------------------
3590 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Pid_Close(MS_U8 u8Eng, MS_U16 u16DmxId);
3591 //-------------------------------------------------------------------------------------------------
3592 /// Get TSO file-in  read address.
3593 /// @ingroup TSO_General
3594 /// @param u8Eng             \b IN: TSO engine ID
3595 /// @param pphyRead          \b OUT: pointer to store read address
3596 /// @return DMX_FILTER_STATUS_OK - Success
3597 /// @return DMX_FILTER_STATUS_ERROR - Failure
3598 //-------------------------------------------------------------------------------------------------
3599 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_TSO_Filein_GetReadAddr(MS_U8 u8Eng, MS_PHY* pphyRead);
3600 //----------------------------------------------------------
3601 
3602 
3603 //--------------------------------------------------------------------------------------------------
3604 /// Get TSP firmware version.
3605 /// @ingroup TSP_General
3606 /// @param u32FWVer      \b OUT: TSP firmware version infomation
3607 /// @return DMX_FILTER_STATUS_OK - Success
3608 /// @return DMX_FILTER_STATUS_ERROR - Failure
3609 //--------------------------------------------------------------------------------------------------
3610 DMX_FILTER_STATUS MApi_TSP_Get_FW_VER(MS_U32* u32FWVer);
3611 //-------------------------------------------------------------------------------------------------
3612 /// Set TSP Debug Level.
3613 /// @ingroup TSP_General
3614 /// @param  level    \b IN: debug level.
3615 /// @return DMX_FILTER_STATUS_OK - Success
3616 /// @return DMX_FILTER_STATUS_ERROR - Failure
3617 //-------------------------------------------------------------------------------------------------
3618 DMX_FILTER_STATUS MApi_DMX_SetDbgLevel(DMX_DBGMSG_LEVEL level);
3619 
3620 //-----------------
3621 // TSP_Debug
3622 //-----------------
3623 //-------------------------------------------------------------------------------------------------
3624 /// Get interrupt count.
3625 /// @ingroup TSP_Debug
3626 /// @param pu32Count       \b OUT: interrupt count
3627 /// @return DMX_FILTER_STATUS_OK - Success
3628 /// @return DMX_FILTER_STATUS_ERROR - Failure
3629 //-------------------------------------------------------------------------------------------------
3630  DMX_FILTER_STATUS MApi_DMX_Get_Intr_Count(MS_U32* pu32Count);
3631 //--------------------------------------------------------------------------------------------------
3632 /// Get TSP driver library information
3633 /// @ingroup TSP_General
3634 /// @param ppVersion      \b OUT: TSP library version infomation
3635 /// @return DMX_FILTER_STATUS_OK - Success
3636 /// @return DMX_FILTER_STATUS_ERROR - Failure
3637 //--------------------------------------------------------------------------------------------------
3638 DMX_FILTER_STATUS MApi_DMX_GetLibVer(const MSIF_Version **ppVersion);
3639 
3640 //-------------------------------------------------------------------------------------------------
3641 /// Get the register value of HW debug port .
3642 /// @ingroup TSP_Debug
3643 /// @param u32DbgSel       \b IN: Set which HW debug info you want to get. (ex: 0x4F, check TSIF0 data info)
3644 /// @param u32DbgInfo      \b OUT: pointer to store the debug port value
3645 /// @return DMX_FILTER_STATUS_OK - Success
3646 /// @return DMX_FILTER_STATUS_ERROR - Failure
3647 //-------------------------------------------------------------------------------------------------
3648 DMX_FILTER_STATUS MApi_DMX_GetDbgPortInfo(MS_U32 u32DbgSel,MS_U32* u32DbgInfo);
3649 //-------------------------------------------------------------------------------------------------
3650 /// Set memory buffer information for TSP AEON to print debug message.
3651 /// @ingroup TSP_Debug
3652 /// @param phyAddr         \b IN: physical address of buffer
3653 /// @param u32Size         \b IN: size of buffer
3654 /// @param u32DbgWord      \b IN: control word to filter debug message
3655 /// @return DMX_FILTER_STATUS_OK - Success
3656 /// @return DMX_FILTER_STATUS_ERROR - Failure
3657 //-------------------------------------------------------------------------------------------------
3658 DMX_FILTER_STATUS MApi_DMX_SetFwDbgParam(MS_PHY phyAddr, MS_U32 u32Size, MS_U32 u32DbgWord);
3659 //-------------------------------------------------------------------------------------------------
3660 /// Get dis-continue count by ts source and specific FIFO.
3661 /// @ingroup TSP_Debug
3662 /// @param pDmxInfo          \b IN: set control parameter to get related tsif packet count.
3663 /// @param pu32Cnt           \b OUT: dis-continue packet count
3664 /// @return DMX_FILTER_STATUS_OK - Success
3665 /// @return DMX_FILTER_STATUS_ERROR - Failure
3666 //-------------------------------------------------------------------------------------------------
3667 DMX_FILTER_STATUS MApi_DMX_Get_DisContiCnt(DMX_DisContiCnt_info* pDmxInfo, MS_U32* pu32Cnt);
3668 //-------------------------------------------------------------------------------------------------
3669 /// Get drop packet count by ts source and specific FIFO.
3670 /// @ingroup TSP_Debug
3671 /// @param pDmxInfo          \b IN: set control parameter to get related source packet count.
3672 /// @param pu32Cnt           \b OUT: drop packet count
3673 /// @return DMX_FILTER_STATUS_OK - Success
3674 /// @return DMX_FILTER_STATUS_ERROR - Failure
3675 //-------------------------------------------------------------------------------------------------
3676 DMX_FILTER_STATUS MApi_DMX_Get_DropPktCnt(DMX_DropPktCnt_info* pDmxInfo, MS_U32* pu32Cnt);
3677 
3678 //-------------------------------------------------------------------------------------------------
3679 ///Get locked packet count by ts source and specific FIFO.
3680 /// @ingroup TSP_Debug
3681 /// @param pDmxInfo          \b IN: set control parameter to get related tsif packet count.
3682 /// @param pu32Cnt           \b OUT: Lock packet count
3683 /// @return DMX_FILTER_STATUS_OK - Success
3684 /// @return DMX_FILTER_STATUS_ERROR - Failure
3685 //-------------------------------------------------------------------------------------------------
3686 DMX_FILTER_STATUS MApi_DMX_Get_LockPktCnt(DMX_LockPktCnt_info* pDmxInfo, MS_U32* pu32Cnt);
3687 //-------------------------------------------------------------------------------------------------
3688 ///Get dis-continue count by ts source and specific FIFO.
3689 /// @ingroup TSP_Debug
3690 /// @param DmxInfo           \b IN: set control parameter to get related source packet count.
3691 /// @param pu32Cnt           \b OUT: AV packet count
3692 /// @return DMX_FILTER_STATUS_OK - Success
3693 /// @return DMX_FILTER_STATUS_ERROR - Failure
3694 //-------------------------------------------------------------------------------------------------
3695 DMX_FILTER_STATUS MApi_DMX_Get_AVPktCnt(DMX_AVPktCnt_info* DmxInfo, MS_U32* pu32Cnt);
3696 //-------------------------------------------------------------------------------------------------
3697 /// Get section TEI packet count by ts source.
3698 /// @ingroup TSP_Debug
3699 /// @param FltSrc               \b IN: TS source
3700 /// @param pu32PktCnt           \b OUT: TEI packet count
3701 /// @return DMX_FILTER_STATUS_OK - Success
3702 /// @return DMX_FILTER_STATUS_ERROR - Failure
3703 //-------------------------------------------------------------------------------------------------
3704 DMX_FILTER_STATUS MApi_DMX_Get_SecTEI_PktCount(DMX_FILTER_TYPE FltSrc, MS_U32* pu32PktCnt);
3705 //-------------------------------------------------------------------------------------------------
3706 /// Reset section TEI packet count by DMX filter index.
3707 /// @ingroup TSP_Debug
3708 /// @param FltSrc               \b IN: TS source
3709 /// @return DMX_FILTER_STATUS_OK - Success
3710 /// @return DMX_FILTER_STATUS_ERROR - Failure
3711 //-------------------------------------------------------------------------------------------------
3712 DMX_FILTER_STATUS MApi_DMX_Reset_SecTEI_PktCount(DMX_FILTER_TYPE FltSrc);
3713 //-------------------------------------------------------------------------------------------------
3714 /// Get section dis-continue packet count.
3715 /// @ingroup TSP_Debug
3716 /// @param u32DmxID         \b IN: DMX filter index
3717 /// @param pu32PktCnt       \b OUT: Dis-continue packet count
3718 /// @return DMX_FILTER_STATUS_OK - Success
3719 /// @return DMX_FILTER_STATUS_ERROR - Failure
3720 //-------------------------------------------------------------------------------------------------
3721 DMX_FILTER_STATUS MApi_DMX_Get_SecDisCont_PktCount(MS_U32 u32DmxID, MS_U32* pu32PktCnt);
3722 //-------------------------------------------------------------------------------------------------
3723 /// Reset section dis-continue packet count.
3724 /// @ingroup TSP_Debug
3725 /// @param u32DmxID      \b IN: DMX filter Id
3726 /// @return DMX_FILTER_STATUS_OK - Success
3727 /// @return DMX_FILTER_STATUS_ERROR - Failure
3728 //-------------------------------------------------------------------------------------------------
3729  DMX_FILTER_STATUS MApi_DMX_Reset_SecDisCont_PktCount(MS_U32 u32DmxID);
3730 //-----------------------------------------------------
3731 
3732 //-----------------
3733 // TSP_FIQ
3734 //-----------------
3735 //-------------------------------------------------------------------------------------------------
3736 /// Enable/Disable section filter rush pass.
3737 /// @ingroup TSP_FIQ
3738 /// @param u32DmxId      \b IN: DMX filter Id
3739 /// @param u8Enable      \b IN: TRUE: enable, FALSE: disable
3740 /// @return DMX_FILTER_STATUS_OK - Success
3741 /// @return DMX_FILTER_STATUS_ERROR - Failure
3742 /// @note Now only TSP 2.0 & TSP 4.0 support it.
3743 //-------------------------------------------------------------------------------------------------
3744 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_SetFltRushPass(MS_U32 u32DmxId, MS_U8 u8Enable);
3745 //-------------------------------------------------------------------------------------------------
3746 /// Initialize Demux API for FIQ Enable.
3747 /// @ingroup TSP_FIQ
3748 /// @param u32FQEng       \b IN: FQ engine id
3749 /// @param pFQInfo        \b IN: Init FQ Setting
3750 /// @return DMX_FILTER_STATUS_OK - Success
3751 /// @return DMX_FILTER_STATUS_ERROR - Failure
3752 /// @note if want to use FQ, please call this API after calling MApi_DMX_Init. (FQ does not support for all chip)
3753 //-------------------------------------------------------------------------------------------------
3754 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_Init(MS_U32 u32FQEng, DMX_FQ_Info* pFQInfo);
3755 //-------------------------------------------------------------------------------------------------
3756 /// Finalize Demux API for FIQ.
3757 /// @ingroup TSP_FIQ
3758 /// @param u32FQEng       \b IN: FQ engine id
3759 /// @return DMX_FILTER_STATUS_OK - Success
3760 /// @return DMX_FILTER_STATUS_ERROR - Failure
3761 //-------------------------------------------------------------------------------------------------
3762 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_Exit(MS_U32 u32FQEng);
3763 //-------------------------------------------------------------------------------------------------
3764 /// Enable FIQ rush function.
3765 /// @ingroup TSP_FIQ
3766 /// @param u32FQEng       \b IN: FQ engine id
3767 /// @return DMX_FILTER_STATUS_OK - Success
3768 /// @return DMX_FILTER_STATUS_ERROR - Failure
3769 //-------------------------------------------------------------------------------------------------
3770 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_RushEnable(MS_U32 u32FQEng);
3771 
3772 //-------------------------------------------------------------------------------------------------
3773 /// Select path to skip rush data.
3774 /// @ingroup TSP_FIQ
3775 /// @param u32FQEng       \b IN: FQ engine id
3776 /// @param eSkipPath      \b IN: Select path to skip rush data
3777 /// @return DMX_FILTER_STATUS_OK - Success
3778 /// @return DMX_FILTER_STATUS_ERROR - Failure
3779 //-------------------------------------------------------------------------------------------------
3780 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_SkipRushData(MS_U32 u32FQEng, DMX_FQ_SkipPath eSkipPath);
3781 //-----------------------------------------------------
3782 
3783 //-------------------------------------------------------------------------------------------------
3784 /// Configure FIQ
3785 /// @ingroup TSP_FIQ
3786 /// @param pstFqCfg                         \b IN/OUT: Pointer of storing configure data
3787 /// @return DMX_FILTER_STATUS_OK - Success
3788 /// @return DMX_FILTER_STATUS_ERROR - Failure
3789 /// @note
3790 /// E_DMX_FQ_CFG_SEL_SRCMUX --> Set eFqSrcSel to select FQ source of TS path
3791 //-------------------------------------------------------------------------------------------------
3792 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_Configure(DMX_FQ_Cfg* pstFqCfg);
3793 
3794 //-------------------------------------------------------------------------------------------------
3795 /// Set rush start address in the FIQ buffer.
3796 /// @ingroup TSP_FIQ
3797 /// @param u32FQEng        \b IN: FQ engine id
3798 /// @param phyRushAddr     \b IN: Rush start address in the FIQ buffer
3799 /// @return DMX_FILTER_STATUS_OK    - Success
3800 /// @return DMX_FILTER_STATUS_ERROR - Failure
3801 //-------------------------------------------------------------------------------------------------
3802 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_SetRushAddr(MS_U32 u32FQEng, MS_PHY phyRushAddr);
3803 
3804 //-------------------------------------------------------------------------------------------------
3805 /// Get FIQ File-in read pointer
3806 /// @ingroup TSP_FIQ
3807 /// @param u32FQEng        \b IN : FQ engine id
3808 /// @param pphyRead        \b OUT: The pointer to store the obtained FIQ File-in read pointer
3809 /// @return DMX_FILTER_STATUS_OK    - Success
3810 /// @return DMX_FILTER_STATUS_ERROR - Failure
3811 //-------------------------------------------------------------------------------------------------
3812 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_ReadGet(MS_U32 u32FQEng, MS_PHY* pphyRead);
3813 
3814 //-------------------------------------------------------------------------------------------------
3815 /// Get FIQ PVR write pointer
3816 /// @ingroup TSP_FIQ
3817 /// @param u32FQEng        \b IN : FQ engine id
3818 /// @param pphyWrite       \b OUT: The pointer to store the obtained FIQ PVR write pointer
3819 /// @return DMX_FILTER_STATUS_OK    - Success
3820 /// @return DMX_FILTER_STATUS_ERROR - Failure
3821 //-------------------------------------------------------------------------------------------------
3822 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_FQ_WriteGet(MS_U32 u32FQEng, MS_PHY* pphyWrite);
3823 
3824 //-----------------
3825 // TSP_Merge
3826 //-----------------
3827 //-------------------------------------------------------------------------------------------------
3828 /// Set or Get merge stream source id and sync byte
3829 /// @ingroup TSP_Merge
3830 /// @param eIf                    \b IN:  Eunm value of DMX TSIF selection
3831 /// @param u8StrId                \b IN:  Stream index
3832 /// @param pu8SyncByte            \b IN:  Pointer to sync bytearray of merege streams
3833 /// @param bSet                   \b IN:  TRUE to setting data or FALSE to getting table
3834 /// @return DMX_FILTER_STATUS_OK - Success
3835 /// @return DMX_FILTER_STATUS_ERROR - Failure
3836 /// @note: Currently, maxmum number is 8, and don't call this API when stream processing is started
3837 //-------------------------------------------------------------------------------------------------
3838  DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_MStr_SyncByte(DMX_TSIF eIf, MS_U8 u8StrId, MS_U8* pu8SyncByte, MS_BOOL bSet);
3839 //-----------------------------------------------------
3840 
3841 //-----------------
3842 // Policy Manager
3843 //-----------------
3844 //-------------------------------------------------------------------------------------------------
3845 /// Get pipe id
3846 /// @param eGroup                           \b IN: Pipe Group
3847 /// @param EngId                            \b IN: Engine id
3848 /// @param pu32PipeId                       \b OUT: Pointer to store pipe id
3849 /// @return DMX_FILTER_STATUS_OK - Success
3850 /// @return DMX_FILTER_STATUS_ERROR - Failure
3851 //-------------------------------------------------------------------------------------------------
3852 DMX_FILTER_STATUS SYMBOL_WEAK MApi_DMX_Get_PipeId(DMX_PIPEID_GROUP eGroup, DMX_GENERAL_ENGID EngId, MS_U32 *pu32PipeId);
3853 
3854 //---  Common Interface for TSP config and Api commands ------------//
3855 //-------------------------------------------------------------------------------------------------
3856 /// General function for set cmd or get infomation.
3857 /// @ingroup TSP_Debug
3858 /// @param u32Cmd          \b IN: DMX filter Id
3859 /// @param u32Config       \b IN: Config 0 (define by case)
3860 /// @param u32DataNum   \b IN: Config 0 (define by case)
3861 /// @param pData             \b OUT: Output data
3862 /// @return DMX_FILTER_STATUS_OK - Success
3863 /// @return DMX_FILTER_STATUS_ERROR - Failure
3864 //-------------------------------------------------------------------------------------------------
3865 DMX_FILTER_STATUS MApi_DMX_CMD_Run(MS_U32 u32Cmd, MS_U32 u32Config, MS_U32 u32DataNum, void *pData);
3866 
3867 //u32Cmd of MApi_DMX_CMD_Run(MS_U32 u32Cmd, MS_U32 u32Config, MS_U32 u32DataNum, void *pData);
3868 #define DMX_CMD_RUN_DISABLE_SEC_CC_CHECK                0x00000001 //[u32Config]: 1-> Disable cc check on fw; 0-> Enable cc check on fw; [u32DataNum,*pData] do not use
3869 #define DMX_CMD_SET_PESCPY_CONT_MODE                    0x00000010 //[u32Config]: 0-> Disable; 1 -> Enable
3870     #define DMX_CMD_PESCPY_CONT_MODE_DISABLE            0
3871     #define DMX_CMD_PESCPY_CONT_MODE_ENABLE             1
3872 #define DMX_CMD_ENABLE_INIT_REF_CNT                     0x00000100 //[u32Config]: 1-> Enable DMX init reference counter; 0-> Disable DMX init reference counter
3873 #define DMX_CMD_STC_ADJUST_UNIT                         0x00000020 //[u32Config]: data
3874 #define DMX_CMD_PVR_PES_MODE                            0x00000030  //u32Config: PVR EngineID, u32DataNum=1, *pData = 1 is enable, pData = 0 is disable
3875 
3876 #if 0
3877 DMX_FILTER_STATUS MApi_DMX_ResetFileinTimestamp(void)
3878 #endif
3879 
3880 
3881 #ifdef __cplusplus
3882 }
3883 #endif
3884 
3885 #endif // #ifndef __API_DMX_H__
3886