VT: only use hw decoding unless explicitely requested
[vlc.git] / include / vlc_vout.h
blob99874040228af46fb9cd17e6644b832b652cb2c3
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 * \defgroup video_output Video output
36 * \ingroup output
37 * Video rendering, output and window management
39 * This module describes the programming interface for video output threads.
40 * It includes functions allowing to open a new thread, send pictures to a
41 * thread, and destroy a previously opened video output thread.
42 * @{
43 * \file
44 * Video output thread interface
47 /**
48 * Vout configuration
50 typedef struct {
51 vout_thread_t *vout;
52 vlc_object_t *input;
53 bool change_fmt;
54 const video_format_t *fmt;
55 unsigned dpb_size;
56 } vout_configuration_t;
58 /**
59 * Video output thread private structure
61 typedef struct vout_thread_sys_t vout_thread_sys_t;
63 /**
64 * Video output thread descriptor
66 * Any independent video output device, such as an X11 window or a GGI device,
67 * is represented by a video output thread, and described using the following
68 * structure.
70 struct vout_thread_t {
71 VLC_COMMON_MEMBERS
73 /* Private vout_thread data */
74 vout_thread_sys_t *p;
77 /* Alignment flags */
78 #define VOUT_ALIGN_LEFT 0x0001
79 #define VOUT_ALIGN_RIGHT 0x0002
80 #define VOUT_ALIGN_HMASK 0x0003
81 #define VOUT_ALIGN_TOP 0x0004
82 #define VOUT_ALIGN_BOTTOM 0x0008
83 #define VOUT_ALIGN_VMASK 0x000C
85 /*****************************************************************************
86 * Prototypes
87 *****************************************************************************/
89 /**
90 * Returns a suitable vout or release the given one.
92 * If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout
93 * is possible, otherwise it returns NULL.
94 * If cfg->vout is not used, it will be closed and released.
96 * You can release the returned value either by vout_Request or vout_Close()
97 * followed by a vlc_object_release() or shorter vout_CloseAndRelease()
99 * \param object a vlc object
100 * \param cfg the video configuration requested.
101 * \return a vout
103 VLC_API vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t *cfg );
104 #define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
107 * This function will close a vout created by vout_Request.
108 * The associated vout module is closed.
109 * Note: It is not released yet, you'll have to call vlc_object_release()
110 * or use the convenient vout_CloseAndRelease().
112 * \param p_vout the vout to close
114 VLC_API void vout_Close( vout_thread_t *p_vout );
117 * This function will close a vout created by vout_Create
118 * and then release it.
120 * \param p_vout the vout to close and release
122 static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
124 vout_Close( p_vout );
125 vlc_object_release( p_vout );
129 * This function will handle a snapshot request.
131 * pp_image, pp_picture and p_fmt can be NULL otherwise they will be
132 * set with returned value in case of success.
134 * pp_image will hold an encoded picture in psz_format format.
136 * p_fmt can be NULL otherwise it will be set with the format used for the
137 * picture before encoding.
139 * i_timeout specifies the time the function will wait for a snapshot to be
140 * available.
143 VLC_API int vout_GetSnapshot( vout_thread_t *p_vout,
144 block_t **pp_image, picture_t **pp_picture,
145 video_format_t *p_fmt,
146 const char *psz_format, mtime_t i_timeout );
148 VLC_API void vout_ChangeAspectRatio( vout_thread_t *p_vout,
149 unsigned int i_num, unsigned int i_den );
151 /* */
152 VLC_API picture_t * vout_GetPicture( vout_thread_t * );
153 VLC_API void vout_PutPicture( vout_thread_t *, picture_t * );
155 /* Subpictures channels ID */
156 #define VOUT_SPU_CHANNEL_OSD 1 /* OSD channel is automatically cleared */
157 #define VOUT_SPU_CHANNEL_AVAIL_FIRST 8 /* Registerable channels from this offset */
159 /* */
160 VLC_API void vout_PutSubpicture( vout_thread_t *, subpicture_t * );
161 VLC_API int vout_RegisterSubpictureChannel( vout_thread_t * );
162 VLC_API void vout_FlushSubpictureChannel( vout_thread_t *, int );
164 /**@}*/
166 #endif /* _VLC_VIDEO_H */