Mercurial > mplayer.hg
annotate libvo/vo_3dfx.c @ 23590:d0ed8af54675
Use sh_sub_t instead of mkv_track_t argument where possible, simplifying the code a bit.
author | reimar |
---|---|
date | Sat, 23 Jun 2007 15:38:00 +0000 |
parents | a124f3abc1ec |
children | eabc7dc83a48 |
rev | line source |
---|---|
1 | 1 /* |
2 * video_out_3dfx.c | |
3 * | |
4 * Copyright (C) Colin Cross Apr 2000 | |
5 * | |
6 * This file heavily based off of video_out_mga.c of Aaron Holtzman's | |
7 * mpeg2dec | |
8 * | |
9 * mpeg2dec is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2, or (at your option) | |
12 * any later version. | |
13 * | |
14 * mpeg2dec is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
21977
cea0eb833758
Fix FSF address and otherwise broken license headers.
diego
parents:
18234
diff
changeset
|
20 * along with mpeg2dec; if not, write to the Free Software |
cea0eb833758
Fix FSF address and otherwise broken license headers.
diego
parents:
18234
diff
changeset
|
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1 | 22 */ |
23 | |
24 #include <stdio.h> | |
25 #include <stdlib.h> | |
26 #include <string.h> | |
27 | |
28 #include "config.h" | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
29 #include "mp_msg.h" |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
30 #include "help_mp.h" |
1 | 31 #include "video_out.h" |
32 #include "video_out_internal.h" | |
33 | |
34 #include <sys/ioctl.h> | |
35 #include <unistd.h> | |
36 #include <fcntl.h> | |
37 #include <sys/mman.h> | |
38 #include <errno.h> | |
39 #include <wchar.h> | |
40 #include <signal.h> | |
41 | |
42 #include <X11/Xlib.h> | |
43 #include <X11/extensions/xf86dga.h> | |
44 #include <X11/Xutil.h> | |
45 | |
46 //#define LOG(x) syslog(LOG_USER | LOG_DEBUG,x) | |
47 #define LOG(x) | |
48 | |
49 #include "drivers/3dfx.h" | |
50 | |
354 | 51 #include "fastmemcpy.h" |
350 | 52 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
53 static vo_info_t info = |
1 | 54 { |
55 "3dfx (/dev/3dfx)", | |
56 "3dfx", | |
57 "Colin Cross <colin@MIT.EDU>", | |
58 "" | |
59 }; | |
60 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
61 LIBVO_EXTERN(3dfx) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
62 |
1 | 63 static uint32_t is_fullscreen = 1; |
64 | |
65 static uint32_t vidwidth; | |
66 static uint32_t vidheight; | |
67 | |
68 static uint32_t screenwidth; | |
69 static uint32_t screenheight; | |
70 static uint32_t screendepth = 2; //Only 16bpp supported right now | |
71 | |
72 static uint32_t dispwidth = 1280; // You can change these to whatever you want | |
73 static uint32_t dispheight = 720; // 16:9 screen ratio?? | |
74 static uint32_t dispx; | |
75 static uint32_t dispy; | |
76 | |
77 static uint32_t *vidpage0; | |
78 static uint32_t *vidpage1; | |
79 static uint32_t *vidpage2; | |
80 | |
81 static uint32_t vidpage0offset; | |
82 static uint32_t vidpage1offset; | |
83 static uint32_t vidpage2offset; | |
84 | |
85 // Current pointer into framebuffer where display is located | |
86 static uint32_t targetoffset; | |
87 | |
88 static uint32_t page_space; | |
89 | |
90 static voodoo_io_reg *reg_IO; | |
91 static voodoo_2d_reg *reg_2d; | |
92 static voodoo_yuv_reg *reg_YUV; | |
93 static voodoo_yuv_fb *fb_YUV; | |
94 | |
95 static uint32_t *memBase0, *memBase1; | |
96 static uint32_t baseAddr0, baseAddr1; | |
97 | |
98 | |
99 /* X11 related variables */ | |
100 static Display *display; | |
101 static Window mywindow; | |
102 static int bpp; | |
103 static XWindowAttributes attribs; | |
104 | |
17162 | 105 static int fd=-1; |
106 | |
1 | 107 |
108 static void | |
109 restore(void) | |
110 { | |
111 //reg_IO->vidDesktopStartAddr = vidpage0offset; | |
112 XF86DGADirectVideo(display,0,0); | |
113 } | |
114 | |
115 static void | |
116 sighup(int foo) | |
117 { | |
118 //reg_IO->vidDesktopStartAddr = vidpage0offset; | |
119 XF86DGADirectVideo(display,0,0); | |
120 exit(0); | |
121 } | |
122 | |
123 static void | |
124 restore_regs(voodoo_2d_reg *regs) | |
125 { | |
126 reg_2d->commandExtra = regs->commandExtra; | |
127 reg_2d->clip0Min = regs->clip0Min; | |
128 reg_2d->clip0Max = regs->clip0Max; | |
129 | |
130 reg_2d->srcBaseAddr = regs->srcBaseAddr; | |
131 reg_2d->srcXY = regs->srcXY; | |
132 reg_2d->srcFormat = regs->srcFormat; | |
133 reg_2d->srcSize = regs->srcSize; | |
134 | |
135 reg_2d->dstBaseAddr = regs->dstBaseAddr; | |
136 reg_2d->dstXY = regs->dstXY; | |
137 reg_2d->dstFormat = regs->dstFormat; | |
138 | |
139 reg_2d->dstSize = regs->dstSize; | |
140 reg_2d->command = 0; | |
141 } | |
142 | |
143 static uint32_t | |
10994 | 144 create_window(Display *display, char *title) |
1 | 145 { |
146 int screen; | |
147 unsigned int fg, bg; | |
148 XSizeHints hint; | |
149 XVisualInfo vinfo; | |
150 XEvent xev; | |
151 | |
152 Colormap theCmap; | |
153 XSetWindowAttributes xswa; | |
154 unsigned long xswamask; | |
155 | |
156 screen = DefaultScreen(display); | |
157 | |
158 hint.x = 0; | |
159 hint.y = 10; | |
160 hint.width = dispwidth; | |
161 hint.height = dispheight; | |
162 hint.flags = PPosition | PSize; | |
163 | |
164 bg = WhitePixel(display, screen); | |
165 fg = BlackPixel(display, screen); | |
166 | |
167 XGetWindowAttributes(display, DefaultRootWindow(display), &attribs); | |
168 bpp = attribs.depth; | |
169 if (bpp != 16) | |
170 { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
171 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_Only16BppSupported); |
1 | 172 exit(-1); |
173 } | |
174 | |
175 XMatchVisualInfo(display,screen,bpp,TrueColor,&vinfo); | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
176 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_3DFX_VisualIdIs,vinfo.visualid); |
1 | 177 |
178 theCmap = XCreateColormap(display, RootWindow(display,screen), | |
179 vinfo.visual, AllocNone); | |
180 | |
181 xswa.background_pixel = 0; | |
182 xswa.border_pixel = 1; | |
183 xswa.colormap = theCmap; | |
184 xswamask = CWBackPixel | CWBorderPixel |CWColormap; | |
185 | |
186 | |
187 mywindow = XCreateWindow(display, RootWindow(display,screen), | |
188 hint.x, hint.y, hint.width, hint.height, 4, bpp,CopyFromParent,vinfo.visual,xswamask,&xswa); | |
1137
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
614
diff
changeset
|
189 vo_x11_classhint( display,mywindow,"3dfx" ); |
1 | 190 |
191 XSelectInput(display, mywindow, StructureNotifyMask); | |
192 | |
193 /* Tell other applications about this window */ | |
194 | |
10994 | 195 XSetStandardProperties(display, mywindow, title, title, None, NULL, 0, &hint); |
1 | 196 |
197 /* Map window. */ | |
198 | |
199 XMapWindow(display, mywindow); | |
200 | |
201 /* Wait for map. */ | |
202 do | |
203 { | |
204 XNextEvent(display, &xev); | |
205 } | |
206 while (xev.type != MapNotify || xev.xmap.event != mywindow); | |
207 | |
208 XSelectInput(display, mywindow, NoEventMask); | |
209 | |
210 XSync(display, False); | |
211 | |
212 return 0; | |
213 } | |
214 | |
215 static void | |
216 dump_yuv_planar(uint32_t *y, uint32_t *u, uint32_t *v, uint32_t to, uint32_t width, uint32_t height) | |
217 { | |
218 // YUV conversion works like this: | |
219 // | |
220 // We write the Y, U, and V planes separately into 3dfx YUV Planar memory | |
221 // region. The nice chip then takes these and packs them into the YUYV | |
222 // format in the regular frame buffer, starting at yuvBaseAddr, page 2 here. | |
223 // Then we tell the 3dfx to do a Screen to Screen Stretch BLT to copy all | |
224 // of the data on page 2 onto page 1, converting it to 16 bpp RGB as it goes. | |
225 // The result is a nice image on page 1 ready for display. | |
226 | |
227 uint32_t j; | |
228 uint32_t y_imax, uv_imax, jmax; | |
229 | |
230 reg_YUV->yuvBaseAddr = to; | |
231 reg_YUV->yuvStride = screenwidth*2; | |
232 | |
233 LOG("video_out_3dfx: starting planar dump\n"); | |
234 jmax = height>>1; // vidheight/2, height of U and V planes | |
235 y_imax = width; // Y plane is twice as wide as U and V planes | |
236 uv_imax = width>>1; // vidwidth/2/4, width of U and V planes in 32-bit words | |
237 | |
238 for (j=0;j<jmax;j++) | |
239 { | |
240 //XXX this should be hand-rolled 32 bit memcpy for safeness. | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
21977
diff
changeset
|
241 fast_memcpy(fb_YUV->U + (uint32_t) VOODOO_YUV_STRIDE* j ,((uint8_t*) u) + uv_imax* j , uv_imax); |
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
21977
diff
changeset
|
242 fast_memcpy(fb_YUV->V + (uint32_t) VOODOO_YUV_STRIDE* j ,((uint8_t*) v) + uv_imax* j , uv_imax); |
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
21977
diff
changeset
|
243 fast_memcpy(fb_YUV->Y + (uint32_t) VOODOO_YUV_STRIDE* (j<<1) ,((uint8_t*) y) + y_imax * (j<<1) , y_imax); |
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
21977
diff
changeset
|
244 fast_memcpy(fb_YUV->Y + (uint32_t) VOODOO_YUV_STRIDE*((j<<1)+1),((uint8_t*) y) + y_imax *((j<<1)+1), y_imax); |
1 | 245 } |
246 LOG("video_out_3dfx: done planar dump\n"); | |
247 } | |
248 | |
249 static void | |
250 screen_to_screen_stretch_blt(uint32_t to, uint32_t from, uint32_t width, uint32_t height) | |
251 { | |
252 //FIXME - this function should be called by a show_frame function that | |
253 // uses a series of blts to show only those areas not covered | |
254 // by another window | |
255 voodoo_2d_reg saved_regs; | |
256 | |
257 LOG("video_out_3dfx: saving registers\n"); | |
258 // Save VGA regs (so X kinda works when we're done) | |
259 saved_regs = *reg_2d; | |
260 | |
261 /* The following lines set up the screen to screen stretch blt from page2 to | |
262 page 1 | |
263 */ | |
264 | |
265 LOG("video_out_3dfx: setting blt registers\n"); | |
266 reg_2d->commandExtra = 4; //disable colorkeying, enable wait for v-refresh (0100b) | |
267 reg_2d->clip0Min = 0; | |
268 reg_2d->clip0Max = 0xFFFFFFFF; //no clipping | |
269 | |
270 reg_2d->srcBaseAddr = from; | |
271 reg_2d->srcXY = 0; | |
272 reg_2d->srcFormat = screenwidth*2 | VOODOO_BLT_FORMAT_YUYV; // | 1<<21; | |
273 reg_2d->srcSize = vidwidth | (vidheight << 16); | |
274 | |
275 reg_2d->dstBaseAddr = to; | |
276 reg_2d->dstXY = 0; | |
277 reg_2d->dstFormat = screenwidth*2 | VOODOO_BLT_FORMAT_16; | |
278 | |
279 reg_2d->dstSize = width | (height << 16); | |
280 | |
281 LOG("video_out_3dfx: starting blt\n"); | |
282 // Executes screen to screen stretch blt | |
283 reg_2d->command = 2 | 1<<8 | 0xCC<<24; | |
284 | |
285 LOG("video_out_3dfx: restoring regs\n"); | |
286 restore_regs(&saved_regs); | |
287 | |
288 LOG("video_out_3dfx: done blt\n"); | |
289 } | |
290 | |
291 static void | |
292 update_target(void) | |
293 { | |
294 uint32_t xp, yp, w, h, b, d; | |
295 Window root; | |
296 | |
297 XGetGeometry(display,mywindow,&root,&xp,&yp,&w,&h,&b,&d); | |
298 XTranslateCoordinates(display,mywindow,root,0,0,&xp,&yp,&root); | |
299 dispx = (uint32_t) xp; | |
300 dispy = (uint32_t) yp; | |
301 dispwidth = (uint32_t) w; | |
302 dispheight = (uint32_t) h; | |
303 | |
304 if (is_fullscreen) | |
305 targetoffset = vidpage0offset + (screenheight - dispheight)/2*screenwidth*screendepth + (screenwidth-dispwidth)/2*screendepth; | |
306 else | |
307 targetoffset = vidpage0offset + (dispy*screenwidth + dispx)*screendepth; | |
308 } | |
309 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
13056
diff
changeset
|
310 static int |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
6207
diff
changeset
|
311 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) |
1 | 312 { |
313 char *name = ":0.0"; | |
314 pioData data; | |
315 uint32_t retval; | |
316 | |
17162 | 317 //TODO use x11_common for X and window handling |
318 | |
1 | 319 if(getenv("DISPLAY")) |
320 name = getenv("DISPLAY"); | |
321 display = XOpenDisplay(name); | |
322 | |
323 screenwidth = XDisplayWidth(display,0); | |
324 screenheight = XDisplayHeight(display,0); | |
325 | |
326 page_space = screenwidth*screenheight*screendepth; | |
327 vidpage0offset = 0; | |
328 vidpage1offset = page_space; // Use third and fourth pages | |
329 vidpage2offset = page_space*2; | |
330 | |
331 signal(SIGALRM,sighup); | |
332 //alarm(120); | |
333 | |
334 // Open driver device | |
17162 | 335 if ( fd == -1 ) |
1 | 336 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
337 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_UnableToOpenDevice); |
17160
ecdffaf7118c
Do not exit() if /dev/3dfx is not available, approved by Ivan.
diego
parents:
16171
diff
changeset
|
338 return -1; |
1 | 339 } |
340 | |
341 // Store sizes for later | |
342 vidwidth = width; | |
343 vidheight = height; | |
344 | |
345 is_fullscreen = fullscreen = 0; | |
346 if (!is_fullscreen) | |
10994 | 347 create_window(display, title); |
1 | 348 |
349 // Ask 3dfx driver for base memory address 0 | |
350 data.port = 0x10; // PCI_BASE_ADDRESS_0_LINUX; | |
351 data.size = 4; | |
352 data.value = &baseAddr0; | |
353 data.device = 0; | |
354 if ((retval = ioctl(fd,_IOC(_IOC_READ,'3',3,0),&data)) < 0) | |
355 { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
356 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_Error,retval); |
17162 | 357 return -1; |
1 | 358 } |
359 | |
360 // Ask 3dfx driver for base memory address 1 | |
361 data.port = 0x14; // PCI_BASE_ADDRESS_1_LINUX; | |
362 data.size = 4; | |
363 data.value = &baseAddr1; | |
364 data.device = 0; | |
365 if ((retval = ioctl(fd,_IOC(_IOC_READ,'3',3,0),&data)) < 0) | |
366 { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
367 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_Error,retval); |
17162 | 368 return -1; |
1 | 369 } |
370 | |
371 // Map all 3dfx memory areas | |
372 memBase0 = mmap(0,0x1000000,PROT_READ | PROT_WRITE,MAP_SHARED,fd,baseAddr0); | |
373 memBase1 = mmap(0,3*page_space,PROT_READ | PROT_WRITE,MAP_SHARED,fd,baseAddr1); | |
374 if (memBase0 == (uint32_t *) 0xFFFFFFFF || memBase1 == (uint32_t *) 0xFFFFFFFF) | |
375 { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
376 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_CouldntMapMemoryArea, |
1 | 377 memBase0,memBase1,errno); |
378 } | |
379 | |
380 // Set up global pointers | |
381 reg_IO = (void *)memBase0 + VOODOO_IO_REG_OFFSET; | |
382 reg_2d = (void *)memBase0 + VOODOO_2D_REG_OFFSET; | |
383 reg_YUV = (void *)memBase0 + VOODOO_YUV_REG_OFFSET; | |
384 fb_YUV = (void *)memBase0 + VOODOO_YUV_PLANE_OFFSET; | |
385 | |
386 vidpage0 = (void *)memBase1 + (unsigned long int)vidpage0offset; | |
387 vidpage1 = (void *)memBase1 + (unsigned long int)vidpage1offset; | |
388 vidpage2 = (void *)memBase1 + (unsigned long int)vidpage2offset; | |
389 | |
390 // Clear pages 1,2,3 | |
391 // leave page 0, that belongs to X. | |
392 // So does part of 1. Oops. | |
393 memset(vidpage1,0x00,page_space); | |
394 memset(vidpage2,0x00,page_space); | |
395 | |
396 if (is_fullscreen) | |
397 memset(vidpage0,0x00,page_space); | |
398 | |
399 | |
400 #ifndef VOODOO_DEBUG | |
401 // Show page 0 (unblanked) | |
402 reg_IO->vidDesktopStartAddr = vidpage0offset; | |
403 | |
404 /* Stop X from messing with my video registers! | |
405 Find a better way to do this? | |
406 Currently I use DGA to tell XF86 to not screw with registers, but I can't really use it | |
407 to do FB stuff because I need to know the absolute FB position and offset FB position | |
408 to feed to BLT command | |
409 */ | |
410 //XF86DGADirectVideo(display,0,XF86DGADirectGraphics); //| XF86DGADirectMouse | XF86DGADirectKeyb); | |
411 #endif | |
412 | |
413 atexit(restore); | |
414 | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
415 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_3DFX_DisplayInitialized,memBase1); |
1 | 416 return 0; |
417 } | |
418 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
13056
diff
changeset
|
419 static int |
1 | 420 draw_frame(uint8_t *src[]) |
421 { | |
422 LOG("video_out_3dfx: starting display_frame\n"); | |
423 | |
424 // Put packed data onto page 2 | |
425 dump_yuv_planar((uint32_t *)src[0],(uint32_t *)src[1],(uint32_t *)src[2], | |
426 vidpage2offset,vidwidth,vidheight); | |
427 | |
428 LOG("video_out_3dfx: done display_frame\n"); | |
429 return 0; | |
430 } | |
431 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
13056
diff
changeset
|
432 static int |
1978 | 433 //draw_slice(uint8_t *src[], uint32_t slice_num) |
434 draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) | |
1 | 435 { |
436 uint32_t target; | |
437 | |
1978 | 438 target = vidpage2offset + (screenwidth*2 * y); |
439 dump_yuv_planar((uint32_t *)src[0],(uint32_t *)src[1],(uint32_t *)src[2],target,vidwidth,h); | |
1 | 440 return 0; |
441 } | |
442 | |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1137
diff
changeset
|
443 static void draw_osd(void) |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1137
diff
changeset
|
444 { |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1137
diff
changeset
|
445 } |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1137
diff
changeset
|
446 |
1 | 447 static void |
448 flip_page(void) | |
449 { | |
450 //FIXME - update_target() should be called by event handler when window | |
451 // is resized or moved | |
452 update_target(); | |
453 LOG("video_out_3dfx: calling blt function\n"); | |
454 screen_to_screen_stretch_blt(targetoffset, vidpage2offset, dispwidth, dispheight); | |
455 } | |
456 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
13056
diff
changeset
|
457 static int |
1 | 458 query_format(uint32_t format) |
459 { | |
6207 | 460 /* does this supports scaling? up & down? */ |
1 | 461 switch(format){ |
462 case IMGFMT_YV12: | |
463 // case IMGFMT_YUY2: | |
464 // case IMGFMT_RGB|24: | |
465 // case IMGFMT_BGR|24: | |
6207 | 466 return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW; |
1 | 467 } |
468 return 0; | |
469 } | |
470 | |
471 static void | |
472 uninit(void) | |
473 { | |
17162 | 474 if( fd != -1 ) |
475 close(fd); | |
1 | 476 } |
477 | |
478 | |
31 | 479 static void check_events(void) |
480 { | |
481 } | |
482 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
13056
diff
changeset
|
483 static int preinit(const char *arg) |
4352 | 484 { |
17162 | 485 if ( (fd = open("/dev/3dfx",O_RDWR) ) == -1) |
486 { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
487 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_UnableToOpenDevice); |
17162 | 488 return -1; |
489 } | |
490 | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
491 if(arg) |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
492 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17162
diff
changeset
|
493 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_3DFX_UnknownSubdevice,arg); |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
494 return ENOSYS; |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
495 } |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
496 return 0; |
4352 | 497 } |
31 | 498 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
13056
diff
changeset
|
499 static int control(uint32_t request, void *data, ...) |
4352 | 500 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
501 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
502 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
503 return query_format(*((uint32_t*)data)); |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
504 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
505 return VO_NOTIMPL; |
4352 | 506 } |