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