VLC  3.0.15
vlc_vout.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_vout.h: common video definitions
3  *****************************************************************************
4  * Copyright (C) 1999 - 2008 VLC authors and VideoLAN
5  * $Id: 627f6cec2e3b96eea04f9566ef799ed5b3a93b2a $
6  *
7  * Authors: Vincent Seguin <seguin@via.ecp.fr>
8  * Samuel Hocevar <sam@via.ecp.fr>
9  * Olivier Aubert <oaubert 47 videolan d07 org>
10  *
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.
15  *
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.
20  *
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  *****************************************************************************/
25 
26 #ifndef VLC_VOUT_H_
27 #define VLC_VOUT_H_ 1
28 
29 #include <vlc_es.h>
30 #include <vlc_picture.h>
31 #include <vlc_subpicture.h>
32 
33 /**
34  * \defgroup output Output
35  * \defgroup video_output Video output
36  * \ingroup output
37  * Video rendering, output and window management
38  *
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
45  */
46 
47 /**
48  * Vout configuration
49  */
50 typedef struct {
53  bool change_fmt;
55  unsigned dpb_size;
57 
58 /**
59  * Video output thread private structure
60  */
62 
63 /**
64  * Video output thread descriptor
65  *
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.
69  */
70 struct vout_thread_t {
72 
73  /* Private vout_thread data */
75 };
76 
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
84 
85 /*****************************************************************************
86  * Prototypes
87  *****************************************************************************/
88 
89 /**
90  * Returns a suitable vout or release the given one.
91  *
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.
95  *
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()
98  *
99  * \param object a vlc object
100  * \param cfg the video configuration requested.
101  * \return a vout
102  */
104 #define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
105 
106 /**
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().
111  *
112  * \param p_vout the vout to close
113  */
114 VLC_API void vout_Close( vout_thread_t *p_vout );
115 
116 /**
117  * This function will close a vout created by vout_Create
118  * and then release it.
119  *
120  * \param p_vout the vout to close and release
121  */
122 static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
123 {
124  vout_Close( p_vout );
125  vlc_object_release( p_vout );
126 }
127 
128 /**
129  * This function will handle a snapshot request.
130  *
131  * pp_image, pp_picture and p_fmt can be NULL otherwise they will be
132  * set with returned value in case of success.
133  *
134  * pp_image will hold an encoded picture in psz_format format.
135  *
136  * p_fmt can be NULL otherwise it will be set with the format used for the
137  * picture before encoding.
138  *
139  * i_timeout specifies the time the function will wait for a snapshot to be
140  * available.
141  *
142  */
144  block_t **pp_image, picture_t **pp_picture,
145  video_format_t *p_fmt,
146  const char *psz_format, mtime_t i_timeout );
147 
149  unsigned int i_num, unsigned int i_den );
150 
151 /* */
154 
155 /* Subpictures channels ID */
156 #define VOUT_SPU_CHANNEL_INVALID (-1) /* Always fails in comparison */
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 */
159 
160 /* */
164 
165 /**@}*/
166 
167 #endif /* _VLC_VIDEO_H */
vlc_es.h
VLC_API
#define VLC_API
Definition: fourcc_gen.c:30
vout_Close
void vout_Close(vout_thread_t *p_vout)
This function will close a vout created by vout_Request.
Definition: video_output.c:259
VLC_COMMON_MEMBERS
#define VLC_COMMON_MEMBERS
Backward compatibility macro.
Definition: vlc_common.h:453
vout_configuration_t::fmt
const video_format_t * fmt
Definition: vlc_vout.h:54
vlc_common.h
vout_FlushSubpictureChannel
void vout_FlushSubpictureChannel(vout_thread_t *, int)
Definition: video_output.c:389
video_format_t
video format description
Definition: vlc_es.h:325
vout_configuration_t::vout
vout_thread_t * vout
Definition: vlc_vout.h:51
picture_t
Video picture.
Definition: vlc_picture.h:68
vout_GetPicture
picture_t * vout_GetPicture(vout_thread_t *)
Allocates a video output picture buffer.
Definition: video_output.c:404
vout_configuration_t
Vout configuration.
Definition: vlc_vout.h:50
vlc_object_release
#define vlc_object_release(a)
Definition: vlc_objects.h:63
vout_ChangeAspectRatio
void vout_ChangeAspectRatio(vout_thread_t *p_vout, unsigned int i_num, unsigned int i_den)
Definition: video_output.c:474
subpicture_t
Video subtitle.
Definition: vlc_subpicture.h:153
vout_thread_t::p
vout_thread_sys_t * p
Definition: vlc_vout.h:74
vout_GetSnapshot
int vout_GetSnapshot(vout_thread_t *p_vout, block_t **pp_image, picture_t **pp_picture, video_format_t *p_fmt, const char *psz_format, mtime_t i_timeout)
This function will handle a snapshot request.
Definition: video_output.c:441
vout_PutSubpicture
void vout_PutSubpicture(vout_thread_t *, subpicture_t *)
Definition: video_output.c:370
vlc_subpicture.h
vlc_object_t
The main vlc_object_t structure.
Definition: vlc_objects.h:39
vout_configuration_t::input
vlc_object_t * input
Definition: vlc_vout.h:52
vout_configuration_t::change_fmt
bool change_fmt
Definition: vlc_vout.h:53
vout_PutPicture
void vout_PutPicture(vout_thread_t *, picture_t *)
It gives to the vout a picture to be displayed.
Definition: video_output.c:422
vlc_picture.h
vout_configuration_t::dpb_size
unsigned dpb_size
Definition: vlc_vout.h:55
vout_RegisterSubpictureChannel
int vout_RegisterSubpictureChannel(vout_thread_t *)
Definition: video_output.c:378
vout_Request
#define vout_Request(a, b)
Definition: vlc_vout.h:103
mtime_t
int64_t mtime_t
High precision date or time interval.
Definition: vlc_common.h:150
vout_thread_t
Video output thread descriptor.
Definition: vlc_vout.h:70
vout_thread_sys_t
Definition: vout_internal.h:46
block_t
Definition: vlc_block.h:111
vout_CloseAndRelease
static void vout_CloseAndRelease(vout_thread_t *p_vout)
This function will close a vout created by vout_Create and then release it.
Definition: vlc_vout.h:121