]> git.sesse.net Git - vlc/blob - include/vout_synchro.h
mkv.cpp: add some debugging messages for the users and tests for unsupported tracks
[vlc] / include / vout_synchro.h
1 /*****************************************************************************
2  * vout_synchro.h: frame-dropping structures
3  *****************************************************************************
4  * Copyright (C) 1999-2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Christophe Massiot <massiot@via.ecp.fr>
8  *          Jean-Marc Dressler <polux@via.ecp.fr>
9  *          Stéphane Borel <stef@via.ecp.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 /*****************************************************************************
27  * vout_synchro_t : timers for the video synchro
28  *****************************************************************************/
29 #define MAX_PIC_AVERAGE         8
30
31 /* Read the discussion on top of vout_synchro.c for more information. */
32 struct vout_synchro_t
33 {
34     VLC_COMMON_MEMBERS
35
36     vout_thread_t * p_vout;
37     int             i_frame_rate;
38     int             i_current_rate;
39     vlc_bool_t      b_no_skip;
40     vlc_bool_t      b_quiet;
41
42     /* date of the beginning of the decoding of the current picture */
43     mtime_t         decoding_start;
44
45     /* stream properties */
46     unsigned int    i_n_p, i_n_b;
47
48     /* decoding values */
49     mtime_t         p_tau[4];                  /* average decoding durations */
50     unsigned int    pi_meaningful[4];            /* number of durations read */
51
52     /* render_time filled by SynchroChoose() */
53     int i_render_time;
54
55     /* stream context */
56     int             i_nb_ref;                /* Number of reference pictures */
57     int             i_dec_nb_ref;      /* Number of reference pictures we'll *
58                                         * have if we decode the current pic  */
59     int             i_trash_nb_ref;    /* Number of reference pictures we'll *
60                                         * have if we trash the current pic   */
61     unsigned int    i_eta_p, i_eta_b;
62     mtime_t         backward_pts, current_pts;
63     int             i_current_period;   /* period to add to the next picture */
64     int             i_backward_period;  /* period to add after the next
65                                          * reference picture
66                                          * (backward_period * period / 2) */
67
68     /* statistics */
69     unsigned int    i_trashed_pic, i_not_chosen_pic, i_pic;
70 };
71
72 /* Pictures types */
73 #define I_CODING_TYPE           1
74 #define P_CODING_TYPE           2
75 #define B_CODING_TYPE           3
76 #define D_CODING_TYPE           4 /* MPEG-1 ONLY */
77 /* other values are reserved */
78
79 /* Structures */
80 #define TOP_FIELD               1
81 #define BOTTOM_FIELD            2
82 #define FRAME_STRUCTURE         3
83
84 /*****************************************************************************
85  * Prototypes
86  *****************************************************************************/
87 #define vout_SynchroInit(a,b) __vout_SynchroInit(VLC_OBJECT(a),b)
88 VLC_EXPORT( vout_synchro_t *, __vout_SynchroInit, ( vlc_object_t *, int ) );
89 VLC_EXPORT( void, vout_SynchroRelease,        ( vout_synchro_t * ) );
90 VLC_EXPORT( void, vout_SynchroReset,          ( vout_synchro_t * ) );
91 VLC_EXPORT( vlc_bool_t, vout_SynchroChoose,   ( vout_synchro_t *, int, int, vlc_bool_t ) );
92 VLC_EXPORT( void, vout_SynchroTrash,          ( vout_synchro_t * ) );
93 VLC_EXPORT( void, vout_SynchroDecode,         ( vout_synchro_t * ) );
94 VLC_EXPORT( void, vout_SynchroEnd,            ( vout_synchro_t *, int, vlc_bool_t ) );
95 VLC_EXPORT( mtime_t, vout_SynchroDate,        ( vout_synchro_t * ) );
96 VLC_EXPORT( void, vout_SynchroNewPicture,     ( vout_synchro_t *, int, int, mtime_t, mtime_t, int, vlc_bool_t ) );
97