1 /*****************************************************************************
2 * vpar_synchro.h : video parser blocks management
4 *****************************************************************************
5 *****************************************************************************
16 *****************************************************************************/
20 /*****************************************************************************
21 * video_synchro_t and video_synchro_tab_s : timers for the video synchro
22 *****************************************************************************/
24 typedef struct video_synchro_tab_s
29 } video_synchro_tab_t;
31 typedef struct video_synchro_fifo_s
33 /* type of image to be decoded, and decoding date */
35 mtime_t i_decode_date;
38 } video_synchro_fifo_t;
40 typedef struct video_synchro_s
42 /* fifo containing decoding dates */
43 video_synchro_fifo_t fifo[16];
44 unsigned int i_fifo_start;
45 unsigned int i_fifo_stop;
47 /* mean decoding time */
48 mtime_t i_mean_decode_time;
50 mtime_t i_last_display_pts; /* pts of the last displayed image */
51 mtime_t i_last_decode_pts; /* pts of the last decoded image */
52 mtime_t i_last_i_pts; /* pts of the last I image */
53 mtime_t i_last_nondropped_i_pts; /* pts of last non-dropped I image */
54 unsigned int i_images_since_pts;
56 /* il manquait un compteur */
59 /* P images since the last I */
60 unsigned int current_p_count;
61 unsigned int nondropped_p_count;
62 double p_count_predict;
63 /* B images since the last I */
64 unsigned int current_b_count;
65 unsigned int nondropped_b_count;
66 double b_count_predict;
68 /* can we display pictures ? */
69 unsigned int can_display_i;
70 unsigned int can_display_p;
72 unsigned int can_display_b;
75 /* 1 for linear count, 2 for binary count, 3 for ternary count */
76 video_synchro_tab_t tab_p[6];
77 video_synchro_tab_t tab_b[6];
84 typedef struct video_synchro_s
86 int kludge_level, kludge_p, kludge_b, kludge_nbp, kludge_nbb;
88 mtime_t kludge_date, kludge_prevdate;
92 #define SYNC_TOLERATE 10000 /* 10 ms */
93 #define SYNC_DELAY 500000
96 /*****************************************************************************
98 *****************************************************************************/
99 boolean_t vpar_SynchroChoose( struct vpar_thread_s * p_vpar, int i_coding_type,
101 void vpar_SynchroTrash( struct vpar_thread_s * p_vpar, int i_coding_type,
103 void vpar_SynchroDecode( struct vpar_thread_s * p_vpar, int i_coding_type,
105 void vpar_SynchroEnd( struct vpar_thread_s * p_vpar );
106 mtime_t vpar_SynchroDate( struct vpar_thread_s * p_vpar );
109 void vpar_SynchroKludge( struct vpar_thread_s *, mtime_t );