]> git.sesse.net Git - vlc/blob - plugins/directx/vout_directx.h
e4dea6833134ca432c3c48fc9da886f694a95633
[vlc] / plugins / directx / vout_directx.h
1 /*****************************************************************************
2  * vout_directx.h: Windows DirectX video output header file
3  *****************************************************************************
4  * Copyright (C) 1998, 1999, 2000 VideoLAN
5  * $Id: vout_directx.h,v 1.8 2002/06/01 16:45:34 sam Exp $
6  *
7  * Authors: Gildas Bazin <gbazin@netcourrier.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * event_thread_t: DirectX event thread
26  *****************************************************************************/
27 typedef struct event_thread_s
28 {
29     VLC_COMMON_MEMBERS
30
31     vout_thread_t * p_vout;
32
33 } event_thread_t;
34
35 /*****************************************************************************
36  * vout_sys_t: video output DirectX method descriptor
37  *****************************************************************************
38  * This structure is part of the video output thread descriptor.
39  * It describes the DirectX specific properties of an output thread.
40  *****************************************************************************/
41 struct vout_sys_s
42 {
43     LPDIRECTDRAW2        p_ddobject;                    /* DirectDraw object */
44     LPDIRECTDRAWSURFACE3 p_display;                        /* Display device */
45     LPDIRECTDRAWSURFACE3 p_current_surface;   /* surface currently displayed */
46     LPDIRECTDRAWCLIPPER  p_clipper;             /* clipper used for blitting */
47     HINSTANCE            hddraw_dll;       /* handle of the opened ddraw dll */
48     HBRUSH               hbrush;           /* window backgound brush (color) */
49     HWND                 hwnd;                  /* Handle of the main window */
50
51     vlc_bool_t   b_using_overlay;         /* Are we using an overlay surface */
52     vlc_bool_t   b_use_sysmem;   /* Should we use system memory for surfaces */
53     vlc_bool_t   b_hw_yuv;    /* Should we use hardware YUV->RGB conversions */
54
55     /* size of the display */
56     RECT         rect_display;
57     int          i_display_depth;
58
59     /* Window position and size */
60     int          i_window_x;
61     int          i_window_y;
62     int          i_window_width;
63     int          i_window_height;
64
65     /* Coordinates of src and dest images (used when blitting to display) */
66     RECT         rect_src;
67     RECT         rect_src_clipped;
68     RECT         rect_dest;
69     RECT         rect_dest_clipped;
70
71     /* DDraw capabilities */
72     int          b_caps_overlay_clipping;
73
74     int          i_rgb_colorkey;      /* colorkey in RGB used by the overlay */
75     int          i_colorkey;                 /* colorkey used by the overlay */
76  
77     volatile u16 i_changes;             /* changes made to the video display */
78
79     /* Mouse */
80     volatile vlc_bool_t b_cursor_hidden;
81     volatile mtime_t    i_lastmoved;
82
83     event_thread_t *    p_event;
84
85     volatile int i_event_thread_status;         /* DirectXEventThread status */
86     volatile vlc_bool_t b_event_thread_die; /* flag to kill the event thread */
87 };
88
89 /*****************************************************************************
90  * picture_sys_t: direct buffer method descriptor
91  *****************************************************************************
92  * This structure is part of the picture descriptor, it describes the
93  * DirectX specific properties of a direct buffer.
94  *****************************************************************************/
95 struct picture_sys_s
96 {
97     LPDIRECTDRAWSURFACE3 p_surface;
98     DDSURFACEDESC        ddsd;
99     LPDIRECTDRAWSURFACE3 p_front_surface;
100 };
101
102 /*****************************************************************************
103  * Prototypes from vout_directx.c
104  *****************************************************************************/
105
106 /*****************************************************************************
107  * Prototypes from vout_events.c
108  *****************************************************************************/
109 void DirectXEventThread ( event_thread_t *p_event );
110 void DirectXUpdateOverlay( vout_thread_t *p_vout );
111
112 /*****************************************************************************
113  * Constants
114  *****************************************************************************/
115 #define WM_VLC_HIDE_MOUSE WM_APP