00001 /***************************************************************************** 00002 * vout_synchro.h: frame-dropping structures 00003 ***************************************************************************** 00004 * Copyright (C) 1999-2005 the VideoLAN team 00005 * $Id: vout_synchro.h 11664 2005-07-09 06:17:09Z courmisch $ 00006 * 00007 * Authors: Christophe Massiot <[email protected]> 00008 * Jean-Marc Dressler <[email protected]> 00009 * Stéphane Borel <[email protected]> 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 00024 *****************************************************************************/ 00025 00026 /***************************************************************************** 00027 * vout_synchro_t : timers for the video synchro 00028 *****************************************************************************/ 00029 #define MAX_PIC_AVERAGE 8 00030 00031 /* Read the discussion on top of vout_synchro.c for more information. */ 00032 struct vout_synchro_t 00033 { 00034 VLC_COMMON_MEMBERS 00035 00036 vout_thread_t * p_vout; 00037 int i_frame_rate; 00038 int i_current_rate; 00039 vlc_bool_t b_no_skip; 00040 vlc_bool_t b_quiet; 00041 00042 /* date of the beginning of the decoding of the current picture */ 00043 mtime_t decoding_start; 00044 00045 /* stream properties */ 00046 unsigned int i_n_p, i_n_b; 00047 00048 /* decoding values */ 00049 mtime_t p_tau[4]; /* average decoding durations */ 00050 unsigned int pi_meaningful[4]; /* number of durations read */ 00051 00052 /* render_time filled by SynchroChoose() */ 00053 int i_render_time; 00054 00055 /* stream context */ 00056 int i_nb_ref; /* Number of reference pictures */ 00057 int i_dec_nb_ref; /* Number of reference pictures we'll * 00058 * have if we decode the current pic */ 00059 int i_trash_nb_ref; /* Number of reference pictures we'll * 00060 * have if we trash the current pic */ 00061 unsigned int i_eta_p, i_eta_b; 00062 mtime_t backward_pts, current_pts; 00063 int i_current_period; /* period to add to the next picture */ 00064 int i_backward_period; /* period to add after the next 00065 * reference picture 00066 * (backward_period * period / 2) */ 00067 00068 /* statistics */ 00069 unsigned int i_trashed_pic, i_not_chosen_pic, i_pic; 00070 }; 00071 00072 /* Pictures types */ 00073 #define I_CODING_TYPE 1 00074 #define P_CODING_TYPE 2 00075 #define B_CODING_TYPE 3 00076 #define D_CODING_TYPE 4 /* MPEG-1 ONLY */ 00077 /* other values are reserved */ 00078 00079 /* Structures */ 00080 #define TOP_FIELD 1 00081 #define BOTTOM_FIELD 2 00082 #define FRAME_STRUCTURE 3 00083 00084 /***************************************************************************** 00085 * Prototypes 00086 *****************************************************************************/ 00087 #define vout_SynchroInit(a,b) __vout_SynchroInit(VLC_OBJECT(a),b) 00088 VLC_EXPORT( vout_synchro_t *, __vout_SynchroInit, ( vlc_object_t *, int ) ); 00089 VLC_EXPORT( void, vout_SynchroRelease, ( vout_synchro_t * ) ); 00090 VLC_EXPORT( void, vout_SynchroReset, ( vout_synchro_t * ) ); 00091 VLC_EXPORT( vlc_bool_t, vout_SynchroChoose, ( vout_synchro_t *, int, int, vlc_bool_t ) ); 00092 VLC_EXPORT( void, vout_SynchroTrash, ( vout_synchro_t * ) ); 00093 VLC_EXPORT( void, vout_SynchroDecode, ( vout_synchro_t * ) ); 00094 VLC_EXPORT( void, vout_SynchroEnd, ( vout_synchro_t *, int, vlc_bool_t ) ); 00095 VLC_EXPORT( mtime_t, vout_SynchroDate, ( vout_synchro_t * ) ); 00096 VLC_EXPORT( void, vout_SynchroNewPicture, ( vout_synchro_t *, int, int, mtime_t, mtime_t, int, vlc_bool_t ) ); 00097