vout.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vout.h: Windows video output header file
00003  *****************************************************************************
00004  * Copyright (C) 2001-2004 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Gildas Bazin <gbazin@videolan.org>
00008  *          Damien Fouilleul <damienf@videolan.org>
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 /*****************************************************************************
00026  * event_thread_t: event thread
00027  *****************************************************************************/
00028 typedef struct event_thread_t
00029 {
00030     VLC_COMMON_MEMBERS
00031 
00032     vout_thread_t * p_vout;
00033 
00034 } event_thread_t;
00035 
00036 /*****************************************************************************
00037  * vout_sys_t: video output method descriptor
00038  *****************************************************************************
00039  * This structure is part of the video output thread descriptor.
00040  * It describes the module specific properties of an output thread.
00041  *****************************************************************************/
00042 struct vout_sys_t
00043 {
00044     HWND                 hwnd;                  /* Handle of the main window */
00045     HWND                 hvideownd;        /* Handle of the video sub-window */
00046     HWND                 hparent;             /* Handle of the parent window */
00047     HWND                 hfswnd;          /* Handle of the fullscreen window */
00048     WNDPROC              pf_wndproc;             /* Window handling callback */
00049 
00050     /* Multi-monitor support */
00051     HMONITOR             hmonitor;          /* handle of the current monitor */
00052     GUID                 *p_display_driver;
00053     HMONITOR             (WINAPI* MonitorFromWindow)( HWND, DWORD );
00054     BOOL                 (WINAPI* GetMonitorInfo)( HMONITOR, LPMONITORINFO );
00055 
00056     /* size of the display */
00057     RECT         rect_display;
00058     int          i_display_depth;
00059 
00060     /* size of the overall window (including black bands) */
00061     RECT         rect_parent;
00062 
00063     /* Window position and size */
00064     int          i_window_x;
00065     int          i_window_y;
00066     int          i_window_width;
00067     int          i_window_height;
00068     int          i_window_style;
00069 
00070     volatile uint16_t i_changes;        /* changes made to the video display */
00071 
00072     /* Mouse */
00073     volatile bool b_cursor_hidden;
00074     volatile mtime_t    i_lastmoved;
00075     mtime_t             i_mouse_hide_timeout;
00076 
00077     /* Misc */
00078     bool      b_on_top_change;
00079 
00080 #ifndef UNDER_CE
00081 
00082     /* screensaver system settings to be restored when vout is closed */
00083     UINT i_spi_lowpowertimeout;
00084     UINT i_spi_powerofftimeout;
00085     UINT i_spi_screensavetimeout;
00086 
00087 #endif
00088 
00089     /* Coordinates of src and dest images (used when blitting to display) */
00090     RECT         rect_src;
00091     RECT         rect_src_clipped;
00092     RECT         rect_dest;
00093     RECT         rect_dest_clipped;
00094 
00095     bool   b_hw_yuv;    /* Should we use hardware YUV->RGB conversions */
00096 
00097 
00098 #ifdef MODULE_NAME_IS_vout_directx
00099     /* Overlay alignment restrictions */
00100     int          i_align_src_boundary;
00101     int          i_align_src_size;
00102     int          i_align_dest_boundary;
00103     int          i_align_dest_size;
00104 
00105     bool      b_wallpaper;    /* show as desktop wallpaper ? */
00106 
00107     bool   b_using_overlay;         /* Are we using an overlay surface */
00108     bool   b_use_sysmem;   /* Should we use system memory for surfaces */
00109     bool   b_3buf_overlay;   /* Should we use triple buffered overlays */
00110 
00111     /* DDraw capabilities */
00112     int          b_caps_overlay_clipping;
00113 
00114     int          i_rgb_colorkey;      /* colorkey in RGB used by the overlay */
00115     int          i_colorkey;                 /* colorkey used by the overlay */
00116 
00117     COLORREF        color_bkg;
00118     COLORREF        color_bkgtxt;
00119 
00120     LPDIRECTDRAW2        p_ddobject;                    /* DirectDraw object */
00121     LPDIRECTDRAWSURFACE2 p_display;                        /* Display device */
00122     LPDIRECTDRAWSURFACE2 p_current_surface;   /* surface currently displayed */
00123     LPDIRECTDRAWCLIPPER  p_clipper;             /* clipper used for blitting */
00124     HINSTANCE            hddraw_dll;       /* handle of the opened ddraw dll */
00125 #endif
00126 
00127 #ifdef MODULE_NAME_IS_glwin32
00128     HDC hGLDC;
00129     HGLRC hGLRC;
00130 #endif
00131 
00132 #ifdef MODULE_NAME_IS_direct3d
00133     // core objects
00134     HINSTANCE               hd3d9_dll;       /* handle of the opened d3d9 dll */
00135     LPDIRECT3D9             p_d3dobj;
00136     LPDIRECT3DDEVICE9       p_d3ddev;
00137     D3DFORMAT               bbFormat;
00138     // scene objects
00139     LPDIRECT3DTEXTURE9      p_d3dtex;
00140     LPDIRECT3DVERTEXBUFFER9 p_d3dvtc;
00141 #endif
00142 
00143 #ifdef MODULE_NAME_IS_wingdi
00144 
00145     int  i_depth;
00146 
00147     /* Our offscreen bitmap and its framebuffer */
00148     HDC        off_dc;
00149     HBITMAP    off_bitmap;
00150     uint8_t *  p_pic_buffer;
00151     int        i_pic_pitch;
00152     int        i_pic_pixel_pitch;
00153 
00154     BITMAPINFO bitmapinfo;
00155     RGBQUAD    red;
00156     RGBQUAD    green;
00157     RGBQUAD    blue;
00158 #endif
00159 
00160 #ifdef MODULE_NAME_IS_wingapi
00161     int        i_depth;
00162     int        render_width;
00163     int        render_height;
00164 
00165     bool b_focus;
00166     bool b_parent_focus;
00167 
00168     HINSTANCE  gapi_dll;                    /* handle of the opened gapi dll */
00169 
00170     /* GAPI functions */
00171     int (*GXOpenDisplay)( HWND hWnd, DWORD dwFlags );
00172     int (*GXCloseDisplay)();
00173     void *(*GXBeginDraw)();
00174     int (*GXEndDraw)();
00175     GXDisplayProperties (*GXGetDisplayProperties)();
00176     int (*GXSuspend)();
00177     int (*GXResume)();
00178 #endif
00179 
00180 #ifndef UNDER_CE
00181     /* suspend display */
00182     bool   b_suspend_display;
00183 #endif
00184 
00185     event_thread_t *p_event;
00186     vlc_mutex_t    lock;
00187 };
00188 
00189 /*****************************************************************************
00190  * Prototypes from directx.c
00191  *****************************************************************************/
00192 int DirectDrawUpdateOverlay( vout_thread_t *p_vout );
00193 
00194 /*****************************************************************************
00195  * Prototypes from events.c
00196  *****************************************************************************/
00197 void* EventThread ( vlc_object_t *p_this );
00198 void UpdateRects ( vout_thread_t *p_vout, bool b_force );
00199 void Win32ToggleFullscreen ( vout_thread_t *p_vout );
00200 
00201 /*****************************************************************************
00202  * Constants
00203  *****************************************************************************/
00204 #define WM_VLC_HIDE_MOUSE WM_APP
00205 #define WM_VLC_SHOW_MOUSE WM_APP + 1
00206 #define WM_VLC_CHANGE_TEXT WM_APP + 2
00207 #define IDM_TOGGLE_ON_TOP WM_USER + 1
00208 #define DX_POSITION_CHANGE 0x1000
00209 #define DX_WALLPAPER_CHANGE 0x2000
00210 
00211 /*****************************************************************************
00212  * WinCE helpers
00213  *****************************************************************************/
00214 #ifdef UNDER_CE
00215 
00216 #define AdjustWindowRect(a,b,c)
00217 
00218 #ifndef GCL_HBRBACKGROUND
00219 #   define GCL_HBRBACKGROUND (-10)
00220 #endif
00221 
00222 #define FindWindowEx(a,b,c,d) 0
00223 
00224 #define GetWindowPlacement(a,b)
00225 #define SetWindowPlacement(a,b)
00226 typedef struct _WINDOWPLACEMENT {
00227     UINT length;
00228     UINT flags;
00229     UINT showCmd;
00230     POINT ptMinPosition;
00231     POINT ptMaxPosition;
00232     RECT rcNormalPosition;
00233 } WINDOWPLACEMENT;
00234 
00235 #ifndef WM_NCMOUSEMOVE
00236 #   define WM_NCMOUSEMOVE 160
00237 #endif
00238 #ifndef CS_OWNDC
00239 #   define CS_OWNDC 32
00240 #endif
00241 #ifndef SC_SCREENSAVE
00242 #   define SC_SCREENSAVE 0xF140
00243 #endif
00244 #ifndef SC_MONITORPOWER
00245 #   define SC_MONITORPOWER 0xF170
00246 #endif
00247 #ifndef WM_NCPAINT
00248 #   define WM_NCPAINT 133
00249 #endif
00250 #ifndef WS_OVERLAPPEDWINDOW
00251 #   define WS_OVERLAPPEDWINDOW 0xcf0000
00252 #endif
00253 #ifndef WS_EX_NOPARENTNOTIFY
00254 #   define WS_EX_NOPARENTNOTIFY 4
00255 #endif
00256 #ifndef WS_EX_APPWINDOW
00257 #define WS_EX_APPWINDOW 0x40000
00258 #endif
00259 
00260 #define SetWindowLongPtr SetWindowLong
00261 #define GetWindowLongPtr GetWindowLong
00262 #define GWLP_USERDATA GWL_USERDATA
00263 
00264 #endif //UNDER_CE

Generated on Wed Aug 13 08:02:37 2008 for VLC by  doxygen 1.5.1