Mercurial > mplayer.hg
annotate libvo/vo_xvidix.c @ 28063:a318969a4f45
Set the base size window manager hint, otherwise some subtract the minimum
size of 4x4 from the numbers displayed to the user which might be confusing.
Based on patch by Bert Wesarg [bert wesarg googlemail com].
author | reimar |
---|---|
date | Fri, 05 Dec 2008 19:01:49 +0000 |
parents | 9e739bdb049c |
children | 7681eab10aea |
rev | line source |
---|---|
4123 | 1 /* |
2 VIDIX accelerated overlay in a X window | |
3 | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
4 (C) Alex Beregszaszi & Zoltan Ponekker & Nick Kurshev |
4123 | 5 |
6 WS window manager by Pontscho/Fresh! | |
7 | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
8 Based on vo_gl.c and vo_vesa.c and vo_xmga.c (.so mastah! ;)) |
4123 | 9 */ |
10 | |
11 #include <stdio.h> | |
12 #include <stdlib.h> | |
13 #include <string.h> | |
14 #include <math.h> | |
15 #include <errno.h> | |
16 | |
17 #include "config.h" | |
18 #include "video_out.h" | |
19 #include "video_out_internal.h" | |
20 | |
21 #include <X11/Xlib.h> | |
22 #include <X11/Xutil.h> | |
23 //#include <X11/keysym.h> | |
24 | |
27377
d58d06eafe83
Change a bunch of X11-specific preprocessor directives.
diego
parents:
27343
diff
changeset
|
25 #ifdef CONFIG_XINERAMA |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
26 #include <X11/extensions/Xinerama.h> |
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
27 #endif |
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
28 |
4123 | 29 #include "x11_common.h" |
30 #include "aspect.h" | |
31 #include "mp_msg.h" | |
32 | |
33 #include "vosub_vidix.h" | |
27079 | 34 #include "vidix/vidix.h" |
4123 | 35 |
27343 | 36 #ifdef CONFIG_GUI |
23077 | 37 #include "gui/interface.h" |
6009 | 38 #endif |
39 | |
4123 | 40 |
25216 | 41 static const vo_info_t info = { |
4123 | 42 "X11 (VIDIX)", |
43 "xvidix", | |
44 "Alex Beregszaszi", | |
45 "" | |
46 }; | |
47 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
8123
diff
changeset
|
48 LIBVO_EXTERN(xvidix) |
12582 | 49 #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ |
4123 | 50 /* X11 related variables */ |
4363 | 51 /* Colorkey handling */ |
10988 | 52 static int colorkey; |
4363 | 53 static vidix_grkey_t gr_key; |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
54 |
4363 | 55 /* VIDIX related */ |
56 static char *vidix_name; | |
4123 | 57 |
58 /* Image parameters */ | |
59 static uint32_t image_width; | |
60 static uint32_t image_height; | |
61 static uint32_t image_format; | |
62 | |
63 /* Window parameters */ | |
6299
4446af3c1a75
set_window() fixing detection of changement of the window position
attila
parents:
6095
diff
changeset
|
64 static uint32_t window_x, window_y; |
4123 | 65 static uint32_t window_width, window_height; |
66 | |
4363 | 67 /* used by XGetGeometry & XTranslateCoordinates for moving/resizing window */ |
4123 | 68 static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth, |
4981 | 69 drwDepth, drwcX, drwcY, dwidth, dheight; |
4123 | 70 |
28051 | 71 void set_video_eq(int cap); |
6755 | 72 |
8991 | 73 |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
6953
diff
changeset
|
74 static void set_window(int force_update) |
4123 | 75 { |
6095 | 76 Window mRoot; |
12582 | 77 |
78 if (WinID) | |
79 { | |
80 XGetGeometry(mDisplay, vo_window, &mRoot, &drwX, &drwY, &drwWidth, | |
81 &drwHeight, &drwBorderWidth, &drwDepth); | |
82 drwX = drwY = 0; | |
6307 | 83 |
12582 | 84 XTranslateCoordinates(mDisplay, vo_window, mRoot, 0, 0, |
85 &drwcX, &drwcY, &mRoot); | |
86 aspect(&dwidth, &dheight, A_NOZOOM); | |
87 if (!vo_fs) | |
88 mp_msg(MSGT_VO, MSGL_V, | |
89 "[xvidix] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n", | |
90 drwcX, drwcY, drwX, drwY, drwWidth, drwHeight); | |
4123 | 91 |
12582 | 92 /* following stuff copied from vo_xmga.c */ |
93 } else | |
94 { | |
95 aspect(&dwidth, &dheight, A_NOZOOM); | |
96 drwcX = drwX = vo_dx; | |
97 drwcY = drwY = vo_dy; | |
98 drwWidth = vo_dwidth; | |
99 drwHeight = vo_dheight; | |
100 } | |
6043 | 101 |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
102 #if X11_FULLSCREEN |
4981 | 103 if (vo_fs) |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
104 { |
12582 | 105 aspect(&dwidth, &dheight, A_ZOOM); |
106 drwX = | |
107 (vo_screenwidth - | |
108 (dwidth > vo_screenwidth ? vo_screenwidth : dwidth)) / 2; | |
109 drwcX = drwX; | |
110 drwY = | |
111 (vo_screenheight - | |
112 (dheight > vo_screenheight ? vo_screenheight : dheight)) / 2; | |
113 drwcY = drwY; | |
114 drwWidth = (dwidth > vo_screenwidth ? vo_screenwidth : dwidth); | |
115 drwHeight = | |
116 (dheight > vo_screenheight ? vo_screenheight : dheight); | |
117 mp_msg(MSGT_VO, MSGL_V, | |
118 "[xvidix-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n", | |
119 drwcX, drwcY, drwX, drwY, drwWidth, drwHeight); | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
120 } |
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
121 #endif |
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
122 |
12582 | 123 vo_dwidth = drwWidth; |
124 vo_dheight = drwHeight; | |
6307 | 125 |
27748 | 126 update_xinerama_info(); |
127 drwcX -= xinerama_x; | |
128 drwcY -= xinerama_y; | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
129 |
12582 | 130 if (vo_panscan > 0.0f && vo_fs) |
131 { | |
132 drwcX -= vo_panscan_x >> 1; | |
133 drwcY -= vo_panscan_y >> 1; | |
134 drwX -= vo_panscan_x >> 1; | |
135 drwY -= vo_panscan_y >> 1; | |
136 drwWidth += vo_panscan_x; | |
137 drwHeight += vo_panscan_y; | |
138 } | |
6307 | 139 |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
140 /* set new values in VIDIX */ |
6299
4446af3c1a75
set_window() fixing detection of changement of the window position
attila
parents:
6095
diff
changeset
|
141 if (force_update || (window_x != drwcX) || (window_y != drwcY) || |
12582 | 142 (window_width != drwWidth) || (window_height != drwHeight)) |
4123 | 143 { |
12582 | 144 // do a backup of window coordinates |
145 window_x = drwcX; | |
146 window_y = drwcY; | |
147 vo_dx = drwcX; | |
148 vo_dy = drwcY; | |
149 window_width = drwWidth; | |
150 window_height = drwHeight; | |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4194
diff
changeset
|
151 |
12582 | 152 /* FIXME: implement runtime resize/move if possible, this way is very ugly! */ |
153 vidix_stop(); | |
154 if (vidix_init(image_width, image_height, vo_dx, vo_dy, | |
155 window_width, window_height, image_format, | |
156 vo_depthonscreen, vo_screenwidth, | |
157 vo_screenheight) != 0) | |
4123 | 158 { |
12582 | 159 mp_msg(MSGT_VO, MSGL_FATAL, |
160 "Can't initialize VIDIX driver: %s\n", strerror(errno)); | |
161 abort(); | |
162 } | |
163 vidix_start(); | |
4123 | 164 } |
12582 | 165 |
166 mp_msg(MSGT_VO, MSGL_V, | |
167 "[xvidix] window properties: pos: %dx%d, size: %dx%d\n", vo_dx, | |
168 vo_dy, window_width, window_height); | |
4123 | 169 |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
170 /* mDrawColorKey: */ |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
171 |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
172 /* fill drawable with specified color */ |
11216 | 173 if (!(vo_colorkey & 0xff000000)) |
11158
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10988
diff
changeset
|
174 { |
12582 | 175 XSetBackground(mDisplay, vo_gc, 0L); |
176 XClearWindow(mDisplay, vo_window); | |
177 XSetForeground(mDisplay, vo_gc, colorkey); | |
178 XFillRectangle(mDisplay, vo_window, vo_gc, drwX, drwY, drwWidth, | |
179 (vo_fs ? drwHeight - 1 : drwHeight)); | |
11158
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10988
diff
changeset
|
180 } |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
181 /* flush, update drawable */ |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
182 XFlush(mDisplay); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
183 |
4123 | 184 return; |
185 } | |
186 | |
187 /* connect to server, create and map window, | |
188 * allocate colors and (shared) memory | |
189 */ | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
190 static int config(uint32_t width, uint32_t height, uint32_t d_width, |
12582 | 191 uint32_t d_height, uint32_t flags, char *title, |
192 uint32_t format) | |
4123 | 193 { |
194 XVisualInfo vinfo; | |
12582 | 195 |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7931
diff
changeset
|
196 // XSizeHints hint; |
4123 | 197 XSetWindowAttributes xswa; |
198 unsigned long xswamask; | |
199 XWindowAttributes attribs; | |
10988 | 200 int window_depth, r, g, b; |
4125 | 201 |
5738 | 202 title = "MPlayer VIDIX X11 Overlay"; |
4123 | 203 |
204 image_height = height; | |
205 image_width = width; | |
206 image_format = format; | |
4459 | 207 |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
208 window_width = d_width; |
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
209 window_height = d_height; |
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
210 |
6009 | 211 // vo_fs = flags&0x01; |
212 // if (vo_fs) | |
213 // { vo_old_width=d_width; vo_old_height=d_height; } | |
4123 | 214 |
10988 | 215 r = (vo_colorkey & 0x00ff0000) >> 16; |
216 g = (vo_colorkey & 0x0000ff00) >> 8; | |
217 b = vo_colorkey & 0x000000ff; | |
12582 | 218 switch (vo_depthonscreen) |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
219 { |
12582 | 220 case 32: |
221 colorkey = vo_colorkey; | |
222 break; | |
223 case 24: | |
224 colorkey = vo_colorkey & 0x00ffffff; | |
225 break; | |
226 case 16: | |
227 colorkey = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); | |
228 break; | |
229 case 15: | |
230 colorkey = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3); | |
231 break; | |
232 default: | |
233 mp_msg(MSGT_VO, MSGL_ERR, | |
234 "Sorry, this (%d) color depth is not supported\n", | |
235 vo_depthonscreen); | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
236 } |
13946 | 237 mp_msg(MSGT_VO, MSGL_V, "Using colorkey: %x\n", colorkey); |
4123 | 238 |
27343 | 239 #ifdef CONFIG_GUI |
12582 | 240 if (use_gui) |
241 guiGetEvent(guiSetShVideo, 0); // the GUI will set up / resize the window | |
242 else | |
243 { | |
4123 | 244 #endif |
245 | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
246 #ifdef X11_FULLSCREEN |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
13946
diff
changeset
|
247 if ((flags & VOFLAG_FULLSCREEN) || (flags & VOFLAG_SWSCALE)) |
12582 | 248 aspect(&d_width, &d_height, A_ZOOM); |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
249 #endif |
12582 | 250 dwidth = d_width; |
251 dheight = d_height; | |
252 /* Make the window */ | |
253 XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), | |
254 &attribs); | |
4123 | 255 |
12582 | 256 /* from vo_x11 */ |
257 window_depth = attribs.depth; | |
258 if ((window_depth != 15) && (window_depth != 16) | |
259 && (window_depth != 24) && (window_depth != 32)) | |
260 window_depth = 24; | |
261 XMatchVisualInfo(mDisplay, mScreen, window_depth, TrueColor, | |
262 &vinfo); | |
4123 | 263 |
12582 | 264 xswa.background_pixel = BlackPixel(mDisplay, mScreen); |
265 xswa.border_pixel = 0; | |
266 xswa.colormap = | |
267 XCreateColormap(mDisplay, RootWindow(mDisplay, mScreen), | |
268 vinfo.visual, AllocNone); | |
27927
6f199f065e15
Factor common code like -wid handling, vo_gc creation etc. out into
reimar
parents:
27903
diff
changeset
|
269 xswamask = CWBackPixel | CWBorderPixel | CWColormap; |
4123 | 270 |
23655
00aa61cde84a
Make X11 window creation and (with -fixed-vo) management simpler and more
reimar
parents:
23077
diff
changeset
|
271 vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, |
00aa61cde84a
Make X11 window creation and (with -fixed-vo) management simpler and more
reimar
parents:
23077
diff
changeset
|
272 window_width, window_height, flags, |
00aa61cde84a
Make X11 window creation and (with -fixed-vo) management simpler and more
reimar
parents:
23077
diff
changeset
|
273 CopyFromParent, "xvidix", title); |
00aa61cde84a
Make X11 window creation and (with -fixed-vo) management simpler and more
reimar
parents:
23077
diff
changeset
|
274 XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa); |
12582 | 275 |
27343 | 276 #ifdef CONFIG_GUI |
12582 | 277 } |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
278 #endif |
4123 | 279 |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
13946
diff
changeset
|
280 if ((!WinID) && (flags & VOFLAG_FULLSCREEN)) |
12582 | 281 { |
282 vo_dx = 0; | |
283 vo_dy = 0; | |
284 vo_dwidth = vo_screenwidth; | |
285 vo_dheight = vo_screenheight; | |
286 vo_fs = 1; | |
287 } | |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
288 |
4255 | 289 if (vidix_grkey_support()) |
290 { | |
12582 | 291 vidix_grkey_get(&gr_key); |
292 gr_key.key_op = KEYS_PUT; | |
293 if (!(vo_colorkey & 0xff000000)) | |
294 { | |
295 gr_key.ckey.op = CKEY_TRUE; | |
296 gr_key.ckey.red = r; | |
297 gr_key.ckey.green = g; | |
298 gr_key.ckey.blue = b; | |
299 } else | |
300 gr_key.ckey.op = CKEY_FALSE; | |
301 vidix_grkey_set(&gr_key); | |
4255 | 302 } |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
303 |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
6953
diff
changeset
|
304 set_window(1); |
6755 | 305 |
4805 | 306 XSync(mDisplay, False); |
4123 | 307 |
6382
86d5fc5b54e2
fix panscan support and add Jesper Svennevid's <mplayer@svennevid.net> patch
pontscho
parents:
6311
diff
changeset
|
308 panscan_calc(); |
86d5fc5b54e2
fix panscan support and add Jesper Svennevid's <mplayer@svennevid.net> patch
pontscho
parents:
6311
diff
changeset
|
309 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
310 return 0; |
4123 | 311 } |
312 | |
313 static void check_events(void) | |
314 { | |
315 const int event = vo_x11_check_events(mDisplay); | |
4125 | 316 |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
317 if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE)) |
12582 | 318 set_window(0); |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
319 |
4125 | 320 return; |
4123 | 321 } |
322 | |
323 /* draw_osd, flip_page, draw_slice, draw_frame should be | |
324 overwritten with vidix functions (vosub_vidix.c) */ | |
325 static void draw_osd(void) | |
326 { | |
12582 | 327 mp_msg(MSGT_VO, MSGL_FATAL, |
328 "[xvidix] error: didn't used vidix draw_osd!\n"); | |
4123 | 329 return; |
330 } | |
331 | |
332 static void flip_page(void) | |
333 { | |
12582 | 334 mp_msg(MSGT_VO, MSGL_FATAL, |
335 "[xvidix] error: didn't used vidix flip_page!\n"); | |
4123 | 336 return; |
337 } | |
338 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
339 static int draw_slice(uint8_t * src[], int stride[], |
12582 | 340 int w, int h, int x, int y) |
4123 | 341 { |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
342 UNUSED(src); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
343 UNUSED(stride); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
344 UNUSED(w); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
345 UNUSED(h); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
346 UNUSED(x); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
347 UNUSED(y); |
12582 | 348 mp_msg(MSGT_VO, MSGL_FATAL, |
349 "[xvidix] error: didn't used vidix draw_slice!\n"); | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
350 return -1; |
4123 | 351 } |
352 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
353 static int draw_frame(uint8_t * src[]) |
4123 | 354 { |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
355 UNUSED(src); |
12582 | 356 mp_msg(MSGT_VO, MSGL_FATAL, |
357 "[xvidix] error: didn't used vidix draw_frame!\n"); | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
358 return -1; |
4123 | 359 } |
360 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
361 static int query_format(uint32_t format) |
4123 | 362 { |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
363 return vidix_query_fourcc(format); |
4123 | 364 } |
365 | |
366 static void uninit(void) | |
367 { | |
12582 | 368 if (!vo_config_count) |
369 return; | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
370 vidix_term(); |
12582 | 371 |
8577 | 372 if (vidix_name) |
373 { | |
12582 | 374 free(vidix_name); |
375 vidix_name = NULL; | |
8577 | 376 } |
4441
90814d64a840
removed obosolete Terminate_Display_Process. using vo_x11_uninit. support UYVY format
alex
parents:
4434
diff
changeset
|
377 |
6095 | 378 vo_x11_uninit(); |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
379 } |
4352 | 380 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
381 static int preinit(const char *arg) |
4352 | 382 { |
6016 | 383 |
4363 | 384 if (arg) |
385 vidix_name = strdup(arg); | |
386 else | |
387 { | |
12582 | 388 mp_msg(MSGT_VO, MSGL_INFO, |
389 "No vidix driver name provided, probing available ones (-v option for details)!\n"); | |
390 vidix_name = NULL; | |
4363 | 391 } |
392 | |
12582 | 393 if (!vo_init()) |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
394 return -1; |
7777 | 395 |
4363 | 396 if (vidix_preinit(vidix_name, &video_out_xvidix) != 0) |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
397 return 1; |
4363 | 398 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
399 return 0; |
4352 | 400 } |
401 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
402 static int control(uint32_t request, void *data, ...) |
4352 | 403 { |
12582 | 404 switch (request) |
405 { | |
406 case VOCTRL_QUERY_FORMAT: | |
407 return query_format(*((uint32_t *) data)); | |
408 case VOCTRL_GUISUPPORT: | |
409 return VO_TRUE; | |
410 case VOCTRL_GET_PANSCAN: | |
411 if (!vo_config_count || !vo_fs) | |
412 return VO_FALSE; | |
413 return VO_TRUE; | |
414 case VOCTRL_ONTOP: | |
415 vo_x11_ontop(); | |
416 return VO_TRUE; | |
417 case VOCTRL_FULLSCREEN: | |
418 vo_x11_fullscreen(); | |
419 case VOCTRL_SET_PANSCAN: | |
420 if (vo_fs && (vo_panscan != vo_panscan_amount)) | |
421 { | |
422 panscan_calc(); | |
423 set_window(0); | |
424 } | |
425 return VO_TRUE; | |
426 case VOCTRL_SET_EQUALIZER: | |
427 { | |
428 va_list ap; | |
429 int value; | |
6786 | 430 |
12582 | 431 va_start(ap, data); |
432 value = va_arg(ap, int); | |
433 | |
434 va_end(ap); | |
6786 | 435 |
20110 | 436 return vidix_control(request, data, value); |
12582 | 437 } |
438 case VOCTRL_GET_EQUALIZER: | |
439 { | |
440 va_list ap; | |
441 int *value; | |
442 | |
443 va_start(ap, data); | |
444 value = va_arg(ap, int *); | |
445 | |
446 va_end(ap); | |
447 | |
448 return vidix_control(request, data, value); | |
449 } | |
22232 | 450 case VOCTRL_UPDATE_SCREENINFO: |
451 aspect_save_screenres(vo_screenwidth, vo_screenheight); | |
452 return VO_TRUE; | |
453 | |
12582 | 454 } |
455 return vidix_control(request, data); | |
6531 | 456 // return VO_NOTIMPL; |
4352 | 457 } |