00001 /***************************************************************************** 00002 * vlc_video.h: common video definitions 00003 ***************************************************************************** 00004 * Copyright (C) 1999 - 2008 the VideoLAN team 00005 * $Id: ad08f3975f9d39d0e8356727b7544cefc8b71da7 $ 00006 * 00007 * Authors: Vincent Seguin <seguin@via.ecp.fr> 00008 * Samuel Hocevar <sam@via.ecp.fr> 00009 * Olivier Aubert <oaubert 47 videolan d07 org> 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00024 *****************************************************************************/ 00025 00026 #ifndef VLC_VOUT_H_ 00027 #define VLC_VOUT_H_ 1 00028 00029 /** 00030 * \file 00031 * This file defines common video output structures and functions in vlc 00032 */ 00033 00034 #include <vlc_picture.h> 00035 #include <vlc_filter.h> 00036 #include <vlc_subpicture.h> 00037 00038 /***************************************************************************** 00039 * Prototypes 00040 *****************************************************************************/ 00041 00042 /** 00043 * \defgroup video_output Video Output 00044 * This module describes the programming interface for video output threads. 00045 * It includes functions allowing to open a new thread, send pictures to a 00046 * thread, and destroy a previously opened video output thread. 00047 * @{ 00048 */ 00049 00050 /** 00051 * Vout configuration 00052 */ 00053 typedef struct { 00054 vout_thread_t *vout; 00055 vlc_object_t *input; 00056 bool change_fmt; 00057 const video_format_t *fmt; 00058 unsigned dpb_size; 00059 } vout_configuration_t; 00060 00061 /** 00062 * Video ouput thread private structure 00063 */ 00064 typedef struct vout_thread_sys_t vout_thread_sys_t; 00065 00066 /** 00067 * Video output thread descriptor 00068 * 00069 * Any independent video output device, such as an X11 window or a GGI device, 00070 * is represented by a video output thread, and described using the following 00071 * structure. 00072 */ 00073 struct vout_thread_t { 00074 VLC_COMMON_MEMBERS 00075 00076 /* Private vout_thread data */ 00077 vout_thread_sys_t *p; 00078 }; 00079 00080 /* Alignment flags */ 00081 #define VOUT_ALIGN_LEFT 0x0001 00082 #define VOUT_ALIGN_RIGHT 0x0002 00083 #define VOUT_ALIGN_HMASK 0x0003 00084 #define VOUT_ALIGN_TOP 0x0004 00085 #define VOUT_ALIGN_BOTTOM 0x0008 00086 #define VOUT_ALIGN_VMASK 0x000C 00087 00088 /***************************************************************************** 00089 * Prototypes 00090 *****************************************************************************/ 00091 00092 /** 00093 * Returns a suitable vout or release the given one. 00094 * 00095 * If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout 00096 * is possible, otherwise it returns NULL. 00097 * If cfg->vout is not used, it will be closed and released. 00098 * 00099 * You can release the returned value either by vout_Request or vout_Close() 00100 * followed by a vlc_object_release() or shorter vout_CloseAndRelease() 00101 * 00102 * \param object a vlc object 00103 * \param cfg the video configuration requested. 00104 * \return a vout 00105 */ 00106 VLC_EXPORT( vout_thread_t *, vout_Request, ( vlc_object_t *object, const vout_configuration_t *cfg ) ); 00107 #define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b) 00108 00109 /** 00110 * This function will close a vout created by vout_Request. 00111 * The associated vout module is closed. 00112 * Note: It is not released yet, you'll have to call vlc_object_release() 00113 * or use the convenient vout_CloseAndRelease(). 00114 * 00115 * \param p_vout the vout to close 00116 */ 00117 VLC_EXPORT( void, vout_Close, ( vout_thread_t *p_vout ) ); 00118 00119 /** 00120 * This function will close a vout created by vout_Create 00121 * and then release it. 00122 * 00123 * \param p_vout the vout to close and release 00124 */ 00125 static inline void vout_CloseAndRelease( vout_thread_t *p_vout ) 00126 { 00127 vout_Close( p_vout ); 00128 vlc_object_release( p_vout ); 00129 } 00130 00131 /** 00132 * This function will handle a snapshot request. 00133 * 00134 * pp_image, pp_picture and p_fmt can be NULL otherwise they will be 00135 * set with returned value in case of success. 00136 * 00137 * pp_image will hold an encoded picture in psz_format format. 00138 * 00139 * i_timeout specifies the time the function will wait for a snapshot to be 00140 * available. 00141 * 00142 */ 00143 VLC_EXPORT( int, vout_GetSnapshot, ( vout_thread_t *p_vout, 00144 block_t **pp_image, picture_t **pp_picture, 00145 video_format_t *p_fmt, 00146 const char *psz_format, mtime_t i_timeout ) ); 00147 00148 /* */ 00149 VLC_EXPORT( picture_t *, vout_GetPicture, ( vout_thread_t * ) ); 00150 VLC_EXPORT( void, vout_PutPicture, ( vout_thread_t *, picture_t * ) ); 00151 00152 VLC_EXPORT( void, vout_HoldPicture, ( vout_thread_t *, picture_t * ) ); 00153 VLC_EXPORT( void, vout_ReleasePicture, ( vout_thread_t *, picture_t * ) ); 00154 00155 /* */ 00156 VLC_EXPORT( void, vout_PutSubpicture, ( vout_thread_t *, subpicture_t * ) ); 00157 VLC_EXPORT( int, vout_RegisterSubpictureChannel, ( vout_thread_t * ) ); 00158 VLC_EXPORT( void, vout_FlushSubpictureChannel, ( vout_thread_t *, int ) ); 00159 00160 VLC_EXPORT( void, vout_EnableFilter, ( vout_thread_t *, const char *,bool , bool ) ); 00161 00162 /**@}*/ 00163 00164 #endif /* _VLC_VIDEO_H */
1.5.6