annotate libvo/vo_winvidix.c @ 29516:87897065b7d7

Fix aspect_fit to work correctly when borders need to be added on top and bottom, previous code accidentally compared against screen dimensions, resulting in cropping instead of added borders.
author reimar
date Thu, 27 Aug 2009 12:38:22 +0000
parents 0f1b5b68af32
children 09dd92639e7b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
22
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
23 #include <stdio.h>
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
24 #include <stdlib.h>
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
25 #include <string.h>
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
26 #include <math.h>
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
27 #include <errno.h>
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
28
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
29 #include "config.h"
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
30 #include "video_out.h"
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
31 #include "video_out_internal.h"
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
32
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
36
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
37 #include "aspect.h"
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
40
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
41 #include "vosub_vidix.h"
27079
df448e1248b2 remove now useless vidixlib.h file
ben
parents: 26755
diff changeset
42 #include "vidix/vidix.h"
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
43
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
44
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
45 static const vo_info_t info =
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
46 {
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
47 "WIN32 (VIDIX)",
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
48 "winvidix",
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
49 "Sascha Sommer",
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
50 ""
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
51 };
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
52
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
53 LIBVO_EXTERN(winvidix)
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
54
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
55 #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
56
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
57 /* VIDIX related */
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
58 static char *vidix_name;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
59
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
60 /* Image parameters */
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
61 static uint32_t image_width;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
62 static uint32_t image_height;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
63 static uint32_t image_format;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
64 /* Window parameters */
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
67
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
68 static vidix_grkey_t gr_key;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
69
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
70
28051
9e739bdb049c Get rid of pointless 'extern' keywords.
diego
parents: 27719
diff changeset
71 void set_video_eq(int cap);
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
72
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
73
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
74 static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
75 {
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
76 switch (message){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
82 break;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
83 case WM_WINDOWPOSCHANGED:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
86 /*calculate new window rect*/
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
87 if(!vo_fs){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
88 RECT rd;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
89 POINT point_window;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
90 if(!hWnd)hWnd=hwnd;
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
91 ShowCursor(TRUE);
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
92 point_window.x = 0;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
93 point_window.y = 0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
94 ClientToScreen(hWnd,&point_window);
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
95 GetClientRect(hWnd,&rd);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
96
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
97 vo_dwidth=rd.right - rd.left;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
98 vo_dheight=rd.bottom - rd.top;
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
99 vo_dx =point_window.x;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
100 vo_dy =point_window.y;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
122 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
123 else {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
124 if(ShowCursor(FALSE)>=0)while(ShowCursor(FALSE)>=0){}
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
125 aspect(&vo_dwidth, &vo_dheight, A_ZOOM);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
126 vo_dx = (vo_screenwidth - vo_dwidth)/2;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
127 vo_dy = (vo_screenheight - vo_dheight)/2;
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
128 }
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
129 /*update vidix*/
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
130 /* FIXME: implement runtime resize/move if possible, this way is very ugly! */
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
131 vidix_stop();
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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)
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
133 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
134 /*set colorkey*/
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
135 vidix_start();
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
137 if(vidix_grkey_support()){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
138 vidix_grkey_get(&gr_key);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
139 gr_key.key_op = KEYS_PUT;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
140 gr_key.ckey.op = CKEY_TRUE;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
141 if(vo_fs)gr_key.ckey.red = gr_key.ckey.green = gr_key.ckey.blue = 0;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
142 else {
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
143 gr_key.ckey.red = gr_key.ckey.blue = 255;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
144 gr_key.ckey.green = 0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
145 }
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
146 vidix_grkey_set(&gr_key);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
147 }
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
148
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
149 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
150 break;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
151 case WM_SYSCOMMAND:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
152 switch (wParam){
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
153 case SC_SCREENSAVE:
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
154 case SC_MONITORPOWER:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
155 return 0;
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
156 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
157 break;
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
158 case WM_KEYDOWN:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
159 switch (wParam){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
160 case VK_LEFT:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
161 {mplayer_put_key(KEY_LEFT);break;}
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
162 case VK_UP:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
163 {mplayer_put_key(KEY_UP);break;}
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
164 case VK_RIGHT:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
165 {mplayer_put_key(KEY_RIGHT);break;}
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
166 case VK_DOWN:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
167 {mplayer_put_key(KEY_DOWN);break;}
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
168 case VK_TAB:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
169 {mplayer_put_key(KEY_TAB);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
170 case VK_CONTROL:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
171 {mplayer_put_key(KEY_CTRL);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
172 case VK_DELETE:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
173 {mplayer_put_key(KEY_DELETE);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
174 case VK_INSERT:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
175 {mplayer_put_key(KEY_INSERT);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
176 case VK_HOME:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
177 {mplayer_put_key(KEY_HOME);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
178 case VK_END:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
179 {mplayer_put_key(KEY_END);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
180 case VK_PRIOR:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
181 {mplayer_put_key(KEY_PAGE_UP);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
182 case VK_NEXT:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
183 {mplayer_put_key(KEY_PAGE_DOWN);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
184 case VK_ESCAPE:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
185 {mplayer_put_key(KEY_ESC);break;}
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
186 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
187 break;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
188 case WM_CHAR:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
189 mplayer_put_key(wParam);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
190 break;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
191 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
192 return DefWindowProc(hwnd, message, wParam, lParam);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
193 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
194
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
197 title = "MPlayer VIDIX WIN32 Overlay";
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
198
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
199 panscan_init();
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
200
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
201 image_height = height;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
202 image_width = width;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
203 image_format = format;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
204 vo_screenwidth = GetSystemMetrics(SM_CXSCREEN);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
205 vo_screenheight = GetSystemMetrics(SM_CYSCREEN);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
206 vo_depthonscreen = GetDeviceCaps(GetDC(GetDesktopWindow()),BITSPIXEL);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
207
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
208
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
209 aspect_save_orig(width, height);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
210 aspect_save_prescale(d_width, d_height);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
211 aspect_save_screenres(vo_screenwidth, vo_screenheight);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
212
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
213 vo_dx = 0;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
214 vo_dy = 0;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
215
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
216 vo_dx=( vo_screenwidth - d_width ) / 2; vo_dy=( vo_screenheight - d_height ) / 2;
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
217 geometry(&vo_dx, &vo_dy, &d_width, &d_height, vo_screenwidth, vo_screenheight);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
218
15212
05aa13cdf92f replace VO and VF numeric flags with #defined identifiers
henry
parents: 13787
diff changeset
219 vo_fs = flags&VOFLAG_FULLSCREEN;
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
220
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
221
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
222 aspect(&d_width, &d_height, A_NOZOOM);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
225
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
226
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
227 if(!vo_config_count){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
228 HINSTANCE hInstance = GetModuleHandle(NULL);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
229 WNDCLASS wc;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
230 RECT rd;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
231 rd.left = vo_dx;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
232 rd.top = vo_dy;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
233 rd.right = rd.left + vo_dwidth;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
234 rd.bottom = rd.top + vo_dheight;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
235 AdjustWindowRect(&rd,WS_OVERLAPPEDWINDOW| WS_SIZEBOX,0);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
236 wc.style = CS_HREDRAW | CS_VREDRAW;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
237 wc.lpfnWndProc = WndProc;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
238 wc.cbClsExtra = 0;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
239 wc.cbWndExtra = 0;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
240 wc.hInstance = hInstance;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
241 wc.hCursor = LoadCursor(NULL,IDC_ARROW);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
242 wc.hIcon =ExtractIcon(hInstance,"mplayer.exe",0);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
243 //LoadIcon(NULL,IDI_APPLICATION);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
244 wc.hbrBackground = CreateSolidBrush(RGB(255,0,255));
12858
cbcc205a740e embarassing typo and new name
diego
parents: 11462
diff changeset
245 wc.lpszClassName = "MPlayer - The Movie Player";
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
246 wc.lpszMenuName = NULL;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
247 RegisterClass(&wc);
12861
88aba9a06162 name change
diego
parents: 12858
diff changeset
248 hWnd = CreateWindow("MPlayer - The Movie Player",
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
249 title,
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
250 WS_OVERLAPPEDWINDOW| WS_SIZEBOX,
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
251 rd.left,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
252 rd.top,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
253 rd.right - rd.left,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
254 rd.bottom - rd.top,
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
255 NULL,
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
256 NULL,
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
257 hInstance,
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
258 NULL);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
259 wc.hbrBackground = CreateSolidBrush(RGB(0,0,0));
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
260 wc.lpszClassName = "MPlayer - Fullscreen";
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
261 RegisterClass(&wc);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
262 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
263
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
264
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
265
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
266
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
267
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
268 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
269 ShowWindow(hWnd,SW_SHOW);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
270 if(vo_fs)ShowWindow(hWndFS,SW_SHOW);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
271
26755
46f0b4d34fa1 cosmetics: Remove useless parentheses from from return statements.
diego
parents: 25216
diff changeset
272 return 0;
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
273 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
274
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
275 static void check_events(void){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
276 MSG msg;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
277 while (PeekMessage(&msg, NULL, 0, 0,PM_REMOVE))
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
278 {
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
279 TranslateMessage(&msg);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
280 DispatchMessage(&msg);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
281 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
282 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
283
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
284 /* draw_osd, flip_page, draw_slice, draw_frame should be
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
285 overwritten with vidix functions (vosub_vidix.c) */
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
286 static void draw_osd(void){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
287 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix draw_osd!\n");
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
288 return;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
289 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
290
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
291 static void flip_page(void){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
292 mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix flip_page!\n");
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
293 return;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
294 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
297 UNUSED(src);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
298 UNUSED(stride);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
299 UNUSED(w);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
300 UNUSED(h);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
301 UNUSED(x);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
302 UNUSED(y);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
305 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
308 UNUSED(src);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
311 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
315 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
316
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
317 static void uninit(void){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
318 DestroyWindow(hWndFS);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
319 DestroyWindow(hWnd);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
320 if ( !vo_config_count ) return;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
321 vidix_term();
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
322
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
323 if (vidix_name){
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
324 free(vidix_name);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
325 vidix_name = NULL;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
326 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
327 //
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
328 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
331 if (arg)
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
332 vidix_name = strdup(arg);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
333 else
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
334 {
11462
2e367138d4b5 message expanded with hint to use -v option
gabucino
parents: 10979
diff changeset
335 mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available ones (-v option for details)!\n");
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
336 vidix_name = NULL;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
337 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
338
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
341
26755
46f0b4d34fa1 cosmetics: Remove useless parentheses from from return statements.
diego
parents: 25216
diff changeset
342 return 0;
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
343 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
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
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
346 switch (request) {
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
347 case VOCTRL_FULLSCREEN:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
348 if(!vo_fs){vo_fs=1;ShowWindow(hWndFS,SW_SHOW);SetForegroundWindow(hWndFS);}
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
349 else {vo_fs=0; ShowWindow(hWndFS,SW_HIDE);}
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
350 break;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
351 case VOCTRL_QUERY_FORMAT:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
352 return query_format(*((uint32_t*)data));
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
353 case VOCTRL_SET_EQUALIZER:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
354 {
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
355 va_list ap;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
356 int value;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
357
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
358 va_start(ap, data);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
359 value = va_arg(ap, int);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
360 va_end(ap);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
361
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
362 return vidix_control(request, data, (int *)value);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
363 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
364 case VOCTRL_GET_EQUALIZER:
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
365 {
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
366 va_list ap;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
367 int *value;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28446
diff changeset
368
10979
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
369 va_start(ap, data);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
370 value = va_arg(ap, int*);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
371 va_end(ap);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
372
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
373 return vidix_control(request, data, value);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
374 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
375 }
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
376 return vidix_control(request, data);
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
377 // return VO_NOTIMPL;
ea4426db0db5 new vidix vo modules for textmode console and windows
faust3
parents:
diff changeset
378 }