vlc_vout.h 5.29 KB
Newer Older
1
/*****************************************************************************
Pere Orga's avatar
Pere Orga committed
2
 * vlc_vout.h: common video definitions
3
 *****************************************************************************
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
4
 * Copyright (C) 1999 - 2008 VLC authors and VideoLAN
5
 * $Id$
6
 *
7
 * Authors: Vincent Seguin <seguin@via.ecp.fr>
Clément Stenac's avatar
Clément Stenac committed
8 9
 *          Samuel Hocevar <sam@via.ecp.fr>
 *          Olivier Aubert <oaubert 47 videolan d07 org>
10
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
11 12 13
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
14
 * (at your option) any later version.
15
 *
16 17
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
18 19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
20
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
21 22 23
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24
 *****************************************************************************/
25

26 27
#ifndef VLC_VOUT_H_
#define VLC_VOUT_H_ 1
Gildas Bazin's avatar
 
Gildas Bazin committed
28

29 30 31 32 33
/**
 * \file
 * This file defines common video output structures and functions in vlc
 */

34
#include <vlc_picture.h>
35
#include <vlc_filter.h>
36
#include <vlc_subpicture.h>
37

38 39 40
/*****************************************************************************
 * Prototypes
 *****************************************************************************/
Clément Stenac's avatar
Clément Stenac committed
41

42
/**
Clément Stenac's avatar
Clément Stenac committed
43 44 45 46 47
 * \defgroup video_output Video Output
 * This module describes the programming interface for video output threads.
 * It includes functions allowing to open a new thread, send pictures to a
 * thread, and destroy a previously opened video output thread.
 * @{
48 49
 */

50 51 52 53 54
/**
 * Vout configuration
 */
typedef struct {
    vout_thread_t        *vout;
55
    vlc_object_t         *input;
Laurent Aimar's avatar
Laurent Aimar committed
56
    bool                 change_fmt;
57
    const video_format_t *fmt;
58
    unsigned             dpb_size;
59 60
} vout_configuration_t;

61
/**
Rémi Denis-Courmont's avatar
Typo  
Rémi Denis-Courmont committed
62
 * Video output thread private structure
63 64 65
 */
typedef struct vout_thread_sys_t vout_thread_sys_t;

66
/**
Clément Stenac's avatar
Clément Stenac committed
67
 * Video output thread descriptor
68
 *
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
69
 * Any independent video output device, such as an X11 window or a GGI device,
Clément Stenac's avatar
Clément Stenac committed
70 71
 * is represented by a video output thread, and described using the following
 * structure.
72
 */
73
struct vout_thread_t {
Clément Stenac's avatar
Clément Stenac committed
74
    VLC_COMMON_MEMBERS
75

76 77
    /* Private vout_thread data */
    vout_thread_sys_t *p;
Clément Stenac's avatar
Clément Stenac committed
78 79 80 81 82 83 84 85 86 87 88 89 90
};

/* Alignment flags */
#define VOUT_ALIGN_LEFT         0x0001
#define VOUT_ALIGN_RIGHT        0x0002
#define VOUT_ALIGN_HMASK        0x0003
#define VOUT_ALIGN_TOP          0x0004
#define VOUT_ALIGN_BOTTOM       0x0008
#define VOUT_ALIGN_VMASK        0x000C

/*****************************************************************************
 * Prototypes
 *****************************************************************************/
91 92

/**
93
 * Returns a suitable vout or release the given one.
94
 *
95 96 97
 * If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout
 * is possible, otherwise it returns NULL.
 * If cfg->vout is not used, it will be closed and released.
98
 *
99 100
 * You can release the returned value either by vout_Request or vout_Close()
 * followed by a vlc_object_release() or shorter vout_CloseAndRelease()
101
 *
102 103 104
 * \param object a vlc object
 * \param cfg the video configuration requested.
 * \return a vout
105
 */
106
VLC_API vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t *cfg );
107
#define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
108 109

/**
110
 * This function will close a vout created by vout_Request.
111 112 113
 * The associated vout module is closed.
 * Note: It is not released yet, you'll have to call vlc_object_release()
 * or use the convenient vout_CloseAndRelease().
114
 *
115
 * \param p_vout the vout to close
116
 */
117
VLC_API void vout_Close( vout_thread_t *p_vout );
118 119 120 121 122 123 124 125 126 127 128 129

/**
 * This function will close a vout created by vout_Create
 * and then release it.
 *
 * \param p_vout the vout to close and release
 */
static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
{
    vout_Close( p_vout );
    vlc_object_release( p_vout );
}
Clément Stenac's avatar
Clément Stenac committed
130

131 132 133 134 135 136 137 138 139 140 141 142
/**
 * This function will handle a snapshot request.
 *
 * pp_image, pp_picture and p_fmt can be NULL otherwise they will be
 * set with returned value in case of success.
 *
 * pp_image will hold an encoded picture in psz_format format.
 *
 * i_timeout specifies the time the function will wait for a snapshot to be
 * available.
 *
 */
143 144 145 146
VLC_API 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 );
147

148 149 150
VLC_API void vout_ChangeAspectRatio( vout_thread_t *p_vout,
                                     unsigned int i_num, unsigned int i_den );

151
/* */
152 153
VLC_API picture_t * vout_GetPicture( vout_thread_t * );
VLC_API void vout_PutPicture( vout_thread_t *, picture_t * );
Laurent Aimar's avatar
Laurent Aimar committed
154

155
/* */
156 157 158
VLC_API void vout_PutSubpicture( vout_thread_t *, subpicture_t * );
VLC_API int vout_RegisterSubpictureChannel( vout_thread_t * );
VLC_API void vout_FlushSubpictureChannel( vout_thread_t *, int );
159

160
VLC_API void vout_EnableFilter( vout_thread_t *, const char *,bool , bool  );
Clément Stenac's avatar
Clément Stenac committed
161

162
/**@}*/
Gildas Bazin's avatar
 
Gildas Bazin committed
163 164

#endif /* _VLC_VIDEO_H */