Mercurial > mplayer.hg
annotate libvo/vo_winvidix.c @ 36962:6bb8d4f4a7b0
Add missing #include.
author | ib |
---|---|
date | Mon, 24 Mar 2014 11:09:39 +0000 |
parents | 5d3f93051de9 |
children |
rev | line source |
---|---|
10979 | 1 /* |
28446
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
2 * VIDIX-accelerated overlay in a Win32 window |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
3 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
4 * copyright (C) 2003 Sascha Sommer |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
5 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
6 * This file is part of MPlayer. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
7 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
11 * (at your option) any later version. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
12 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
16 * GNU General Public License for more details. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
17 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
18 * You should have received a copy of the GNU General Public License along |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
19 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28051
diff
changeset
|
21 */ |
10979 | 22 |
23 #include <stdio.h> | |
24 #include <stdlib.h> | |
25 #include <string.h> | |
26 #include <math.h> | |
27 #include <errno.h> | |
28 | |
29 #include "config.h" | |
30 #include "video_out.h" | |
36517 | 31 #define NO_DRAW_FRAME |
10979 | 32 #include "video_out_internal.h" |
33 | |
34 #include <windows.h> | |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
12861
diff
changeset
|
35 #include "osdep/keycodes.h" |
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
12861
diff
changeset
|
36 #include "input/input.h" |
10979 | 37 |
38 #include "aspect.h" | |
39 #include "mp_msg.h" | |
22823
98eaf29b5dee
Code cleanup: don't include a .c file in mplayer.c and fix a few
rathann
parents:
16892
diff
changeset
|
40 #include "mp_fifo.h" |
10979 | 41 |
42 #include "vosub_vidix.h" | |
27079 | 43 #include "vidix/vidix.h" |
10979 | 44 |
45 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
46 static const vo_info_t info = |
10979 | 47 { |
48 "WIN32 (VIDIX)", | |
49 "winvidix", | |
50 "Sascha Sommer", | |
51 "" | |
52 }; | |
53 | |
54 LIBVO_EXTERN(winvidix) | |
55 | |
56 /* VIDIX related */ | |
57 static char *vidix_name; | |
58 | |
59 /* Image parameters */ | |
60 static uint32_t image_width; | |
61 static uint32_t image_height; | |
62 static uint32_t image_format; | |
63 /* Window parameters */ | |
64 static HWND hWnd=NULL,hWndFS=NULL; | |
15822
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
65 static float window_aspect; |
10979 | 66 |
67 static vidix_grkey_t gr_key; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
68 |
10979 | 69 |
28051 | 70 void set_video_eq(int cap); |
10979 | 71 |
72 | |
73 static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |
74 { | |
75 switch (message){ | |
76 case WM_DESTROY: | |
15822
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
77 PostQuitMessage(0); |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
78 return 0; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
79 case WM_CLOSE: |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16280
diff
changeset
|
80 mplayer_put_key(KEY_CLOSE_WIN); |
10979 | 81 break; |
82 case WM_WINDOWPOSCHANGED: | |
83 { | |
15822
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
84 int tmpheight=0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
85 /*calculate new window rect*/ |
10979 | 86 if(!vo_fs){ |
87 RECT rd; | |
88 POINT point_window; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
89 if(!hWnd)hWnd=hwnd; |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
90 ShowCursor(TRUE); |
10979 | 91 point_window.x = 0; |
92 point_window.y = 0; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
93 ClientToScreen(hWnd,&point_window); |
10979 | 94 GetClientRect(hWnd,&rd); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
95 |
10979 | 96 vo_dwidth=rd.right - rd.left; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
97 vo_dheight=rd.bottom - rd.top; |
10979 | 98 vo_dx =point_window.x; |
99 vo_dy =point_window.y; | |
100 // aspect(&vo_dwidth, &vo_dheight, A_NOZOOM); | |
15822
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
101 |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
102 /* keep aspect on resize, borrowed from vo_directx.c */ |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
103 tmpheight = ((float)vo_dwidth/window_aspect); |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
104 tmpheight += tmpheight % 2; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
105 if(tmpheight > vo_dheight) |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
106 { |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
107 vo_dwidth = ((float)vo_dheight*window_aspect); |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
108 vo_dwidth += vo_dwidth % 2; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
109 } |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
110 else vo_dheight = tmpheight; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
111 rd.right = rd.left + vo_dwidth; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
112 rd.bottom = rd.top + vo_dheight; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
113 |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
114 if(rd.left < 0) rd.left = 0; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
115 if(rd.right > vo_screenwidth) rd.right = vo_screenwidth; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
116 if(rd.top < 0) rd.top = 0; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
117 if(rd.bottom > vo_screenheight) rd.bottom = vo_screenheight; |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
118 |
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
119 AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 0); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
120 SetWindowPos(hWnd, HWND_TOPMOST, vo_dx+rd.left, vo_dy+rd.top, rd.right-rd.left, rd.bottom-rd.top, SWP_NOOWNERZORDER); |
10979 | 121 } |
122 else { | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
123 if(ShowCursor(FALSE)>=0)while(ShowCursor(FALSE)>=0){} |
10979 | 124 aspect(&vo_dwidth, &vo_dheight, A_ZOOM); |
125 vo_dx = (vo_screenwidth - vo_dwidth)/2; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
126 vo_dy = (vo_screenheight - vo_dheight)/2; |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
127 } |
10979 | 128 /*update vidix*/ |
129 /* FIXME: implement runtime resize/move if possible, this way is very ugly! */ | |
130 vidix_stop(); | |
131 if(vidix_init(image_width, image_height, vo_dx, vo_dy, vo_dwidth, vo_dheight, image_format, vo_depthonscreen, vo_screenwidth, vo_screenheight) != 0) | |
132 mp_msg(MSGT_VO, MSGL_FATAL, "Can't initialize VIDIX driver: %s\n", strerror(errno)); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
133 /*set colorkey*/ |
10979 | 134 vidix_start(); |
135 mp_msg(MSGT_VO, MSGL_V, "[winvidix] window properties: pos: %dx%d, size: %dx%d\n",vo_dx, vo_dy, vo_dwidth, vo_dheight); | |
136 if(vidix_grkey_support()){ | |
137 vidix_grkey_get(&gr_key); | |
138 gr_key.key_op = KEYS_PUT; | |
139 gr_key.ckey.op = CKEY_TRUE; | |
140 if(vo_fs)gr_key.ckey.red = gr_key.ckey.green = gr_key.ckey.blue = 0; | |
141 else { | |
142 gr_key.ckey.red = gr_key.ckey.blue = 255; | |
143 gr_key.ckey.green = 0; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
144 } |
10979 | 145 vidix_grkey_set(&gr_key); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
146 } |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
147 |
10979 | 148 } |
149 break; | |
150 case WM_SYSCOMMAND: | |
151 switch (wParam){ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
152 case SC_SCREENSAVE: |
10979 | 153 case SC_MONITORPOWER: |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
154 return 0; |
10979 | 155 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
156 break; |
10979 | 157 case WM_KEYDOWN: |
158 switch (wParam){ | |
159 case VK_LEFT: | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
160 {mplayer_put_key(KEY_LEFT);break;} |
10979 | 161 case VK_UP: |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
162 {mplayer_put_key(KEY_UP);break;} |
10979 | 163 case VK_RIGHT: |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
164 {mplayer_put_key(KEY_RIGHT);break;} |
10979 | 165 case VK_DOWN: |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
166 {mplayer_put_key(KEY_DOWN);break;} |
10979 | 167 case VK_TAB: |
168 {mplayer_put_key(KEY_TAB);break;} | |
169 case VK_CONTROL: | |
170 {mplayer_put_key(KEY_CTRL);break;} | |
171 case VK_DELETE: | |
172 {mplayer_put_key(KEY_DELETE);break;} | |
173 case VK_INSERT: | |
174 {mplayer_put_key(KEY_INSERT);break;} | |
175 case VK_HOME: | |
176 {mplayer_put_key(KEY_HOME);break;} | |
177 case VK_END: | |
178 {mplayer_put_key(KEY_END);break;} | |
179 case VK_PRIOR: | |
180 {mplayer_put_key(KEY_PAGE_UP);break;} | |
181 case VK_NEXT: | |
182 {mplayer_put_key(KEY_PAGE_DOWN);break;} | |
183 case VK_ESCAPE: | |
184 {mplayer_put_key(KEY_ESC);break;} | |
185 } | |
186 break; | |
187 case WM_CHAR: | |
188 mplayer_put_key(wParam); | |
189 break; | |
190 } | |
191 return DefWindowProc(hwnd, message, wParam, lParam); | |
192 } | |
193 | |
194 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
195 static int config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, uint32_t flags, char *title, uint32_t format){ |
10979 | 196 title = "MPlayer VIDIX WIN32 Overlay"; |
197 | |
198 panscan_init(); | |
199 | |
200 image_height = height; | |
201 image_width = width; | |
202 image_format = format; | |
203 vo_screenwidth = GetSystemMetrics(SM_CXSCREEN); | |
204 vo_screenheight = GetSystemMetrics(SM_CYSCREEN); | |
205 vo_depthonscreen = GetDeviceCaps(GetDC(GetDesktopWindow()),BITSPIXEL); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
206 |
10979 | 207 |
208 aspect_save_orig(width, height); | |
209 aspect_save_prescale(d_width, d_height); | |
210 aspect_save_screenres(vo_screenwidth, vo_screenheight); | |
211 | |
212 vo_dx = 0; | |
213 vo_dy = 0; | |
214 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
215 vo_dx=( vo_screenwidth - d_width ) / 2; vo_dy=( vo_screenheight - d_height ) / 2; |
10979 | 216 geometry(&vo_dx, &vo_dy, &d_width, &d_height, vo_screenwidth, vo_screenheight); |
217 | |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
13787
diff
changeset
|
218 vo_fs = flags&VOFLAG_FULLSCREEN; |
10979 | 219 |
220 | |
221 aspect(&d_width, &d_height, A_NOZOOM); | |
222 vo_dwidth=d_width; vo_dheight=d_height; | |
15822
0651bf280391
keep aspect when resizing, quit MPlayer when closing the window patch by Erik Lunchpail <erik_27can at yahoo.com>
faust3
parents:
15621
diff
changeset
|
223 window_aspect = (float)d_width / (float)d_height; |
10979 | 224 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
225 |
10979 | 226 if(!vo_config_count){ |
227 HINSTANCE hInstance = GetModuleHandle(NULL); | |
228 WNDCLASS wc; | |
229 RECT rd; | |
230 rd.left = vo_dx; | |
231 rd.top = vo_dy; | |
232 rd.right = rd.left + vo_dwidth; | |
233 rd.bottom = rd.top + vo_dheight; | |
234 AdjustWindowRect(&rd,WS_OVERLAPPEDWINDOW| WS_SIZEBOX,0); | |
235 wc.style = CS_HREDRAW | CS_VREDRAW; | |
236 wc.lpfnWndProc = WndProc; | |
237 wc.cbClsExtra = 0; | |
238 wc.cbWndExtra = 0; | |
239 wc.hInstance = hInstance; | |
240 wc.hCursor = LoadCursor(NULL,IDC_ARROW); | |
241 wc.hIcon =ExtractIcon(hInstance,"mplayer.exe",0); | |
242 //LoadIcon(NULL,IDI_APPLICATION); | |
243 wc.hbrBackground = CreateSolidBrush(RGB(255,0,255)); | |
12858 | 244 wc.lpszClassName = "MPlayer - The Movie Player"; |
10979 | 245 wc.lpszMenuName = NULL; |
246 RegisterClass(&wc); | |
12861 | 247 hWnd = CreateWindow("MPlayer - The Movie Player", |
10979 | 248 title, |
249 WS_OVERLAPPEDWINDOW| WS_SIZEBOX, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
250 rd.left, |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
251 rd.top, |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
252 rd.right - rd.left, |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
253 rd.bottom - rd.top, |
10979 | 254 NULL, |
255 NULL, | |
256 hInstance, | |
257 NULL); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
258 wc.hbrBackground = CreateSolidBrush(RGB(0,0,0)); |
10979 | 259 wc.lpszClassName = "MPlayer - Fullscreen"; |
260 RegisterClass(&wc); | |
261 hWndFS = CreateWindow("MPlayer - Fullscreen","MPlayer VIDIX Fullscreen",WS_POPUP,0,0,vo_screenwidth,vo_screenheight,hWnd,NULL,hInstance,NULL); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
262 |
10979 | 263 |
264 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
265 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
266 |
10979 | 267 } |
268 ShowWindow(hWnd,SW_SHOW); | |
269 if(vo_fs)ShowWindow(hWndFS,SW_SHOW); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
270 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
271 return 0; |
10979 | 272 } |
273 | |
274 static void check_events(void){ | |
275 MSG msg; | |
276 while (PeekMessage(&msg, NULL, 0, 0,PM_REMOVE)) | |
277 { | |
278 TranslateMessage(&msg); | |
279 DispatchMessage(&msg); | |
280 } | |
281 } | |
282 | |
36517 | 283 /* draw_osd, flip_page, draw_slice should be |
10979 | 284 overwritten with vidix functions (vosub_vidix.c) */ |
285 static void draw_osd(void){ | |
286 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix draw_osd!\n"); | |
287 return; | |
288 } | |
289 | |
290 static void flip_page(void){ | |
291 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix flip_page!\n"); | |
292 return; | |
293 } | |
294 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
295 static int draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int y){ |
10979 | 296 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix draw_slice!\n"); |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
297 return -1; |
10979 | 298 } |
299 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
300 static int query_format(uint32_t format){ |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
301 return vidix_query_fourcc(format); |
10979 | 302 } |
303 | |
304 static void uninit(void){ | |
305 DestroyWindow(hWndFS); | |
306 DestroyWindow(hWnd); | |
307 if ( !vo_config_count ) return; | |
308 vidix_term(); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
309 |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32336
diff
changeset
|
310 free(vidix_name); |
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32336
diff
changeset
|
311 vidix_name = NULL; |
10979 | 312 } |
313 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
314 static int preinit(const char *arg){ |
10979 | 315 if (arg) |
316 vidix_name = strdup(arg); | |
317 else | |
318 { | |
11462 | 319 mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available ones (-v option for details)!\n"); |
10979 | 320 vidix_name = NULL; |
321 } | |
322 | |
323 if (vidix_preinit(vidix_name, &video_out_winvidix) != 0) | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
324 return 1; |
10979 | 325 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
326 return 0; |
10979 | 327 } |
328 | |
33305
ddb45e9443ec
Remove the variable arguments from the libvo control() functions.
iive
parents:
33301
diff
changeset
|
329 static int control(uint32_t request, void *data){ |
10979 | 330 switch (request) { |
331 case VOCTRL_FULLSCREEN: | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
332 if(!vo_fs){vo_fs=1;ShowWindow(hWndFS,SW_SHOW);SetForegroundWindow(hWndFS);} |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28446
diff
changeset
|
333 else {vo_fs=0; ShowWindow(hWndFS,SW_HIDE);} |
10979 | 334 break; |
335 case VOCTRL_QUERY_FORMAT: | |
336 return query_format(*((uint32_t*)data)); | |
337 } | |
338 return vidix_control(request, data); | |
339 // return VO_NOTIMPL; | |
340 } |