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