Mercurial > mplayer.hg
annotate libvo/vo_xvidix.c @ 27925:296d5da784b4
Simplify conditions in direct3d vo: remove == 1, change == 0 to ! etc.
author | reimar |
---|---|
date | Wed, 19 Nov 2008 13:39:07 +0000 |
parents | 3da3930bf2ac |
children | 6f199f065e15 |
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 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
343 return 0; |
4123 | 344 } |
345 | |
346 static void check_events(void) | |
347 { | |
348 const int event = vo_x11_check_events(mDisplay); | |
4125 | 349 |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
350 if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE)) |
12582 | 351 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
|
352 |
4125 | 353 return; |
4123 | 354 } |
355 | |
356 /* draw_osd, flip_page, draw_slice, draw_frame should be | |
357 overwritten with vidix functions (vosub_vidix.c) */ | |
358 static void draw_osd(void) | |
359 { | |
12582 | 360 mp_msg(MSGT_VO, MSGL_FATAL, |
361 "[xvidix] error: didn't used vidix draw_osd!\n"); | |
4123 | 362 return; |
363 } | |
364 | |
365 static void flip_page(void) | |
366 { | |
12582 | 367 mp_msg(MSGT_VO, MSGL_FATAL, |
368 "[xvidix] error: didn't used vidix flip_page!\n"); | |
4123 | 369 return; |
370 } | |
371 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
372 static int draw_slice(uint8_t * src[], int stride[], |
12582 | 373 int w, int h, int x, int y) |
4123 | 374 { |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
375 UNUSED(src); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
376 UNUSED(stride); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
377 UNUSED(w); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
378 UNUSED(h); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
379 UNUSED(x); |
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
380 UNUSED(y); |
12582 | 381 mp_msg(MSGT_VO, MSGL_FATAL, |
382 "[xvidix] error: didn't used vidix draw_slice!\n"); | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
383 return -1; |
4123 | 384 } |
385 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
386 static int draw_frame(uint8_t * src[]) |
4123 | 387 { |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
388 UNUSED(src); |
12582 | 389 mp_msg(MSGT_VO, MSGL_FATAL, |
390 "[xvidix] error: didn't used vidix draw_frame!\n"); | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
391 return -1; |
4123 | 392 } |
393 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
394 static int query_format(uint32_t format) |
4123 | 395 { |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
396 return vidix_query_fourcc(format); |
4123 | 397 } |
398 | |
399 static void uninit(void) | |
400 { | |
12582 | 401 if (!vo_config_count) |
402 return; | |
4241
817742049fa0
updated based vo_xmga, using colorkey, working with gui, fixed xinerama and window moving/resizing
alex
parents:
4198
diff
changeset
|
403 vidix_term(); |
12582 | 404 |
8577 | 405 if (vidix_name) |
406 { | |
12582 | 407 free(vidix_name); |
408 vidix_name = NULL; | |
8577 | 409 } |
4441
90814d64a840
removed obosolete Terminate_Display_Process. using vo_x11_uninit. support UYVY format
alex
parents:
4434
diff
changeset
|
410 |
6095 | 411 vo_x11_uninit(); |
4271
2c7e6c87fb6f
reworked, picture moves when window moved, fullscreen working with gui, fixed some annoying bugs
alex
parents:
4255
diff
changeset
|
412 } |
4352 | 413 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
414 static int preinit(const char *arg) |
4352 | 415 { |
6016 | 416 |
4363 | 417 if (arg) |
418 vidix_name = strdup(arg); | |
419 else | |
420 { | |
12582 | 421 mp_msg(MSGT_VO, MSGL_INFO, |
422 "No vidix driver name provided, probing available ones (-v option for details)!\n"); | |
423 vidix_name = NULL; | |
4363 | 424 } |
425 | |
12582 | 426 if (!vo_init()) |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
427 return -1; |
7777 | 428 |
4363 | 429 if (vidix_preinit(vidix_name, &video_out_xvidix) != 0) |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
430 return 1; |
4363 | 431 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25216
diff
changeset
|
432 return 0; |
4352 | 433 } |
434 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15540
diff
changeset
|
435 static int control(uint32_t request, void *data, ...) |
4352 | 436 { |
12582 | 437 switch (request) |
438 { | |
439 case VOCTRL_QUERY_FORMAT: | |
440 return query_format(*((uint32_t *) data)); | |
441 case VOCTRL_GUISUPPORT: | |
442 return VO_TRUE; | |
443 case VOCTRL_GET_PANSCAN: | |
444 if (!vo_config_count || !vo_fs) | |
445 return VO_FALSE; | |
446 return VO_TRUE; | |
447 case VOCTRL_ONTOP: | |
448 vo_x11_ontop(); | |
449 return VO_TRUE; | |
450 case VOCTRL_FULLSCREEN: | |
451 vo_x11_fullscreen(); | |
452 case VOCTRL_SET_PANSCAN: | |
453 if (vo_fs && (vo_panscan != vo_panscan_amount)) | |
454 { | |
455 panscan_calc(); | |
456 set_window(0); | |
457 } | |
458 return VO_TRUE; | |
459 case VOCTRL_SET_EQUALIZER: | |
460 { | |
461 va_list ap; | |
462 int value; | |
6786 | 463 |
12582 | 464 va_start(ap, data); |
465 value = va_arg(ap, int); | |
466 | |
467 va_end(ap); | |
6786 | 468 |
20110 | 469 return vidix_control(request, data, value); |
12582 | 470 } |
471 case VOCTRL_GET_EQUALIZER: | |
472 { | |
473 va_list ap; | |
474 int *value; | |
475 | |
476 va_start(ap, data); | |
477 value = va_arg(ap, int *); | |
478 | |
479 va_end(ap); | |
480 | |
481 return vidix_control(request, data, value); | |
482 } | |
22232 | 483 case VOCTRL_UPDATE_SCREENINFO: |
484 aspect_save_screenres(vo_screenwidth, vo_screenheight); | |
485 return VO_TRUE; | |
486 | |
12582 | 487 } |
488 return vidix_control(request, data); | |
6531 | 489 // return VO_NOTIMPL; |
4352 | 490 } |