source: svn/newcon3bcm2_21bu/magnum/commonutils/xdm/bxdm_pp_priv.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 43.4 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2012, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bxdm_pp_priv.h $
11 * $brcm_Revision: Hydra_Software_Devel/41 $
12 * $brcm_Date: 3/22/12 8:42a $
13 *
14 * [File Description:]
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/commonutils/xdm/bxdm_pp_priv.h $
19 *
20 * Hydra_Software_Devel/41   3/22/12 8:42a btosi
21 * SW7425-2656: when paused during a flush, prevent the next picture from
22 * being displayed until unpaused
23 *
24 * Hydra_Software_Devel/40   3/16/12 11:56a btosi
25 * SW7425-2536: added support for displayInterruptStatus_isr
26 *
27 * Hydra_Software_Devel/39   2/21/12 4:37p btosi
28 * SW7425-2424: force the initialization of
29 * ePolarityWhenDeltaStcWasNonZero
30 *
31 * Hydra_Software_Devel/38   2/16/12 9:29a btosi
32 * SW7425-2255: bind the PTS offset to the picture when it is selected for
33 * display
34 *
35 * Hydra_Software_Devel/37   2/1/12 1:57p btosi
36 * SW7425-2270: add support for IgnoreNRTUnderflow
37 *
38 * Hydra_Software_Devel/36   1/17/12 10:42a btosi
39 * SW7405-4736: added support for frame rate type and playback rate
40 *
41 * Hydra_Software_Devel/35   1/16/12 3:21p nilesh
42 * SW7425-767: Simplificed bStallStc and bIgnorePicture logic
43 *
44 * Hydra_Software_Devel/34   1/12/12 12:57p btosi
45 * SW7425-1001: added support for BAVC_MFD_Picture.bLast
46 *
47 * Hydra_Software_Devel/33   1/10/12 4:37p nilesh
48 * SW7425-767: Merge to mainline
49 *
50 * Hydra_Software_Devel/SW7425-767/1   1/4/12 10:43a nilesh
51 * SW7425-767: Prevent field inversion when STC is stalled in NRT mode
52 *
53 * Hydra_Software_Devel/32   1/5/12 10:48a btosi
54 * SW7405-5549: re-apply the CDT when the monitor refesh rate changes
55 * while the system is paused
56 *
57 * Hydra_Software_Devel/31   10/3/11 2:19p btosi
58 * SW7425-1264:  support for a SW STC internal to XDM
59 *
60 * Hydra_Software_Devel/30   7/20/11 10:44a btosi
61 * SW7635-51: use the SW PCR offset bound to the picture
62 *
63 * Hydra_Software_Devel/29   7/20/11 9:28a btosi
64 * SW7635-51: snapshot the software PCR offset
65 *
66 * Hydra_Software_Devel/28   6/24/11 4:05p btosi
67 * SW7425-764: added support for eInterruptRefreshRate in the MFD
68 * structure
69 *
70 * Hydra_Software_Devel/27   6/21/11 9:45a btosi
71 * SW7425-104: merged bRepeatField changes to mainline
72 *
73 * Hydra_Software_Devel/SW7425-104/1   6/20/11 1:43p btosi
74 * SW7425-104: added support for the MFD bRepeatField flag
75 *
76 * Hydra_Software_Devel/26   6/7/11 4:59p nilesh
77 * SW7425-44: Add support for BAVC_MFD_Picture.bStallStc
78 *
79 * Hydra_Software_Devel/25   5/25/11 4:04p nilesh
80 * SW7425-44: Add support for BAVC_MFD_Picture.bIgnorePicture
81 *
82 * Hydra_Software_Devel/24   5/10/11 1:41p btosi
83 * SW7405-4736: added range checking and debug messages for the input
84 * parameters
85 *
86 * Hydra_Software_Devel/23   4/18/11 1:04p btosi
87 * SW7405-4736: save the average STC delta for use in the debug messages
88 *
89 * Hydra_Software_Devel/22   4/5/11 2:26p btosi
90 * SW7405-4736: removed BXDM_PP_ENABLE_YUV_GRAB_MODE, grab is implemented
91 * in bxvd_decoder.c
92 *
93 * Hydra_Software_Devel/21   12/21/10 4:26p delkert
94 * SW7405-5043: Split STC stored in local state into two parts: STC from
95 * decoder and STC after JTI adjustment.
96 * Changes for rate match detection
97 * Store STC jitter threshold
98 *
99 * Hydra_Software_Devel/20   11/17/10 9:37a btosi
100 * SW7422-72: added new BXVD and XDM 3D API's
101 *
102 * Hydra_Software_Devel/19   10/1/10 2:51p btosi
103 * SWDEPRECATED-1003: added support for bTreatAsSingleElement
104 *
105 * Hydra_Software_Devel/18   9/28/10 3:04p btosi
106 * SWBLURAY-22390: for BD, don't load parameters for the next clip until
107 * both the stop event has occurred and the marker has been seen.
108 *
109 * Hydra_Software_Devel/17   9/23/10 3:09p btosi
110 * SW7405-4736: add support for a XDM instance ID to help debug multi-
111 * channel issues
112 *
113 * Hydra_Software_Devel/16   9/22/10 3:11p btosi
114 * SW7405-4883: removed unused variable "bProgressiveScanout"
115 *
116 * Hydra_Software_Devel/15   9/15/10 12:06p btosi
117 * SWDEPRECATED-1003: added BXDM_PictureProvider_SetFrameRateOverride_isr
118 * and supporting logic
119 *
120 * Hydra_Software_Devel/14   9/14/10 11:56a btosi
121 * SWDEPRECATED-1003: added BXDM_PictureProvider_SetTrickMode_isr to
122 * primarily disable the FIC logic when receiving video with sparse
123 * pictures
124 *
125 * Hydra_Software_Devel/13   8/12/10 9:38a btosi
126 * SW7405-4736: modified QM debug messages
127 *
128 * Hydra_Software_Devel/12   8/5/10 8:29a delkert
129 * SW7405-4703: Add HorizontalOverscanMode to allow bypass of Overscan
130 * calculation.  Added appropriate Get/Set APIs
131 *
132 * Hydra_Software_Devel/11   8/4/10 1:03p btosi
133 * SWBLURAY-21565: to aid debug, increment the picture's uiPPBIndex when
134 * the picture is validated
135 *
136 * Hydra_Software_Devel/10   7/29/10 11:22a btosi
137 * SW7405-4560: added support for the SEI "new message" flag.
138 *
139 * Hydra_Software_Devel/9   7/20/10 2:57p btosi
140 * SWBLURAY-21565: only allow the last picture of a clip to generate one
141 * stop event
142 *
143 * Hydra_Software_Devel/8   7/12/10 8:05a delkert
144 * SW7335-781: Output warning when forcing picture selection override to
145 * allow easier detection of conditions such as drop@decode and pcr
146 * discontinuity
147 *
148 * Hydra_Software_Devel/7   6/8/10 3:14p btosi
149 * SW7405-4378: fixed reporting of source size by the PictureParameter
150 * callback when the first picture(s) is dropped
151 *
152 * Hydra_Software_Devel/6   5/11/10 1:33p btosi
153 * SW7405-4117: added usage note
154 *
155 * Hydra_Software_Devel/5   5/10/10 3:05p btosi
156 * SW7550-379: fixed issue with the change for SW7405-3774
157 *
158 * Hydra_Software_Devel/4   4/29/10 10:47a btosi
159 * SW7405-4117: added support for ...DisplayFieldMode_eAuto
160 *
161 * Hydra_Software_Devel/3   3/18/10 10:54a btosi
162 * SW7405-3774: added bExecutedPtsStcOffsetCB flag.
163 *
164 * Hydra_Software_Devel/2   2/19/10 11:09a nilesh
165 * SW7405-2993: Made the DIH handle a property of the picture provider so
166 * that the PDR callback can persist over a stop/start decode
167 *
168 * Hydra_Software_Devel/1   2/16/10 10:51a nilesh
169 * SW7405-2993: Initial XDM version
170 *
171 ***************************************************************************/
172
173#ifndef BXDM_PP_PRIV_H_
174#define BXDM_PP_PRIV_H_
175
176#include "bxdm_pp_fp.h"
177#include "bxdm_pp_jrc.h"
178#include "bxdm_pp_avg.h"
179#include "bxdm_pp_timer.h"
180
181#ifndef BXVD_DBG_MSG
182#define BXVD_DBG_MSG(a,b) BSTD_UNUSED(a); BDBG_MSG(b)
183#endif
184
185#ifndef BXVD_DBG_WRN
186#define BXVD_DBG_WRN(a,b) BSTD_UNUSED(a); BDBG_WRN(b)
187#endif
188
189#ifndef BXVD_DBG_ERR
190#define BXVD_DBG_ERR(a,b) BSTD_UNUSED(a); BDBG_ERR(b)
191#endif
192
193/* Default TSM Thresholds for STB */
194#define BXDM_PictureProvider_P_DISCARD_THRESHOLD_MPEG (750*60*2)  /* 60 fields, 2 seconds */
195#define BXDM_PictureProvider_P_DISCARD_THRESHOLD_AVC  (750*60*10) /* 60 fields, 10 seconds */
196#define BXDM_PictureProvider_P_DISCARD_THRESHOLD_VC1  (750*60*10) /* 60 fields, 10 seconds */
197#define BXDM_PictureProvider_P_VERYLATE_THRESHOLD     (750*30)    /* 30 fields, 1/2 second */
198
199/* Maximum possible number of picture elements per PPB. */
200#define BXDM_PictureProvider_P_MAX_ELEMENTS_PER_PPB    4
201#define BXDM_PictureProvider_P_MAX_PPB_PULLDOWN_HISTORY 4
202
203/* In support of defining playback rate as a percentage instead of a factor.
204 * Previously "1" was normal, "2' as half speed ....
205 * Values less than BXDM_PP_P_NORMAL_PLAYBACK_RATE are slow motion, greater
206 * than BXDM_PP_P_NORMAL_PLAYBACK_RATE are fast play.
207 */
208#define BXDM_PICTUREPROVIDER_NORMAL_PLAYBACK_RATE_PERCENTAGE     100
209#define BXDM_PICTUREPROVIDER_NORMAL_PLAYBACK_RATE_EXTRA_DECIMALS 10
210
211#define BXDM_PICTUREPROVIDER_NORMAL_PLAYBACK_RATE ( BXDM_PICTUREPROVIDER_NORMAL_PLAYBACK_RATE_PERCENTAGE * BXDM_PICTUREPROVIDER_NORMAL_PLAYBACK_RATE_EXTRA_DECIMALS )
212
213typedef enum BXDM_PictureProvider_P_PictureType
214{
215      BXDM_PictureProvider_P_PictureType_eProgressive,
216      BXDM_PictureProvider_P_PictureType_eInterlaced,
217
218      BXDM_PictureProvider_P_PictureType_eMax
219} BXDM_PictureProvider_P_PictureType;
220
221typedef enum BXDM_PictureProvider_P_ScanMode
222{
223   BXDM_PictureProvider_P_ScanMode_eInterlaced = 0,
224   BXDM_PictureProvider_P_ScanMode_eProgressive,
225
226   BXDM_PictureProvider_P_ScanMode_eMax
227} BXDM_PictureProvider_P_ScanMode;
228
229typedef enum BXDM_PictureProvider_P_RepeatMode
230{
231   BXDM_PictureProvider_P_RepeatMode_eField = 0,
232   BXDM_PictureProvider_P_RepeatMode_eFrame,
233
234   BXDM_PictureProvider_P_RepeatMode_eMax
235} BXDM_PictureProvider_P_RepeatMode;
236
237typedef enum BXDM_PictureProvider_P_ClockRate
238{
239   BXDM_PictureProvider_P_ClockRate_eMPEG2,
240   BXDM_PictureProvider_P_ClockRate_eDirecTV,
241
242   /* Add new values ABOVE this line */
243   BXDM_PictureProvider_P_ClockRate_eMax
244} BXDM_PictureProvider_P_ClockRate;
245
246typedef enum BXDM_PictureProvider_P_PTSIndex
247{
248   BXDM_PictureProvider_P_PTSIndex_eActual,
249   BXDM_PictureProvider_P_PTSIndex_eVirtual,
250
251   /* Add new enums ABOVE this line */
252   BXDM_PictureProvider_P_PTSIndex_eMax
253} BXDM_PictureProvider_P_PTSIndex;
254
255#define BXDM_PictureProvider_P_STC_JITTER_THRESHOLD 10
256
257typedef enum BXDM_PictureProvider_P_STCTrickMode
258{
259   BXDM_PictureProvider_P_STCTrickMode_eOff = 0,
260   BXDM_PictureProvider_P_STCTrickMode_eFastForward,
261   BXDM_PictureProvider_P_STCTrickMode_eSlowMotion,
262   BXDM_PictureProvider_P_STCTrickMode_ePause,
263   BXDM_PictureProvider_P_STCTrickMode_eFastRewind,   /* SW7425-1264: two rewind modes can occur when */
264   BXDM_PictureProvider_P_STCTrickMode_eSlowRewind,   /* the SW STC is enabled and run in reverse     */
265
266   /* Add new values ABOVE this line */
267   BXDM_PictureProvider_P_STCTrickMode_eMax
268} BXDM_PictureProvider_P_STCTrickMode;
269
270typedef struct BXDM_PictureProvider_P_ClipCallbackInfo
271{
272   bool bTriggered;
273   BXDM_PictureProvider_Callback_ClipEventInfo stClipEventInfo;
274} BXDM_PictureProvider_P_ClipCallbackInfo;
275
276typedef struct BXDM_PictureProvider_P_CallbackInfo
277{
278   BXDM_PictureProvider_P_ClipCallbackInfo stClipStart;
279   BXDM_PictureProvider_P_ClipCallbackInfo stClipStop;
280   BXDM_PictureProvider_P_ClipCallbackInfo stPictureMarker;
281} BXDM_PictureProvider_P_CallbackInfo;
282
283/* SW7405-3137: to support MVC and other protocols delivering sets of pictures.  */
284typedef enum BXDM_PictureProvider_P_InterruptType
285{
286      BXDM_PictureProvider_P_InterruptType_eSingle,     /* VDC is expecting a single picture on this vsync */
287      BXDM_PictureProvider_P_InterruptType_eBase,       /* VDC is expecting the base picture of a set on this vsync */
288      BXDM_PictureProvider_P_InterruptType_eDependent,  /* VDC is expecting a dependent picture of a set on this vsync */
289      BXDM_PictureProvider_P_InterruptType_eMax
290} BXDM_PictureProvider_P_InterruptType;
291
292typedef struct BXDM_PictureProvider_P_LocalState
293{
294      /* Updated on every vsync */
295      BAVC_Polarity eVsyncPolarity; /* the vsync/interrupt polarity */
296      BXDM_PictureProvider_P_InterruptType eInterruptType;
297      BXDM_PictureProvider_P_ClockRate eClockRate;
298
299      uint32_t uiSlowMotionRate; /* 0 = pause, 1 = normal, >1 = slow motion rate */
300
301      /*
302      ** The "local" callback flags.  These will be set to "true" when the
303      ** callback criteria has been met.
304      */
305
306      bool bFirstPPBReceived; /* formerly the "bFirstPTSReady" flag */
307      bool bCodedPtsReceived; /* formerly the "bFirstCodedPTS" flag */
308
309      bool bTSMPass;
310      bool bPtsError;
311      bool bPtsStcOffset;
312      bool bIFrameReceived;
313      bool bPictureParameters;
314      bool bASTMModeTSMPass;
315      bool bPPBReceived;
316      bool bPictureUnderEvaluation;
317      bool bDecodeError;
318
319      BXDM_PictureProvider_DisplayMode eDisplayMode;
320      BXDM_PictureProvider_DisplayMode eSelectionMode;
321
322      bool bForcePtsError;
323
324      uint32_t uiStcSnapshot;    /* The STC Snapshot */
325      uint32_t uiAdjustedStc;    /* STC after jitter correction (does not include PCR Offset) */
326
327      /* PR47521: Keep track of actual new PPBs that were evaluated on
328       * this vsync */
329      uint32_t uiPicturesEvaluated;
330
331      bool bPictureQueueIsEmpty;
332
333      /*  PR47453: A running calculation of the lowest ABS of the
334       *  StcPtsDifferenceEvaluated of the element displayed in the
335       *  previous vsync and the element(s) that have been evaluated
336       *  so far on this vsync.  Typically, to prevent STC/PTS jitter,
337       *  the element that results in the lowest delta in the
338       *  PtsStcDifferenceEvaluated is selected */
339      int32_t iStcPtsDifferenceEvaluatedDeltaAbsMin[BXDM_PictureProvider_P_PTSIndex_eMax];
340      int32_t iStcPtsDifferenceEvaluatedBest[BXDM_PictureProvider_P_PTSIndex_eMax];
341
342      /* PR48593: True if the Field Inversion Correction offset has
343       * changed this vsync */
344      bool bFICChanged;
345
346   uint32_t uiCallbackTriggered;
347
348   BXDM_PPFP_P_DataType stSTCDelta;
349   BXDM_PPFP_P_DataType stDeltaSTCAvg;    /* The average STC is calculated for use in the Jitter Tolerance Improvement  */
350   uint32_t             uiNumSTCSamples;  /* logic. Save the values in this structure for use in the debug messages.    */
351
352   BXDM_PictureProvider_P_STCTrickMode eSTCTrickMode;
353   uint32_t uiSTCJitterThreshold;
354
355   BXDM_PictureProvider_P_CallbackInfo stCallbackInfo;
356
357   BXDM_PPFP_P_DataType stEffectiveSTCDelta[BXDM_PictureProvider_DisplayMode_eMax];
358
359   /* SW7405-3085: Channel Synchronization */
360   uint32_t uiDisplayInterruptCount; /* A monotonically increasing count of the number of display interrupts that have occurred so far */
361   bool bDisplayInterruptCountValid; /* Should be set to true when the app updates the display interrupt count. DM auto-invalidates this field at the end of each vsync */
362} BXDM_PictureProvider_P_LocalState;
363
364#define BXDM_PictureProvider_P_MAX_EARLY_BEFORE_DROP 3
365#define BXDM_PictureProvider_P_MAX_LATE_BEFORE_DECODER_DROP 3
366
367/* SW7405-4736: Dirty bit definitions for the BXDM_PictureProvider_P_Config struture.
368 * The bit will be set when a parameter is changed.  These were added to trigger
369 * debug messages, perhaps we'll find other uses.
370 */
371#define BXDM_PictureProvider_P_DIRTY_NONE          0x00000000
372#define BXDM_PictureProvider_P_DIRTY_ALL           0xFFFFFFFF
373
374#define BXDM_PictureProvider_P_DIRTY_1_STC_VALID                  0x00000001
375#define BXDM_PictureProvider_P_DIRTY_1_PTS_OFFSET                 0x00000002
376#define BXDM_PictureProvider_P_DIRTY_1_DISPLAY_FIELD_MODE         0x00000004
377#define BXDM_PictureProvider_P_DIRTY_1_MONITOR_REFRESH_RATE       0x00000008
378#define BXDM_PictureProvider_P_DIRTY_1_3D_SETTINGS                0x00000010
379#define BXDM_PictureProvider_P_DIRTY_1_SRC_FORMAT_OVERRIDE        0x00000020
380#define BXDM_PictureProvider_P_DIRTY_1_SCAN_MODE_OVERRIDE         0x00000040
381#define BXDM_PictureProvider_P_DIRTY_1_1080P_SCAN_MODE            0x00000080
382#define BXDM_PictureProvider_P_DIRTY_1_240I_SCAN_MODE             0x00000100
383#define BXDM_PictureProvider_P_DIRTY_1_480P_PULLDOWN_MODE         0x00000200
384#define BXDM_PictureProvider_P_DIRTY_1_1080P_PULLDOWN_MODE        0x00000400
385#define BXDM_PictureProvider_P_DIRTY_1_PICTURE_DROP_MODE          0x00000800
386#define BXDM_PictureProvider_P_DIRTY_1_FREEZE                     0x00001000
387#define BXDM_PictureProvider_P_DIRTY_1_FRAME_ADVANCE_MODE         0x00002000
388#define BXDM_PictureProvider_P_DIRTY_1_REVERSE_FIELDS             0x00004000
389#define BXDM_PictureProvider_P_DIRTY_1_AUTO_VALIDATE_ON_PAUSE     0x00008000
390#define BXDM_PictureProvider_P_DIRTY_1_PLAYBACK_RATE              0x00010000
391#define BXDM_PictureProvider_P_DIRTY_1_SOFTWARE_PCR_OFFSET        0x00020000
392#define BXDM_PictureProvider_P_DIRTY_1_USE_HW_PCR_OFFSET          0x00040000
393#define BXDM_PictureProvider_P_DIRTY_1_JITTER_TOLERANCE           0x00080000
394#define BXDM_PictureProvider_P_DIRTY_1_PLAYBACK                   0x00100000
395#define BXDM_PictureProvider_P_DIRTY_1_FRAME_RATE_DETECTION_MODE  0x00200000
396#define BXDM_PictureProvider_P_DIRTY_1_DEFAULT_FRAME_RATE         0x00400000
397#define BXDM_PictureProvider_P_DIRTY_1_ATSM_MODE                  0x00800000
398#define BXDM_PictureProvider_P_DIRTY_1_VTSM_ON_PCR_DISCON         0x01000000
399#define BXDM_PictureProvider_P_DIRTY_1_ERROR_HANDLING_MODE        0x02000000
400#define BXDM_PictureProvider_P_DIRTY_1_PRE_ROLL_RATE              0x04000000
401#define BXDM_PictureProvider_P_DIRTY_1_PROTOCOL                   0x08000000
402#define BXDM_PictureProvider_P_DIRTY_1_MAX_DEINT_HEIGHT           0x10000000
403#define BXDM_PictureProvider_P_DIRTY_1_HORIZON_OVERSCAN_MODE      0x20000000
404#define BXDM_PictureProvider_P_DIRTY_1_TRICK_MODE                 0x40000000
405#define BXDM_PictureProvider_P_DIRTY_1_FRAMERATE_OVERRIDE         0x80000000
406
407#define BXDM_PictureProvider_P_DIRTY_2_DISPLAY_MODE               0x00000001
408#define BXDM_PictureProvider_P_DIRTY_2_TSM_THRESHOLD              0x00000002
409#define BXDM_PictureProvider_P_DIRTY_2_CLIP_TIMING                0x00000004
410#define BXDM_PictureProvider_P_DIRTY_2_PRESERVE_SETTINGS          0x00000008
411#define BXDM_PictureProvider_P_DIRTY_2_STC_INDEX                  0x00000010
412#define BXDM_PictureProvider_P_DIRTY_2_REMOVAL_DELAY              0x00000020
413#define BXDM_PictureProvider_P_DIRTY_2_CHANNEL_SYNC_MODE          0x00000040
414#define BXDM_PictureProvider_P_DIRTY_2_MUTE                       0x00000080
415#define BXDM_PictureProvider_P_DIRTY_2_CHANNEL_CHANGE_SETTINGS    0x00000100
416#define BXDM_PictureProvider_P_DIRTY_2_CLOCK_OVERRIDE             0x00000200
417#define BXDM_PictureProvider_P_DIRTY_2_IGNORE_NRT_UNDERFLOW       0x00000400
418
419typedef struct BXDM_PictureProvider_P_Config
420{
421   /* Decoder */
422   BXDM_Decoder_Interface stDecoderInterface;
423   void *pDecoderPrivateContext;
424
425   /* Display */
426   bool bMute;
427   BXDM_PictureProvider_DisplayFieldMode eDisplayFieldMode;
428   BXDM_PictureProvider_ChannelChangeSettings stChannelChangeSettings;
429   BXDM_PictureProvider_SourceFormatOverride eSourceFormatOverride; /* Formerly eSPIM */
430   BXDM_PictureProvider_ScanModeOverride eScanModeOverride; /* Formerly eMPIM */
431   bool bFreeze;
432
433   BXDM_PictureProvider_MonitorRefreshRate eMonitorRefreshRate;
434   BXDM_PictureProvider_1080pScanMode e1080pScanMode;
435   BXDM_PictureProvider_PictureDropMode ePictureDropMode;
436
437   BXDM_PictureProvider_PulldownMode e480pPulldownMode; /* Formerly eProgressiveOverrideMode */
438   BXDM_PictureProvider_PulldownMode e1080pPulldownMode; /* Formerly eProgressiveOverrideMode */
439   BXDM_PictureProvider_240iScanMode e240iScanMode;
440
441   /* Trick Mode */
442   BXDM_PictureProvider_FrameAdvanceMode eFrameAdvanceMode;
443   uint32_t uiFrameAdvanceByFieldCount; /* This shouldn't be here */
444   bool bReverseFields;
445   bool bAutoValidateStcOnPause;
446
447   BXDM_Picture_Rate stPlaybackRate;
448
449   BXDM_PictureProvider_PreserveStateSettings stPreserveStateSettings;
450
451   /* TSM */
452   BXDM_PictureProvider_DisplayMode eDisplayMode;
453   bool bSTCValid;
454   uint32_t uiPTSOffset;
455   BXDM_PictureProvider_TSMThresholdSettings stTSMThresholdSettings;
456   uint32_t uiSTCIndex;
457
458   BXDM_PictureProvider_ClipTimeSettings stClipTimeSettings;
459
460   uint32_t uiSoftwarePCROffset;
461   bool bUseHardwarePCROffset;
462
463   bool bJitterToleranceImprovement;
464   bool bPlayback;
465
466   BXDM_PictureProvider_FrameRateDetectionMode eFrameRateDetectionMode;
467   BAVC_FrameRateCode eDefaultFrameRate;
468
469   bool bAstmMode;
470   bool bVirtualTSMOnPCRDiscontinuity;
471
472   BXDM_PictureProvider_ErrorHandlingMode eErrorHandlingMode;
473
474   uint32_t uiRemovalDelay; /* Pictures on the queue are not
475                             * evaluated until the removal delay is
476                             * 0.  removal delay is decremented on
477                             * every vsync when the queue is not
478                             * empty */
479
480   BXDM_Picture_Rate stPreRollRate;
481
482   /* Stream Info */
483   BAVC_VideoCompressionStd eProtocol;
484
485   /* Debug */
486   bool bCRCMode;
487
488   /* SW7405-3085: Channel Synchronization */
489   bool bChannelSyncMode;
490
491   /* SW7405-4117: used in conjuction with BXDM_PictureProvider_DisplayFieldMode_eAuto to choose
492    * either eSingleField or eBothField based on the steam height during slow motion (and preroll).
493    */
494   uint32_t uiMaxHeightSupportedByDeinterlacer;
495
496   /* SW7405-4703: Allows bypass of BXDM_PPOUT_S_CalculateHorizontalOverscan in BXDM_PPOUT_S_SetAspectRatio */
497   BXDM_PictureProvider_HorizontalOverscanMode eHorizontalOverscanMode;
498
499   /* SWDEPRECATED-1003: used to disable the FIC logic. */
500   BXDM_PictureProvider_TrickMode eTrickMode;
501
502   /* SWDEPRECATED-1003: specifed by the middleware/application.  The frame rate
503    * will be forced to the value specified in stFrameRateOverride.stRate.
504    */
505   BXDM_Picture_FrameRateOverride stFrameRateOverride;
506
507   /* SW7405-4736: This is to help debug multi channel issues,
508    * i.e. PIP and mosaic mode.  Many of the BXVD_DBG_MSG statements will print this ID
509    * to help associate messages with a particular channel.  This can be set to any value,
510    * perhaps what makes the most sense is to set it equal to the VDC rectangle number.
511    */
512   uint32_t uiInstanceID;
513
514   /* SW7422-72: the middleware/application can use this to specify the orientation of a picture. */
515   BXDM_PictureProvider_3DSettings st3DSettings;
516
517   /* SW7425-1264: support for a synthesized STC; can create a clock that run backwards. */
518   BXDM_PictureProvider_ClockOverride stClockOverride;
519
520   /* SW7425-1264: load the SW STC on this vsync. */
521   bool bInitializeSwStc;
522
523   /* SW7425-2270: repeated picture should be encoded. */
524   bool bIgnoreNRTUnderflow;
525
526   /* SW7405-4736: for debug, flag changes to trigger debug messages. */
527   uint32_t uiDirtyBits_1;
528   uint32_t uiDirtyBits_2;
529   
530} BXDM_PictureProvider_P_Config;
531
532typedef struct BXDM_PictureProvider_P_Callback
533{
534   union {
535         BXDM_PictureProvider_Callback_StcPtsOffset_isr fStcPtsOffset;
536         BXDM_PictureProvider_Callback_FirstPTSReady_isr fFirstPTSReady;
537         BXDM_PictureProvider_Callback_FirstCodedPTSReady_isr fFirstCodedPTSReady;
538         BXDM_PictureProvider_Callback_FirstPTSPassed_isr fFirstPTSPassed;
539         BXDM_PictureProvider_Callback_PTSError_isr fPTSError;
540         BXDM_PictureProvider_Callback_IFrame_isr fIFrame;
541         BXDM_PictureProvider_Callback_PictureParameters_isr fPictureParameters;
542         BXDM_PictureProvider_Callback_TSMPassInASTMMode_isr fTSMPassInASTMMode;
543         BXDM_PictureProvider_Callback_ClipStart_isr fClipStart;
544         BXDM_PictureProvider_Callback_ClipStop_isr fClipStop;
545         BXDM_PictureProvider_Callback_PictureMarker_isr fPictureMarker;
546         BXDM_PictureProvider_Callback_RequestSTC_isr fRequestSTC;
547         BXDM_PictureProvider_Callback_PictureUnderEvaluation_isr fPictureUnderEvaluation;
548         BXDM_PictureProvider_Callback_TSMResult_isr fTSMResult;
549         BXDM_PictureProvider_Callback_PictureExtensionData_isr fPictureExtensionData;
550         BXDM_PictureProvider_Callback_DecodeError_isr fDecodeError;
551   } stFunction;
552
553   void *pPrivateContext;
554   int32_t iPrivateParam;
555
556   bool bEnable;
557} BXDM_PictureProvider_P_Callback;
558
559
560typedef struct BXDM_PictureProvider_P_Element_Params
561{
562      /* Each element has two sets of PTS values, the actual and
563       * virtual */
564      BXDM_PPFP_P_DataType stPTS[BXDM_PictureProvider_P_PTSIndex_eMax];
565
566      /* Each element has a single polarity associated with it based
567       * on the pulldown information */
568      BAVC_Polarity ePolarity;
569}  BXDM_PictureProvider_P_Element_Params;
570
571typedef struct BXDM_PictureProvider_P_PCROffset
572{
573      BXDM_Picture_PCROffset stPCROffsetCopy;
574      bool bValidOverloaded;           /* will be forced TRUE if the "bUseHwPcrOffset == false" */
575      bool bDiscontinuityOverloaded;   /* will be forced FALSE if the "bUseHwPcrOffset == false" */
576} BXDM_PictureProvider_P_PCROffset;
577
578/* Currently informational only, to help with debug.
579 */
580typedef enum BXDM_PictureProvider_P_FrameRateType
581{
582   BXDM_PictureProvider_P_FrameRateType_eCoded=0,     /* coded in the stream */
583   BXDM_PictureProvider_P_FrameRateType_eDefault,     /* as specified by BXDM_PictureProvider_SetDefaultFrameRate_isr   */
584   BXDM_PictureProvider_P_FrameRateType_eOverride,    /* as specified by BXDM_PictureProvider_SetFrameRateOverride_isr  */
585   BXDM_PictureProvider_P_FrameRateType_eCalculated,  /* calculated in the FRD code using the PTS values                */ 
586   BXDM_PictureProvider_P_FrameRateType_eForced,      /* using the values hardcoded in BXDM_PPTSM_P_PtsCalculateParameters */
587
588   BXDM_PictureProvider_P_FrameRateType_eMax
589} BXDM_PictureProvider_P_FrameRateType;
590
591
592
593typedef struct BXDM_PictureProvider_P_TSM_Static_Picture_Parms
594{
595   /* Element information */
596   uint32_t uiNumElements; /* The number of elements in this picture determined from pulldown information */
597   BXDM_PictureProvider_P_Element_Params astElmts[BXDM_PictureProvider_P_MAX_ELEMENTS_PER_PPB]; /* The parameters specific to each element */
598
599   BAVC_FrameRateCode eFrameRatePreFRD; /* source frame rate for this PPB before FRD */
600   BAVC_FrameRateCode eFrameRate;   /* source frame rate for this PPB w/ FRD (reported value) */
601   BAVC_FrameRateCode eFrameRateXVD;   /* source frame rate for this PPB that XVD uses internally for PTS interpolation */
602
603   BXDM_PictureProvider_P_FrameRateType eFrameRateType;  /* currently only to help with debug. */
604
605   BXDM_PictureProvider_P_PCROffset stPCROffsetXDM;
606   BXDM_PictureProvider_PTSType ePtsType;             /* is this PTS valid, coded, from the host or interpolated? */
607   BXDM_PPFP_P_DataType stPTSDelta;   /* The delta PTS between between each field of this picture */
608   uint32_t uiDroppedCount;           /* a copy of the dropped count from the last PPB that had a CODED PTS */
609   uint32_t uiVeryEarlyThreshold;      /* i.e. way too early */
610   uint32_t uiVeryLateThreshold;       /* i.e. way too late */
611   uint32_t uiPtsVsyncDiffThreshold;
612   /* best guess (by interpolation) of the PTS of the next PPB.  We
613   * have both actual and virtual interpolated values */
614   BXDM_PPFP_P_DataType stPTSOfNextPPB[BXDM_PictureProvider_P_PTSIndex_eMax];
615   int32_t iPTSJitterCorrection;
616
617   /* SW7405-5549: save a copy of the pulldown information. */
618   BXDM_Picture_PullDown ePullDownRangeChecked; 
619
620} BXDM_PictureProvider_P_TSM_Static_Picture_Parms;
621
622typedef struct BXDM_PictureProvider_P_TSM_Dynamic_Picture_Parms
623{
624   BXDM_PictureProvider_DisplayMode eSelectionMode; /* Determines is TSM or vTSM should be used for picture selection */
625
626   BXDM_PictureProvider_TSMResult eTsmResult;          /* The TSM Result */
627   uint32_t uiTSMSelectedElement;      /* The element that TSM has selected */
628   uint32_t uiEffectivePTS[BXDM_PictureProvider_P_PTSIndex_eMax]; /* The effective PTS of the picture (taking all offsets into account) */
629   int32_t iStcPtsDifferenceActual;    /* The actual STC/PTS difference reported to application */
630   int32_t iStcPtsDifferenceEvaluated; /* The STC/PTS difference used for TSM evaluation (including FIC offset) */
631   int32_t iStcPtsDifferenceDisplayed; /* The STC/PTS difference when last displayed (including FIC offset) */
632   int32_t iStcPtsDifferenceEvaluatedDeltaAbs; /* The delta of the STC/PTS evaluated differnece */
633
634   BXDM_PictureProvider_PictureHandlingMode ePictureHandlingMode;
635   bool bClipTransition;
636   bool bEvaluatedWithSwStc;  /* SW7425-1264: SW STC was used to evaluate this picture. */
637
638   /* SW7425-2536: added to support "drop at decode" for non-AVD decoders.
639    * The STC used to evalute the picture, includes the STC snapshot,
640    * jitter correction and PCR offsets when appropriate.
641    */
642   uint32_t uiEffectiveStc[BXDM_PictureProvider_P_PTSIndex_eMax];
643   
644} BXDM_PictureProvider_P_TSM_Dynamic_Picture_Parms;
645
646typedef struct BXDM_PictureProvider_P_TSM_Picture_Parms
647{
648   BXDM_PictureProvider_P_TSM_Static_Picture_Parms stStatic;
649   BXDM_PictureProvider_P_TSM_Dynamic_Picture_Parms stDynamic;
650} BXDM_PictureProvider_P_TSM_Picture_Parms;
651
652typedef struct BXDM_PictureProvider_P_Display_Static_Picture_Parms
653{
654   bool b32FilmSource;                /* true if a 3:2 interlaced source is detected (e.g. pulldown is 3:2 or framerate=24) */
655
656   BXDM_PictureProvider_P_ScanMode eScanMode;
657
658   /* SW7425-764: the monitor refresh rate, passed to VDC in the MFD structure.  */
659   BFMT_Vert eBFMTRefreshRate;
660
661   /* SW7405-5549: save a copy of the monitor refresh rate. */
662   BXDM_PictureProvider_MonitorRefreshRate eMonitorRefreshRate;
663
664
665} BXDM_PictureProvider_P_Display_Static_Picture_Parms;
666
667typedef struct BXDM_PictureProvider_P_Display_Dynamic_Picture_Parms
668{
669   uint32_t uiSelectedElement; /* The element that is ultimately selected after FIC */
670   BAVC_Polarity eSourcePolarity; /* The source polarity that is ultimately displayed */
671
672   bool bPPBRepeated;      /* True if any element within this PPB was displayed in the prior vsync  */
673   bool bPPBEncoded;       /* True if any element within this PPB was encoded in the prior vsync. Used to aid in differentiating FIC vs underflow stall. */
674   bool bElementRepeated;  /* True if the same element within this PPB was was displayed in the prior vsync */
675   BXDM_PPFP_P_DataType stDisplayDuration; /* # of clock ticks this picture has been displayed */
676   bool bHolding;   /* Indicates if the picture is being held during a channel change */
677
678   BXDM_PictureProvider_DisplayFieldMode eDisplayFieldMode; /* What fields should be displayed, Top only, Bottom only or both */
679   BXDM_PictureProvider_SourceFormatOverride eSourceFormatOverride; /* Formerly eSPIM */
680
681   bool bFICEnabled; /* True if FIC correction attempted for this picture */
682   bool bIgnoreCadenceMatch; /* PR49634: Indicates if VDC's cadence
683                              * matching should be enabled for the
684                              * sync-slipped (multi-buffer) path */
685
686   BXDM_PictureProvider_P_RepeatMode eRateConversionRepeatMode;
687   BXDM_PictureProvider_P_RepeatMode eTrickPlayRepeatMode;
688
689   /* SWBLURAY-21565: only allow the last picture of a clip to generate one stop event */
690   bool  bGeneratedClipStop;
691
692   /* SW7405-4560: only deliver the SEI messages and other extension data once
693    * per picture, i.e. don't deliver it again if the picture is repeated.
694    */
695   bool  bExtensionDataDelivered;
696
697   /* SW7425-104: Set the MFD bRepeatField flag based on how the picture was previously
698    * delivered to VDC.  If an element is being repeated, set the flag.  The following
699    * flags track which elements were delivered.
700    */
701   bool bTopFieldDelivered;
702   bool bBottomFieldDelivered;
703   bool bFrameDelivered;
704
705   /* SW7635-51: snapshot the STC offset (uiSoftwarePCROffset) when a
706    * picture is selected for display.  The valid bit will true once
707    * the picture has been promoted for display and false during the
708    * initial evaluation.
709    */
710   bool     bSwPcrOffsetValid;
711   uint32_t uiSoftwarePCROffset;
712
713   /* SW7425-2255: snapshot the display offset (uiPTSOffset) when a
714    * picture is selected for display.  The valid bit will be false
715    * during the initial evaluation and true once the picture has been
716    * promoted for display.
717    */
718   bool     bPtsOffsetValid;
719   uint32_t uiPtsOffset;
720
721   /* SW7425-1001: the following two flags are used to determine when to set
722    * "bLast" in the MFD picture structure, effectively an EOS flag.
723    *
724    * "bLastPictureSeen" is conditionally set when "bLastPicture" is set in a PPB.
725    * "bSetLastPictureFlag" is set after the last field of the last picture has been
726    * delivered to VDC.  It indicates that "MFD.bLast" should be set.
727    *
728    * The two flags may be overkill, but they ensure that once "MFD.bLast" is set,
729    * it stays set.
730    */
731   bool bLastPictureSeen;
732   bool bSetLastPictureFlag;
733
734} BXDM_PictureProvider_P_Display_Dynamic_Picture_Parms;
735
736typedef struct BXDM_PictureProvider_P_Display_Picture_Parms
737{
738   BXDM_PictureProvider_P_Display_Static_Picture_Parms stStatic;
739   BXDM_PictureProvider_P_Display_Dynamic_Picture_Parms stDynamic;
740} BXDM_PictureProvider_P_Display_Picture_Parms;
741
742typedef struct BXDM_PictureProvider_P_Picture_Params
743{
744   /* Misc Information */
745   uint32_t uiPPBIndex;
746
747   /* SW7405-4736: when QM debug enabled, dump the picture state if an eWait
748    * result for roughly a second.
749    */
750   uint32_t uiNumTimesWait;
751
752   /* Dynamic State Information */
753   uint32_t uiStateBits;
754   BXDM_PictureProvider_P_TSM_Picture_Parms stTSM;
755   BXDM_PictureProvider_P_Display_Picture_Parms stDisplay;
756} BXDM_PictureProvider_P_Picture_Params;
757
758typedef struct BXDM_PictureProvider_P_Picture_Context
759{
760      bool                       bValidated; /* Indicates if the context is valid. */
761
762      /* The following values are constant for each PPB */
763      const BXDM_Picture *pstUnifiedPicture;
764
765      BXDM_PictureProvider_P_Picture_Params   stPicParms;
766      BAVC_MFD_Picture           stMFDPicture;
767} BXDM_PictureProvider_P_Picture_Context;
768
769typedef struct BXDM_PictureProvider_P_ClipEvent
770{
771      bool bOccurred;
772      uint32_t uiTime;
773      bool bDelayedCallback;
774} BXDM_PictureProvider_P_ClipEvent;
775
776typedef struct BXDM_PictureProvider_P_ClipTimeV2
777{
778      BXDM_PictureProvider_ClipTimeSettings stTime;
779
780      BXDM_PictureProvider_P_ClipEvent stStartEvent;
781      BXDM_PictureProvider_P_ClipEvent stRequestEvent;
782      BXDM_PictureProvider_P_ClipEvent stDisplayEvent;
783      BXDM_PictureProvider_P_ClipEvent stStopEvent;
784      BXDM_PictureProvider_P_ClipEvent stMarkerEvent;
785} BXDM_PictureProvider_P_ClipTimeV2;
786
787typedef struct BXDM_PictureProvider_P_ClipInfo
788{
789      BXDM_PictureProvider_P_ClipTimeV2 stCurrentClip;
790
791      bool bClipActive;    /* SWBLURAY-22390: true when new clip parameters have been loaded and
792                            * the clip stop time has not been reached. */
793      uint32_t uiLastMarker;     /* the last marker seen */
794
795      bool bClipTransition;      /* true if we're in the middle of a clip transition */
796      bool bForcePTSError;  /* true if we want to force sending a PTS
797                             * error on the next VSYNC pass*/
798      bool bTrickModeTransition; /* true if we're in the middle of a trick mode transition */
799} BXDM_PictureProvider_P_ClipInfo;
800
801typedef enum BXDM_PictureProvider_P_DecodeState
802{
803      BXDM_PictureProvider_P_DecodeState_eStarted,
804      BXDM_PictureProvider_P_DecodeState_eStopped,
805
806      BXDM_PictureProvider_P_DecodeState_eMax
807} BXDM_PictureProvider_P_DecodeState;
808
809/* DM's persistent state between BXVD_OpenChannel and
810 * BXVD_CloseChannel() */
811typedef struct BXDM_PictureProvider_P_State_Channel
812{
813      BXDM_PictureProvider_P_Picture_Context stSelectedPicture; /* The currently selected picture */
814      BXDM_PictureProvider_P_Picture_Context stPreviousPicture; /* The previously selected picture (PPB may be invalid!) */
815      BXDM_PictureProvider_P_Picture_Context stPictureUnderEvaluation; /* The currently evaluated picture */
816      BXDM_PictureProvider_P_Picture_Context stPreviousPictureUnderEvaluation; /* The previously evaluated picture */
817
818      /* ePrevSourcePolarity helps us figure out the eSourcePolarity
819       * when MPIM is set to interlaced on progressive sources on a
820       * progressive display */
821      BAVC_Polarity ePrevSourcePolarity;
822      bool bPrevMute;
823
824      bool bDMVersionDisplayed;
825
826      BAVC_MFD_Picture stDefaultPicParams;
827
828   BXDM_PictureProvider_P_ClipInfo stClipInfo;
829   uint32_t uiPPBSerialNumber;
830
831   BXDM_PPJRC_P_Handle hJrc;
832   BXDM_PPAVG_P_Handle hDeltaSTCAvg;   /* used for rate matching for JTI */
833
834   BXDM_PictureProvider_ChannelChangeSettings stSavedChannelChangeSettings;
835   bool bSavedChannelChangeSettingsValid;
836
837   /* SW7425-2656: essentially flags that BXVD_DisableForFlush, BXVD_SetSkipPictureModeDecode
838    * or BXVD_PVR_SetHostSparseMode has been called.
839    */
840   bool bPostFlushDecode;
841
842   BXDM_PictureProvider_P_DecodeState eDecodeState;
843
844   /* Display Interrupt Handler that this Picture Provider is associated with,
845    * i.e. the sink for pictures from this PP.
846    */
847   BXDM_DisplayInterruptHandler_Handle hXdmDih;
848
849   /* SW7425-1264: the internal interpolated software STC. */
850   uint32_t uiSwStc;
851
852} BXDM_PictureProvider_P_State_Channel;
853
854#include "bxdm_pp_vtsm.h"
855#include "bxdm_pp_dbg.h"
856#include "bxdm_pp_frd.h"
857
858typedef enum BXDM_PictureProvider_P_STCStallType
859{
860   BXDM_PictureProvider_P_STCStallType_eUnderflow,
861   BXDM_PictureProvider_P_STCStallType_eFIC,
862
863   BXDM_PictureProvider_P_STCStallType_eMax
864} BXDM_PictureProvider_P_STCStallType;
865
866typedef struct BXDM_PictureProvider_P_State_NonRealTime
867{
868      uint32_t uiLastStc;
869      bool bLastStcValid;
870      bool bLastStallStc;
871      bool bLastStallStcValid;
872      BXDM_PictureProvider_P_STCStallType eSTCStallType; /* If bLastStallStc = true, this indicates WHY the STC was stalled */
873      BAVC_Polarity ePolarityWhenDeltaStcWasNonZero;
874      bool bPolarityFieldValid;                          /* SW7425-2424: force "ePolarityWhenDeltaStcWasNonZero" to be set */
875
876      /* SW7425-2270: if specified by the application, ignore picture underflows, i.e.
877       * don't stall the STC or set the MFD ignore flag.
878       */
879      bool bIgnoringUnderflow;
880} BXDM_PictureProvider_P_State_NonRealTime;
881
882/* DM's persistent state between BXVD_StartDecode and
883 * BXVD_StopDecode */
884typedef struct BXDM_PictureProvider_P_State_Decode
885{
886   BXDM_PictureProvider_PTSInfo stErrorPts;               /* the most recent PTS info that generated an error */
887
888   BXDM_PPVTSM_P_State stVTSM;             /* vTSM State */
889
890   /* Field Inversion Correction (FIC) */
891   BXDM_PPFP_P_DataType stFieldInversionCorrectionPTSOffset;
892
893   uint32_t    uiStcPtsDeltaSentToApp;    /* last STC PTS delta shipped to the application */
894   int32_t     iPreviousStcPtsDifferenceEvaluated;  /* The previous element's StcPtsDifferenceEvaluated  */
895
896   BXDM_PPDBG_P_Info stDebug;    /* Debug Log Information */
897
898   /* Sticky, indicates that a PPB has been promoted to displays status.
899    * (it may or may not have passed the TSM test)
900    */
901   bool  bFirstPPBHasBeenDisplayed;
902
903   /* Sticky, indicates that the first PPB has been seen after a
904    * start decode */
905   bool  bFirstPPBSeen;
906
907   /* Only set for the very first PPB
908    * TODO: still needed?
909    */
910   bool  bThisIsTheFirstPPB;
911
912   /* Channel Change - First Picture Preview */
913   bool bForceDisplayFirstPPB;
914
915   uint32_t uiPPBConsecutiveLateCount; /* A count of how many consecutive *unique* PPBs were late */
916   uint32_t uiPPBConsecutiveTooEarlyCount; /* A count of how many PPBs were too early */
917   bool bTooLateGimmeDone; /* True if previous PPB's TSM result was late */
918
919   uint32_t uiPendingDropCount;  /* a copy of the pending dropped count */
920
921   bool bPreviousVsyncWasTrickMode; /* Indicates if the previous
922                                     * vsync was in trick mode */
923   bool bAutoValidateStc; /* Indicates if DM should auto-validate
924                           * the STC on a TSM pass */
925
926   uint32_t uiRemovalDelay; /* Pictures on the queue are not
927                             * evaluated until the removal delay is
928                             * 0.  removal delay is decremented on
929                             * every vsync when the queue is not
930                             * empty */
931
932   bool bPreRolling;    /* Indicates that pictures are being displayed in the "preroll" mode   */
933
934   uint32_t uiPreRollPlaybackRate;  /* Rate as a precentage of normal playback to use during the preroll
935                                     * phase. BXVD_P_NORMAL_PLAYBACK_RATE is normal, i.e. 100% */
936
937
938   bool bDropUntilNextRAP; /* A decode error has been detected, drop pictures until the next RAP */
939
940   uint32_t uiDecodeErrorDropCount; /* number of pictures dropped due to decode errors. */
941
942   bool bDqUnderflowPrevVsync;      /* The delivery queue underflowed on the previous vsync */
943
944   BXDM_PictureProvider_PTSInfo stLatestCodedPts;   /* the most recent coded PTS seen on the delivery queue.
945                                     * Note: this picture may not be displayed. */
946
947   bool         bFirstCodedPtsReceived;   /* the first coded PTS has been received. */
948   BXDM_PictureProvider_PTSInfo stFirstCodedPts;          /* the first coded PTS received after BXDM_PP_S_ResetCommon was called. */
949
950   /* The following are used to print BDBG_WRN messages only once
951    * per change of parameter */
952   BAVC_FrameRateCode eLastUnsupportedFrameRate;
953   BXDM_PictureProvider_MonitorRefreshRate eLastIncorrectMonitorRefreshRate;
954   uint32_t ui32IncorrectMonitorRefreshRateCount;
955   BXDM_Picture_PullDown eLastUnsupportedPullDown;
956   /* SW7335-781: Keep track of selection mode override so warning only output on transitions */
957   BXDM_PictureProvider_DisplayMode eLastSelectionModeOverride;
958
959   BXDM_PictureProvider_P_STCTrickMode eLastCalculatedSTCTrickMode;
960   BXDM_PictureProvider_P_STCTrickMode eLastReportedSTCTrickMode;
961   uint32_t uiLastStcSnapshot;
962   bool bLastStcValid;
963
964   BXDM_Picture_PullDown ePPBPulldownHistory[BXDM_PictureProvider_P_MAX_PPB_PULLDOWN_HISTORY];
965   uint32_t uiPPBPulldownHistoryCount;
966   uint32_t uiPPBPulldownHistoryIndex;
967
968   BXDM_PPFRD_P_Stats stFRDStats;
969
970   BAVC_Polarity ePreviousVsyncPolarity;
971   bool bPreviousVsyncPolarityValid;
972
973   /* In live mode, indicates that a valid PCR offset has been received.
974    * TSM evaluation is held off until this variable is true.
975    */
976   bool bValidPcrOffsetReceived;
977
978   /* For measuring elapse times. */
979   BXDM_PPTIMER_P_Data  stTimerData;
980
981   int32_t iStcJitterCorrectionOffset;
982
983   /* Rate Match Detection */
984   int32_t iStcPtsDifferenceEvaluatedOfLastPPB;
985   bool bStcPtsDifferenceEvaluatedOfLastPPBValid;
986   bool bRateMatchedLastReported;
987
988   /* SW7405-3774/SW7550-379: This is a fix for ensuring that the BXDM_PictureProvider_Callback_eStcPtsOffset
989    * is always executed after BXVD_StartDecode is called.  There was a corner case with first picture preview
990    * and freezing the first picture.  When the picture finally passed TSM, it was being repeated; hence the
991    * callback was never generated. This flag essentially overrides the element repeated flag.
992    */
993   bool bExecutedInitialPtsStcOffsetCB;
994
995   /* The count of PPB's received since StartDecode was called. */
996   uint32_t uiPPBIndex;
997
998   /* SW7405-4736: used to print QM debug messages once per second
999    * Wrap this element and the preceding in a debug structure?
1000    */
1001    uint32_t uiVsyncCountQM;
1002
1003    BXDM_PictureProvider_P_State_NonRealTime stNonRealTime;
1004} BXDM_PictureProvider_P_State_Decode;
1005
1006/* DM's persistent state between vsyncs */
1007typedef struct BXDM_PictureProvider_P_State
1008{
1009      BXDM_PictureProvider_P_State_Channel stChannel;
1010      BXDM_PictureProvider_P_State_Decode stDecode;
1011} BXDM_PictureProvider_P_State;
1012
1013/* SW7405-4378: a warpper structure primarily for documentation. */
1014
1015typedef struct BXDM_PictureProvider_P_PictureParameterInfo
1016{
1017   bool              bUseCachedPictureParameters;
1018   BXDM_Picture      stUnifiedPicture;
1019   BAVC_MFD_Picture  stMFDPicture;
1020
1021} BXDM_PictureProvider_P_PictureParameterInfo;
1022
1023
1024typedef struct BXDM_PictureProvider_P_Status
1025{
1026   BXDM_PictureProvider_PTSInfo stCurrentPTS;
1027   BXDM_PictureProvider_Callback_PictureParameterInfo stPictureParameterInfo;
1028
1029   /* SW7405-4378: at start decode, cache the picture parameters locally
1030    * until a picture passes the TSM test and is sent to VDC.
1031    * After that, the ePictureParameters callback will report the picture
1032    * parameters for the displayed picture.
1033    */
1034   BXDM_PictureProvider_P_PictureParameterInfo stCachedPictureParameters;
1035
1036   BXDM_PictureProvider_PTSInfo stCodedPTS;
1037   BXDM_PictureProvider_PTSInfo stNextPTS;
1038   bool bNextPTSInfoValid;
1039
1040   bool bIPictureFound;
1041   uint32_t uiPictureTag;
1042   BXDM_Picture_GopTimeCode stGOPTimeCode;    /* GOP time code of the currently displayed picture */
1043
1044   BXDM_PictureProvider_Counters stCounters;
1045
1046   BXDM_Picture stCurrentPPBParameterInfo;
1047   bool bCurrentPPBParameterInfoValid;
1048} BXDM_PictureProvider_P_Status;
1049
1050#define BXDM_PictureProvider_P_MFDPicture_Max 2
1051
1052typedef struct BXDM_PictureProvider_P_Context
1053{
1054      BXDM_PictureProvider_P_State stDMState; /* Persistent DM State */
1055      BXDM_PictureProvider_P_Config stDMConfig; /* DM Configuration */
1056      BXDM_PictureProvider_P_Status stDMStatus; /* DM Status */
1057
1058      BXDM_PictureProvider_P_Callback stCallbacks[BXDM_PictureProvider_Callback_eMax];
1059
1060      BAVC_MFD_Picture *astMFDPicture;
1061      uint32_t uiMFDPictureCount;
1062
1063      BTMR_TimerHandle hTimer;
1064} BXDM_PictureProvider_P_Context;
1065
1066#endif /* BXDM_PP_PRIV_H_ */
Note: See TracBrowser for help on using the repository browser.