contrib: soxr: fix build on WIN32
[vlc.git] / include / vlc_vout.h
blob60c148d498ede6f888744a8f0e3fe53d5b330ff9
1 /*****************************************************************************
2 * vlc_vout.h: common video definitions
3 *****************************************************************************
4 * Copyright (C) 1999 - 2008 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Vincent Seguin <seguin@via.ecp.fr>
8 * Samuel Hocevar <sam@via.ecp.fr>
9 * Olivier Aubert <oaubert 47 videolan d07 org>
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
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 Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 #ifndef VLC_VOUT_H_
27 #define VLC_VOUT_H_ 1
29 #include <vlc_es.h>
30 #include <vlc_picture.h>
31 #include <vlc_subpicture.h>
33 /**
34 * \defgroup output Output
35 * \ingroup vlc
36 * \defgroup video_output Video output
37 * \ingroup output
38 * Video rendering, output and window management
40 * This module describes the programming interface for video output threads.
41 * It includes functions allowing to open a new thread, send pictures to a
42 * thread, and destroy a previously opened video output thread.
43 * @{
44 * \file
45 * Video output thread interface
48 /**
49 * Vout configuration
51 typedef struct {
52 vout_thread_t *vout;
53 vlc_object_t *input;
54 bool change_fmt;
55 const video_format_t *fmt;
56 unsigned dpb_size;
57 } vout_configuration_t;
59 /**
60 * Video output thread private structure
62 typedef struct vout_thread_sys_t vout_thread_sys_t;
64 /**
65 * Video output thread descriptor
67 * Any independent video output device, such as an X11 window or a GGI device,
68 * is represented by a video output thread, and described using the following
69 * structure.
71 struct vout_thread_t {
72 struct vlc_common_members obj;
74 /* Private vout_thread data */
75 vout_thread_sys_t *p;
78 /* Alignment flags */
79 #define VOUT_ALIGN_LEFT 0x0001
80 #define VOUT_ALIGN_RIGHT 0x0002
81 #define VOUT_ALIGN_HMASK 0x0003
82 #define VOUT_ALIGN_TOP 0x0004
83 #define VOUT_ALIGN_BOTTOM 0x0008
84 #define VOUT_ALIGN_VMASK 0x000C
86 /*****************************************************************************
87 * Prototypes
88 *****************************************************************************/
90 /**
91 * Returns a suitable vout or release the given one.
93 * If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout
94 * is possible, otherwise it returns NULL.
95 * If cfg->vout is not used, it will be closed and released.
97 * You can release the returned value either by vout_Request or vout_Close()
98 * followed by a vlc_object_release() or shorter vout_CloseAndRelease()
100 * \param object a vlc object
101 * \param cfg the video configuration requested.
102 * \return a vout
104 VLC_API vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t *cfg );
105 #define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
108 * This function will close a vout created by vout_Request.
109 * The associated vout module is closed.
110 * Note: It is not released yet, you'll have to call vlc_object_release()
111 * or use the convenient vout_CloseAndRelease().
113 * \param p_vout the vout to close
115 VLC_API void vout_Close( vout_thread_t *p_vout );
118 * This function will close a vout created by vout_Create
119 * and then release it.
121 * \param p_vout the vout to close and release
123 static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
125 vout_Close( p_vout );
126 vlc_object_release( p_vout );
130 * This function will handle a snapshot request.
132 * pp_image, pp_picture and p_fmt can be NULL otherwise they will be
133 * set with returned value in case of success.
135 * pp_image will hold an encoded picture in psz_format format.
137 * p_fmt can be NULL otherwise it will be set with the format used for the
138 * picture before encoding.
140 * i_timeout specifies the time the function will wait for a snapshot to be
141 * available.
144 VLC_API int vout_GetSnapshot( vout_thread_t *p_vout,
145 block_t **pp_image, picture_t **pp_picture,
146 video_format_t *p_fmt,
147 const char *psz_format, mtime_t i_timeout );
149 VLC_API void vout_ChangeAspectRatio( vout_thread_t *p_vout,
150 unsigned int i_num, unsigned int i_den );
152 /* */
153 VLC_API picture_t * vout_GetPicture( vout_thread_t * );
154 VLC_API void vout_PutPicture( vout_thread_t *, picture_t * );
156 /* Subpictures channels ID */
157 #define VOUT_SPU_CHANNEL_OSD 1 /* OSD channel is automatically cleared */
158 #define VOUT_SPU_CHANNEL_AVAIL_FIRST 8 /* Registerable channels from this offset */
160 /* */
161 VLC_API void vout_PutSubpicture( vout_thread_t *, subpicture_t * );
162 VLC_API int vout_RegisterSubpictureChannel( vout_thread_t * );
163 VLC_API void vout_FlushSubpictureChannel( vout_thread_t *, int );
165 /**@}*/
167 #endif /* _VLC_VIDEO_H */