Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

video_output.h

00001 /*****************************************************************************
00002  * video_output.h : video output thread
00003  *****************************************************************************
00004  * Copyright (C) 1999, 2000 the VideoLAN team
00005  * $Id: video_output.h 13051 2005-10-31 07:35:39Z md $
00006  *
00007  * Authors: Vincent Seguin <[email protected]>
00008  *          Samuel Hocevar <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00042 typedef void (vout_chroma_convert_t)( vout_thread_t *,
00043                                       picture_t *, picture_t * );
00044 
00045 typedef struct vout_chroma_t
00046 {
00048     vout_chroma_convert_t *pf_convert;
00049 
00051     chroma_sys_t *      p_sys;                               /* private data */
00052 
00054     module_t * p_module;
00055 
00056 } vout_chroma_t;
00057 
00065 struct vout_thread_t
00066 {
00067     VLC_COMMON_MEMBERS
00068 
00071     vlc_mutex_t         picture_lock;                 
00072     vlc_mutex_t         subpicture_lock;           
00073     vlc_mutex_t         change_lock;                 
00074     vout_sys_t *        p_sys;                     
00079     uint16_t            i_changes;          
00081     float               f_gamma;                                  
00082     vlc_bool_t          b_grayscale;         
00083     vlc_bool_t          b_info;            
00084     vlc_bool_t          b_interface;                   
00085     vlc_bool_t          b_scale;                  
00086     vlc_bool_t          b_fullscreen;         
00087     uint32_t            render_time;           
00088     unsigned int        i_window_width;              
00089     unsigned int        i_window_height;            
00090     unsigned int        i_alignment;          
00091     unsigned int        i_par_num;           
00092     unsigned int        i_par_den;           
00094     intf_thread_t       *p_parent_intf;   
00100     module_t *   p_module;
00101     int       ( *pf_init )       ( vout_thread_t * );
00102     void      ( *pf_end )        ( vout_thread_t * );
00103     int       ( *pf_manage )     ( vout_thread_t * );
00104     void      ( *pf_render )     ( vout_thread_t *, picture_t * );
00105     void      ( *pf_display )    ( vout_thread_t *, picture_t * );
00106     void      ( *pf_swap )       ( vout_thread_t * );         /* OpenGL only */
00107     int       ( *pf_lock )       ( vout_thread_t * );         /* OpenGL only */
00108     void      ( *pf_unlock )     ( vout_thread_t * );         /* OpenGL only */
00109     int       ( *pf_control )    ( vout_thread_t *, int, va_list );
00116     count_t       c_fps_samples;                         
00117     mtime_t       p_fps_sample[VOUT_FPS_SAMPLES];     
00122     int                 i_heap_size;                          
00123     picture_heap_t      render;                       
00124     picture_heap_t      output;                          
00125     vlc_bool_t          b_direct;            
00126     vout_chroma_t       chroma;                      
00128     video_format_t      fmt_render;      /* render format (from the decoder) */
00129     video_format_t      fmt_in;            /* input (modified render) format */
00130     video_format_t      fmt_out;     /* output format (for the video output) */
00133     /* Picture heap */
00134     picture_t           p_picture[2*VOUT_MAX_PICTURES+1];      
00136     /* Subpicture unit */
00137     spu_t            *p_spu;
00138 
00139     /* Statistics */
00140     count_t          c_loops;
00141     count_t          c_pictures, c_late_pictures;
00142     mtime_t          display_jitter;    
00143     count_t          c_jitter_samples;  
00147     int                 i_pts_delay;
00148 
00149     /* Filter chain */
00150     char *psz_filter_chain;
00151     vlc_bool_t b_filter_change;
00152 
00153     /* Misc */
00154     vlc_bool_t       b_snapshot;     
00155 };
00156 
00157 #define I_OUTPUTPICTURES p_vout->output.i_pictures
00158 #define PP_OUTPUTPICTURE p_vout->output.pp_picture
00159 #define I_RENDERPICTURES p_vout->render.i_pictures
00160 #define PP_RENDERPICTURE p_vout->render.pp_picture
00161 
00168 #define VOUT_INFO_CHANGE        0x0001
00169 
00170 #define VOUT_GRAYSCALE_CHANGE   0x0002
00171 
00172 #define VOUT_INTF_CHANGE        0x0004
00173 
00174 #define VOUT_SCALE_CHANGE       0x0008
00175 
00176 #define VOUT_GAMMA_CHANGE       0x0010
00177 
00178 #define VOUT_CURSOR_CHANGE      0x0020
00179 
00180 #define VOUT_FULLSCREEN_CHANGE  0x0040
00181 
00182 #define VOUT_SIZE_CHANGE        0x0200
00183 
00184 #define VOUT_DEPTH_CHANGE       0x0400
00185 
00186 #define VOUT_CHROMA_CHANGE      0x0800
00187 
00188 #define VOUT_CROP_CHANGE        0x1000
00189 
00190 #define VOUT_ASPECT_CHANGE      0x2000
00191 
00192 #define VOUT_PICTURE_BUFFERS_CHANGE 0x4000
00193 
00195 /* Alignment flags */
00196 #define VOUT_ALIGN_LEFT         0x0001
00197 #define VOUT_ALIGN_RIGHT        0x0002
00198 #define VOUT_ALIGN_HMASK        0x0003
00199 #define VOUT_ALIGN_TOP          0x0004
00200 #define VOUT_ALIGN_BOTTOM       0x0008
00201 #define VOUT_ALIGN_VMASK        0x000C
00202 
00203 #define MAX_JITTER_SAMPLES      20
00204 
00205 /*****************************************************************************
00206  * Prototypes
00207  *****************************************************************************/
00208 #define vout_Request(a,b,c) __vout_Request(VLC_OBJECT(a),b,c)
00209 VLC_EXPORT( vout_thread_t *, __vout_Request,    ( vlc_object_t *, vout_thread_t *, video_format_t * ) );
00210 #define vout_Create(a,b) __vout_Create(VLC_OBJECT(a),b)
00211 VLC_EXPORT( vout_thread_t *, __vout_Create,       ( vlc_object_t *, video_format_t * ) );
00212 VLC_EXPORT( void,            vout_Destroy,        ( vout_thread_t * ) );
00213 VLC_EXPORT( int, vout_VarCallback, ( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * ) );
00214 
00215 VLC_EXPORT( int,             vout_ChromaCmp,      ( uint32_t, uint32_t ) );
00216 
00217 VLC_EXPORT( picture_t *,     vout_CreatePicture,  ( vout_thread_t *, vlc_bool_t, vlc_bool_t, unsigned int ) );
00218 VLC_EXPORT( void,            vout_InitFormat,     ( video_frame_format_t *, uint32_t, int, int, int ) );
00219 VLC_EXPORT( void,            vout_DestroyPicture, ( vout_thread_t *, picture_t * ) );
00220 VLC_EXPORT( void,            vout_DisplayPicture, ( vout_thread_t *, picture_t * ) );
00221 VLC_EXPORT( void,            vout_DatePicture,    ( vout_thread_t *, picture_t *, mtime_t ) );
00222 VLC_EXPORT( void,            vout_LinkPicture,    ( vout_thread_t *, picture_t * ) );
00223 VLC_EXPORT( void,            vout_UnlinkPicture,  ( vout_thread_t *, picture_t * ) );
00224 VLC_EXPORT( void,            vout_PlacePicture,   ( vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int * ) );
00225 picture_t *     vout_RenderPicture  ( vout_thread_t *, picture_t *,
00226                                                        subpicture_t * );
00227 
00228 VLC_EXPORT( int, vout_vaControlDefault, ( vout_thread_t *, int, va_list ) );
00229 VLC_EXPORT( void *, vout_RequestWindow, ( vout_thread_t *, int *, int *, unsigned int *, unsigned int * ) );
00230 VLC_EXPORT( void,   vout_ReleaseWindow, ( vout_thread_t *, void * ) );
00231 VLC_EXPORT( int, vout_ControlWindow, ( vout_thread_t *, void *, int, va_list ) );
00232 void vout_IntfInit( vout_thread_t * );
00233 
00234 
00235 static inline int vout_vaControl( vout_thread_t *p_vout, int i_query,
00236                                   va_list args )
00237 {
00238     if( p_vout->pf_control )
00239         return p_vout->pf_control( p_vout, i_query, args );
00240     else
00241         return VLC_EGENERIC;
00242 }
00243 
00244 static inline int vout_Control( vout_thread_t *p_vout, int i_query, ... )
00245 {
00246     va_list args;
00247     int i_result;
00248 
00249     va_start( args, i_query );
00250     i_result = vout_vaControl( p_vout, i_query, args );
00251     va_end( args );
00252     return i_result;
00253 }
00254 
00255 enum output_query_e
00256 {
00257     VOUT_SET_ZOOM,
00258     VOUT_SET_STAY_ON_TOP,  /* arg1= vlc_bool_t       res=    */
00259     VOUT_REPARENT,
00260     VOUT_SNAPSHOT,
00261     VOUT_CLOSE,
00262     VOUT_SET_FOCUS         /* arg1= vlc_bool_t       res=    */
00263 };
00264 

Generated on Tue Dec 20 10:14:19 2005 for vlc-0.8.4a by  doxygen 1.4.2