]> git.sesse.net Git - vlc/blob - src/video_output/vout_internal.h
Moved vout helpers out of decoder.c.
[vlc] / src / video_output / vout_internal.h
1 /*****************************************************************************
2  * vout_internal.h : Internal vout definitions
3  *****************************************************************************
4  * Copyright (C) 2008 the VideoLAN team
5  * Copyright (C) 2008 Laurent Aimar
6  * $Id$
7  *
8  * Authors: Laurent Aimar < fenrir _AT_ videolan _DOT_ org >
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25
26 #if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
27 # error This header file can only be included from LibVLC.
28 #endif
29
30 #ifndef _VOUT_INTERNAL_H
31 #define _VOUT_INTERNAL_H 1
32
33 struct vout_thread_sys_t
34 {
35     /* */
36     vlc_mutex_t         vfilter_lock;         /**< video filter2 change lock */
37
38     /* */
39     uint32_t            render_time;           /**< last picture render time */
40     unsigned int        i_par_num;           /**< monitor pixel aspect-ratio */
41     unsigned int        i_par_den;           /**< monitor pixel aspect-ratio */
42
43     /* */
44     bool                b_direct;            /**< rendered are like direct ? */
45     filter_t           *p_chroma;
46
47     /**
48      * These numbers are not supposed to be accurate, but are a
49      * good indication of the thread status */
50     count_t       c_fps_samples;                         /**< picture counts */
51     mtime_t       p_fps_sample[VOUT_FPS_SAMPLES];     /**< FPS samples dates */
52
53     /* Statistics */
54     int             i_picture_lost;
55     int             i_picture_displayed;
56
57     /* Pause */
58     bool            b_paused;
59     mtime_t         i_pause_date;
60
61     /* Filter chain */
62     char           *psz_filter_chain;
63     bool            b_filter_change;
64
65     /* Video filter2 chain */
66     filter_chain_t *p_vf2_chain;
67     char           *psz_vf2;
68
69     /* Misc */
70     bool            b_snapshot;     /**< take one snapshot on the next loop */
71
72     /* Show media title on videoutput */
73     bool            b_title_show;
74     mtime_t         i_title_timeout;
75     int             i_title_position;
76 };
77
78 /* DO NOT use vout_RenderPicture unless you are in src/video_ouput */
79 picture_t *vout_RenderPicture( vout_thread_t *, picture_t *,
80                                subpicture_t *, bool b_paused );
81
82 /* DO NOT use vout_CountPictureAvailable unless your are in src/input/decoder.c (no exception) */
83 int vout_CountPictureAvailable( vout_thread_t * );
84
85 /**
86  * This function will (un)pause the display of pictures.
87  * It is thread safe
88  */
89 void vout_ChangePause( vout_thread_t *, bool b_paused, mtime_t i_date );
90
91 /**
92  * This function will apply an offset on subtitle subpicture.
93  */
94 void spu_OffsetSubtitleDate( spu_t *p_spu, mtime_t i_duration );
95
96 /**
97  * This function will return and reset internal statistics.
98  */
99 void vout_GetResetStatistic( vout_thread_t *p_vout, int *pi_displayed, int *pi_lost );
100
101 /**
102  * This function will ensure that all ready/displayed pciture have at most
103  * the provided dat
104  */
105 void vout_Flush( vout_thread_t *p_vout, mtime_t i_date );
106
107 /**
108  * This function will try to detect if pictures are being leaked. If so it
109  * will release them.
110  *
111  * XXX This function is there to workaround bugs in decoder
112  */
113 void vout_FixLeaks( vout_thread_t *p_vout );
114
115 /**
116  * This functions will drop a picture retreived by vout_CreatePicture.
117  */
118 void vout_DropPicture( vout_thread_t *p_vout, picture_t * );
119
120 #endif
121