Mercurial > mplayer.hg
annotate libvo/vo_winvidix.c @ 29143:499cda761744
Replace all `` by $(), it is more readable and easier to nest.
author | diego |
---|---|
date | Wed, 15 Apr 2009 20:00:26 +0000 |
parents | 7681eab10aea |
children | 0f1b5b68af32 |
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" | |
31 #include "video_out_internal.h" | |
32 | |
33 #include <windows.h> | |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
12861
diff
changeset
|
34 #include "osdep/keycodes.h" |
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
12861
diff
changeset
|
35 #include "input/input.h" |
10979 | 36 |
37 #include "aspect.h" | |
38 #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
|
39 #include "mp_fifo.h" |
10979 | 40 |
41 #include "vosub_vidix.h" | |
27079 | 42 #include "vidix/vidix.h" |
10979 | 43 |
44 | |
25216 | 45 static const vo_info_t info = |
10979 | 46 { |
47 "WIN32 (VIDIX)", | |
48 "winvidix", | |
49 "Sascha Sommer", | |
50 "" | |
51 }; | |
52 | |
53 LIBVO_EXTERN(winvidix) | |
54 | |
55 #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ | |
56 | |
57 /* VIDIX related */ | |
58 static char *vidix_name; | |
59 | |
60 /* Image parameters */ | |
61 static uint32_t image_width; | |
62 static uint32_t image_height; | |
63 static uint32_t image_format; | |
64 /* Window parameters */ | |
65 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
|
66 static float window_aspect; |
10979 | 67 |
68 static vidix_grkey_t gr_key; | |
69 | |
70 | |
28051 | 71 void set_video_eq(int cap); |
10979 | 72 |
73 | |
74 static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |
75 { | |
76 switch (message){ | |
77 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
|
78 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
|
79 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
|
80 case WM_CLOSE: |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16280
diff
changeset
|
81 mplayer_put_key(KEY_CLOSE_WIN); |
10979 | 82 break; |
83 case WM_WINDOWPOSCHANGED: | |
84 { | |
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
|
85 int tmpheight=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
|
86 /*calculate new window rect*/ |
10979 | 87 if(!vo_fs){ |
88 RECT rd; | |
89 POINT point_window; | |
90 if(!hWnd)hWnd=hwnd; | |
91 ShowCursor(TRUE); | |
92 point_window.x = 0; | |
93 point_window.y = 0; | |
94 ClientToScreen(hWnd,&point_window); | |
95 GetClientRect(hWnd,&rd); | |
96 | |
97 vo_dwidth=rd.right - rd.left; | |
98 vo_dheight=rd.bottom - rd.top; | |
99 vo_dx =point_window.x; | |
100 vo_dy =point_window.y; | |
101 // 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
|
102 |
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 /* 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
|
104 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
|
105 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
|
106 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
|
107 { |
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 = ((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
|
109 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
|
110 } |
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 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
|
112 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
|
113 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
|
114 |
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.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
|
116 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
|
117 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
|
118 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
|
119 |
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
|
120 AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 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
|
121 SetWindowPos(hWnd, HWND_TOPMOST, vo_dx+rd.left, vo_dy+rd.top, rd.right-rd.left, rd.bottom-rd.top, SWP_NOOWNERZORDER); |
10979 | 122 } |
123 else { | |
124 if(ShowCursor(FALSE)>=0)while(ShowCursor(FALSE)>=0){} | |
125 aspect(&vo_dwidth, &vo_dheight, A_ZOOM); | |
126 vo_dx = (vo_screenwidth - vo_dwidth)/2; | |
127 vo_dy = (vo_screenheight - vo_dheight)/2; | |
128 } | |
129 /*update vidix*/ | |
130 /* FIXME: implement runtime resize/move if possible, this way is very ugly! */ | |
131 vidix_stop(); | |
132 if(vidix_init(image_width, image_height, vo_dx, vo_dy, vo_dwidth, vo_dheight, image_format, vo_depthonscreen, vo_screenwidth, vo_screenheight) != 0) | |
133 mp_msg(MSGT_VO, MSGL_FATAL, "Can't initialize VIDIX driver: %s\n", strerror(errno)); | |
134 /*set colorkey*/ | |
135 vidix_start(); | |
136 mp_msg(MSGT_VO, MSGL_V, "[winvidix] window properties: pos: %dx%d, size: %dx%d\n",vo_dx, vo_dy, vo_dwidth, vo_dheight); | |
137 if(vidix_grkey_support()){ | |
138 vidix_grkey_get(&gr_key); | |
139 gr_key.key_op = KEYS_PUT; | |
140 gr_key.ckey.op = CKEY_TRUE; | |
141 if(vo_fs)gr_key.ckey.red = gr_key.ckey.green = gr_key.ckey.blue = 0; | |
142 else { | |
143 gr_key.ckey.red = gr_key.ckey.blue = 255; | |
144 gr_key.ckey.green = 0; | |
145 } | |
146 vidix_grkey_set(&gr_key); | |
147 } | |
148 | |
149 } | |
150 break; | |
151 case WM_SYSCOMMAND: | |
152 switch (wParam){ | |
153 case SC_SCREENSAVE: | |
154 case SC_MONITORPOWER: | |
155 return 0; | |
156 } | |
157 break; | |
158 case WM_KEYDOWN: | |
159 switch (wParam){ | |
160 case VK_LEFT: | |
161 {mplayer_put_key(KEY_LEFT);break;} | |
162 case VK_UP: | |
163 {mplayer_put_key(KEY_UP);break;} | |
164 case VK_RIGHT: | |
165 {mplayer_put_key(KEY_RIGHT);break;} | |
166 case VK_DOWN: | |
167 {mplayer_put_key(KEY_DOWN);break;} | |
168 case VK_TAB: | |
169 {mplayer_put_key(KEY_TAB);break;} | |
170 case VK_CONTROL: | |
171 {mplayer_put_key(KEY_CTRL);break;} | |
172 case VK_DELETE: | |
173 {mplayer_put_key(KEY_DELETE);break;} | |
174 case VK_INSERT: | |
175 {mplayer_put_key(KEY_INSERT);break;} | |
176 case VK_HOME: | |
177 {mplayer_put_key(KEY_HOME);break;} | |
178 case VK_END: | |
179 {mplayer_put_key(KEY_END);break;} | |
180 case VK_PRIOR: | |
181 {mplayer_put_key(KEY_PAGE_UP);break;} | |
182 case VK_NEXT: | |
183 {mplayer_put_key(KEY_PAGE_DOWN);break;} | |
184 case VK_ESCAPE: | |
185 {mplayer_put_key(KEY_ESC);break;} | |
186 } | |
187 break; | |
188 case WM_CHAR: | |
189 mplayer_put_key(wParam); | |
190 break; | |
191 } | |
192 return DefWindowProc(hwnd, message, wParam, lParam); | |
193 } | |
194 | |
195 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
196 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 | 197 title = "MPlayer VIDIX WIN32 Overlay"; |
198 | |
199 panscan_init(); | |
200 | |
201 image_height = height; | |
202 image_width = width; | |
203 image_format = format; | |
204 vo_screenwidth = GetSystemMetrics(SM_CXSCREEN); | |
205 vo_screenheight = GetSystemMetrics(SM_CYSCREEN); | |
206 vo_depthonscreen = GetDeviceCaps(GetDC(GetDesktopWindow()),BITSPIXEL); | |
207 | |
208 | |
209 aspect_save_orig(width, height); | |
210 aspect_save_prescale(d_width, d_height); | |
211 aspect_save_screenres(vo_screenwidth, vo_screenheight); | |
212 | |
213 vo_dx = 0; | |
214 vo_dy = 0; | |
215 | |
216 vo_dx=( vo_screenwidth - d_width ) / 2; vo_dy=( vo_screenheight - d_height ) / 2; | |
217 geometry(&vo_dx, &vo_dy, &d_width, &d_height, vo_screenwidth, vo_screenheight); | |
218 | |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
13787
diff
changeset
|
219 vo_fs = flags&VOFLAG_FULLSCREEN; |
10979 | 220 |
221 | |
222 aspect(&d_width, &d_height, A_NOZOOM); | |
223 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
|
224 window_aspect = (float)d_width / (float)d_height; |
10979 | 225 |
226 | |
227 if(!vo_config_count){ | |
228 HINSTANCE hInstance = GetModuleHandle(NULL); | |
229 WNDCLASS wc; | |
230 RECT rd; | |
231 rd.left = vo_dx; | |
232 rd.top = vo_dy; | |
233 rd.right = rd.left + vo_dwidth; | |
234 rd.bottom = rd.top + vo_dheight; | |
235 AdjustWindowRect(&rd,WS_OVERLAPPEDWINDOW| WS_SIZEBOX,0); | |
236 wc.style = CS_HREDRAW | CS_VREDRAW; | |
237 wc.lpfnWndProc = WndProc; | |
238 wc.cbClsExtra = 0; | |
239 wc.cbWndExtra = 0; | |
240 wc.hInstance = hInstance; | |
241 wc.hCursor = LoadCursor(NULL,IDC_ARROW); | |
242 wc.hIcon =ExtractIcon(hInstance,"mplayer.exe",0); | |
243 //LoadIcon(NULL,IDI_APPLICATION); | |
244 wc.hbrBackground = CreateSolidBrush(RGB(255,0,255)); | |
12858 | 245 wc.lpszClassName = "MPlayer - The Movie Player"; |
10979 | 246 wc.lpszMenuName = NULL; |
247 RegisterClass(&wc); | |
12861 | 248 hWnd = CreateWindow("MPlayer - The Movie Player", |
10979 | 249 title, |
250 WS_OVERLAPPEDWINDOW| WS_SIZEBOX, | |
251 rd.left, | |
252 rd.top, | |
253 rd.right - rd.left, | |
254 rd.bottom - rd.top, | |
255 NULL, | |
256 NULL, | |
257 hInstance, | |
258 NULL); | |
259 wc.hbrBackground = CreateSolidBrush(RGB(0,0,0)); | |
260 wc.lpszClassName = "MPlayer - Fullscreen"; | |
261 RegisterClass(&wc); | |
262 hWndFS = CreateWindow("MPlayer - Fullscreen","MPlayer VIDIX Fullscreen",WS_POPUP,0,0,vo_screenwidth,vo_screenheight,hWnd,NULL,hInstance,NULL); | |
263 | |
264 | |
265 | |
266 | |
267 | |
268 } | |
269 ShowWindow(hWnd,SW_SHOW); | |
270 if(vo_fs)ShowWindow(hWndFS,SW_SHOW); | |
271 | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
272 return 0; |
10979 | 273 } |
274 | |
275 static void check_events(void){ | |
276 MSG msg; | |
277 while (PeekMessage(&msg, NULL, 0, 0,PM_REMOVE)) | |
278 { | |
279 TranslateMessage(&msg); | |
280 DispatchMessage(&msg); | |
281 } | |
282 } | |
283 | |
284 /* draw_osd, flip_page, draw_slice, draw_frame should be | |
285 overwritten with vidix functions (vosub_vidix.c) */ | |
286 static void draw_osd(void){ | |
287 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix draw_osd!\n"); | |
288 return; | |
289 } | |
290 | |
291 static void flip_page(void){ | |
292 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix flip_page!\n"); | |
293 return; | |
294 } | |
295 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
296 static int draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int y){ |
10979 | 297 UNUSED(src); |
298 UNUSED(stride); | |
299 UNUSED(w); | |
300 UNUSED(h); | |
301 UNUSED(x); | |
302 UNUSED(y); | |
303 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
|
304 return -1; |
10979 | 305 } |
306 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
307 static int draw_frame(uint8_t *src[]){ |
10979 | 308 UNUSED(src); |
309 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix draw_frame!\n"); | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
310 return -1; |
10979 | 311 } |
312 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
313 static int query_format(uint32_t format){ |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
314 return vidix_query_fourcc(format); |
10979 | 315 } |
316 | |
317 static void uninit(void){ | |
318 DestroyWindow(hWndFS); | |
319 DestroyWindow(hWnd); | |
320 if ( !vo_config_count ) return; | |
321 vidix_term(); | |
322 | |
323 if (vidix_name){ | |
324 free(vidix_name); | |
325 vidix_name = NULL; | |
326 } | |
327 // | |
328 } | |
329 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
330 static int preinit(const char *arg){ |
10979 | 331 if (arg) |
332 vidix_name = strdup(arg); | |
333 else | |
334 { | |
11462 | 335 mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available ones (-v option for details)!\n"); |
10979 | 336 vidix_name = NULL; |
337 } | |
338 | |
339 if (vidix_preinit(vidix_name, &video_out_winvidix) != 0) | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
340 return 1; |
10979 | 341 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
342 return 0; |
10979 | 343 } |
344 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15822
diff
changeset
|
345 static int control(uint32_t request, void *data, ...){ |
10979 | 346 switch (request) { |
347 case VOCTRL_FULLSCREEN: | |
15621
54e8a5b5d9c4
regain window focus in fullscreen, patch by Erik Lunchpail <enik_27can at yahoo.com>
faust3
parents:
15212
diff
changeset
|
348 if(!vo_fs){vo_fs=1;ShowWindow(hWndFS,SW_SHOW);SetForegroundWindow(hWndFS);} |
10979 | 349 else {vo_fs=0; ShowWindow(hWndFS,SW_HIDE);} |
350 break; | |
351 case VOCTRL_QUERY_FORMAT: | |
352 return query_format(*((uint32_t*)data)); | |
353 case VOCTRL_SET_EQUALIZER: | |
354 { | |
355 va_list ap; | |
356 int value; | |
357 | |
358 va_start(ap, data); | |
359 value = va_arg(ap, int); | |
360 va_end(ap); | |
361 | |
362 return vidix_control(request, data, (int *)value); | |
363 } | |
364 case VOCTRL_GET_EQUALIZER: | |
365 { | |
366 va_list ap; | |
367 int *value; | |
368 | |
369 va_start(ap, data); | |
370 value = va_arg(ap, int*); | |
371 va_end(ap); | |
372 | |
373 return vidix_control(request, data, value); | |
374 } | |
375 } | |
376 return vidix_control(request, data); | |
377 // return VO_NOTIMPL; | |
378 } |