]> git.sesse.net Git - vlc/blob - src/video_output/vout_internal.h
Moved some private fields out of vlc_vout.h
[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 #include "vout_control.h"
34 #include "snapshot.h"
35 #include "statistic.h"
36
37 /* Number of pictures required to computes the FPS rate */
38 #define VOUT_FPS_SAMPLES                20
39
40 /* */
41 struct vout_thread_sys_t
42 {
43     /* module */
44     char       *psz_module_name;
45
46     /* Video output configuration */
47     config_chain_t *p_cfg;
48
49     /* Place holder for the vout_wrapper code */
50     vout_sys_t      *p_sys;
51
52     /* Thread & synchronization */
53     vlc_thread_t    thread;
54     vlc_cond_t      change_wait;
55     bool            b_ready;
56     bool            b_done;
57     bool            b_error;
58
59     /* */
60     bool            b_picture_displayed;
61     bool            b_picture_empty;
62     mtime_t         i_picture_displayed_date;
63     picture_t       *p_picture_displayed;
64     int             i_picture_qtype;
65     bool            b_picture_interlaced;
66     vlc_cond_t      picture_wait;
67
68     /* */
69     vlc_mutex_t     vfilter_lock;         /**< video filter2 lock */
70
71     /* */
72     uint32_t        render_time;           /**< last picture render time */
73     unsigned int    i_par_num;           /**< monitor pixel aspect-ratio */
74     unsigned int    i_par_den;           /**< monitor pixel aspect-ratio */
75
76     /**
77      * These numbers are not supposed to be accurate, but are a
78      * good indication of the thread status */
79     count_t         c_fps_samples;                         /**< picture counts */
80     mtime_t         p_fps_sample[VOUT_FPS_SAMPLES];     /**< FPS samples dates */
81
82     /* Statistics */
83     vout_statistic_t statistic;
84
85     /* Pause */
86     bool            b_paused;
87     mtime_t         i_pause_date;
88
89     /* Filter chain */
90     bool           b_first_vout;  /* True if it is the first vout of the filter chain */
91     char           *psz_filter_chain;
92     bool            b_filter_change;
93
94     /* Video filter2 chain */
95     filter_chain_t *p_vf2_chain;
96     char           *psz_vf2;
97
98     /* Snapshot interface */
99     vout_snapshot_t snapshot;
100
101     /* Show media title on videoutput */
102     bool            b_title_show;
103     mtime_t         i_title_timeout;
104     int             i_title_position;
105
106     char            *psz_title;
107
108     /* Subpicture unit */
109     spu_t          *p_spu;
110
111     /* */
112     vlc_mouse_t     mouse;
113 };
114
115 /* */
116 int vout_AllocatePicture( vlc_object_t *, picture_t *, uint32_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den );
117 #define vout_AllocatePicture(a,b,c,d,e,f,g) \
118         vout_AllocatePicture(VLC_OBJECT(a),b,c,d,e,f,g)
119
120 /* DO NOT use vout_RenderPicture/vout_IntfInit unless you are in src/video_ouput */
121 picture_t *vout_RenderPicture( vout_thread_t *, picture_t *,
122                                subpicture_t *,
123                                mtime_t render_date );
124 void vout_IntfInit( vout_thread_t * );
125
126 /* DO NOT use vout_UsePictureLocked unless you are in src/video_ouput
127  *
128  * This function supposes that you call it with picture_lock taken.
129  */
130 void vout_UsePictureLocked( vout_thread_t *p_vout, picture_t *p_pic  );
131
132 /* */
133 int  vout_OpenWrapper (vout_thread_t *, const char *);
134 void vout_CloseWrapper(vout_thread_t *);
135 int  vout_InitWrapper(vout_thread_t *);
136 void vout_EndWrapper(vout_thread_t *);
137 int  vout_ManageWrapper(vout_thread_t *);
138 void vout_RenderWrapper(vout_thread_t *, picture_t *);
139 void vout_DisplayWrapper(vout_thread_t *, picture_t *);
140
141 #endif
142