Mercurial > mplayer.hg
annotate libvo/vo_gl.c @ 4582:9c13e907f284
applied patch from Andres Johansson
author | gabucino |
---|---|
date | Fri, 08 Feb 2002 13:54:57 +0000 |
parents | ab4ec4b99531 |
children | 5fbfd8545c3b |
rev | line source |
---|---|
1 | 1 #define DISP |
2 | |
3 // this can be 3 or 4 (regarding 24bpp and 32bpp) | |
4 #define BYTES_PP 3 | |
5 | |
6 #define TEXTUREFORMAT_32BPP | |
7 | |
8 /* | |
9 * video_out_gl.c, X11/OpenGL interface | |
10 * based on video_out_x11 by Aaron Holtzman, | |
11 * and WS opengl window manager by Pontscho/Fresh! | |
12 */ | |
13 | |
14 #include <stdio.h> | |
15 #include <stdlib.h> | |
16 #include <string.h> | |
17 #include <math.h> | |
18 | |
19 #include "config.h" | |
20 #include "video_out.h" | |
21 #include "video_out_internal.h" | |
22 | |
23 | |
24 LIBVO_EXTERN(gl) | |
25 | |
26 #include <X11/Xlib.h> | |
27 #include <X11/Xutil.h> | |
28 //#include <X11/keysym.h> | |
29 #include <GL/glx.h> | |
30 #include <errno.h> | |
2732 | 31 #include "../postproc/rgb2rgb.h" |
1 | 32 |
33 #include <GL/gl.h> | |
34 | |
31 | 35 #include "x11_common.h" |
2057 | 36 #include "aspect.h" |
31 | 37 |
1 | 38 static vo_info_t vo_info = |
39 { | |
40 "X11 (OpenGL)", | |
41 "gl", | |
42 "Arpad Gereoffy <arpi@esp-team.scene.hu>", | |
43 "" | |
44 }; | |
45 | |
46 /* private prototypes */ | |
1109 | 47 // static void Display_Image (unsigned char *ImageData); |
1 | 48 |
49 /* local data */ | |
50 static unsigned char *ImageData=NULL; | |
51 | |
52 /* X11 related variables */ | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
53 //static Display *mydisplay; |
1 | 54 static Window mywindow; |
55 //static GC mygc; | |
56 //static XImage *myximage; | |
57 //static int depth,mode; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
58 //static XWindowAttributes attribs; |
1 | 59 static int X_already_started = 0; |
60 | |
1109 | 61 //static int texture_id=1; |
1 | 62 |
63 static GLXContext wsGLXContext; | |
64 //XVisualInfo * wsVisualInfo; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
65 static int wsGLXAttrib[] = { GLX_RGBA, |
1 | 66 GLX_RED_SIZE,1, |
67 GLX_GREEN_SIZE,1, | |
68 GLX_BLUE_SIZE,1, | |
69 // GLX_DEPTH_SIZE,16, | |
70 GLX_DOUBLEBUFFER, | |
71 None }; | |
72 | |
73 | |
74 static uint32_t image_width; | |
75 static uint32_t image_height; | |
76 static uint32_t image_format; | |
77 static uint32_t image_bpp; | |
78 static uint32_t image_bytes; | |
79 | |
80 static uint32_t texture_width; | |
81 static uint32_t texture_height; | |
82 | |
612 | 83 static void resize(int x,int y){ |
1290 | 84 printf("[gl] Resize: %dx%d\n",x,y); |
1 | 85 glViewport( 0, 0, x, y ); |
86 | |
87 glMatrixMode(GL_PROJECTION); | |
88 glLoadIdentity(); | |
89 glOrtho(0, image_width, image_height, 0, -1,1); | |
90 | |
91 glMatrixMode(GL_MODELVIEW); | |
92 glLoadIdentity(); | |
93 } | |
94 | |
95 /* connect to server, create and map window, | |
96 * allocate colors and (shared) memory | |
97 */ | |
98 static uint32_t | |
4448
ab4ec4b99531
change init to config in vo_gl and vo_md5 like in the other vo_ modules -- fixes crash caused by the changeover
rfelker
parents:
4440
diff
changeset
|
99 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format,const vo_tune_info_t *info) |
1 | 100 { |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
101 // int screen; |
1 | 102 unsigned int fg, bg; |
103 char *hello = (title == NULL) ? "OpenGL rulez" : title; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
104 // char *name = ":0.0"; |
1 | 105 XSizeHints hint; |
106 XVisualInfo *vinfo; | |
107 XEvent xev; | |
108 | |
1109 | 109 // XGCValues xgcv; |
1 | 110 XSetWindowAttributes xswa; |
111 unsigned long xswamask; | |
112 | |
113 image_height = height; | |
114 image_width = width; | |
115 image_format = format; | |
116 | |
117 if (X_already_started) return -1; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
118 if(!vo_init()) return -1; |
1 | 119 |
2249
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
120 aspect_save_orig(width,height); |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
121 aspect_save_prescale(d_width,d_height); |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
122 aspect_save_screenres(vo_screenwidth,vo_screenheight); |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
123 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
124 X_already_started++; |
1 | 125 |
2249
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
126 aspect(&d_width,&d_height,A_NOZOOM); |
2040 | 127 #ifdef X11_FULLSCREEN |
2057 | 128 if( flags&0x01 ){ // (-fs) |
2249
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
129 aspect(&d_width,&d_height,A_ZOOM); |
2040 | 130 } |
131 #endif | |
1 | 132 hint.x = 0; |
133 hint.y = 0; | |
134 hint.width = d_width; | |
135 hint.height = d_height; | |
136 hint.flags = PPosition | PSize; | |
137 | |
138 /* Get some colors */ | |
139 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
140 bg = WhitePixel(mDisplay, mScreen); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
141 fg = BlackPixel(mDisplay, mScreen); |
1 | 142 |
143 /* Make the window */ | |
144 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
145 // XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &attribs); |
1 | 146 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
147 // XMatchVisualInfo(mDisplay, screen, depth, TrueColor, &vinfo); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
148 vinfo=glXChooseVisual( mDisplay,mScreen,wsGLXAttrib ); |
1290 | 149 if (vinfo == NULL) |
150 { | |
151 printf("[gl] no GLX support present\n"); | |
152 return -1; | |
153 } | |
1 | 154 |
155 xswa.background_pixel = 0; | |
156 xswa.border_pixel = 1; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
157 // xswa.colormap = XCreateColormap(mDisplay, mRootWin, vinfo.visual, AllocNone); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
158 xswa.colormap = XCreateColormap(mDisplay, mRootWin, vinfo->visual, AllocNone); |
1 | 159 xswamask = CWBackPixel | CWBorderPixel | CWColormap; |
160 // xswamask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWCursor | CWOverrideRedirect | CWSaveUnder | CWX | CWY | CWWidth | CWHeight; | |
161 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
162 mywindow = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen), |
1 | 163 hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa); |
1137
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
164 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
165 vo_x11_classhint( mDisplay,mywindow,"gl" ); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
166 vo_hidecursor(mDisplay,mywindow); |
1 | 167 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
168 wsGLXContext=glXCreateContext( mDisplay,vinfo,NULL,True ); |
1 | 169 // XStoreName( wsDisplay,wsMyWin,wsSysName ); |
170 | |
171 // printf("GLXcontext ok\n"); | |
172 | |
2057 | 173 if ( flags&0x01 ) vo_x11_decoration( mDisplay,mywindow,0 ); |
1 | 174 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
175 XSelectInput(mDisplay, mywindow, StructureNotifyMask); |
1 | 176 |
177 /* Tell other applications about this window */ | |
178 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
179 XSetStandardProperties(mDisplay, mywindow, hello, hello, None, NULL, 0, &hint); |
1 | 180 |
181 /* Map window. */ | |
182 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
183 XMapWindow(mDisplay, mywindow); |
4017 | 184 #ifdef HAVE_XINERAMA |
185 vo_x11_xinerama_move(mDisplay,mywindow); | |
186 #endif | |
1 | 187 |
188 /* Wait for map. */ | |
189 do | |
190 { | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
191 XNextEvent(mDisplay, &xev); |
1 | 192 } |
193 while (xev.type != MapNotify || xev.xmap.event != mywindow); | |
194 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
195 XSelectInput(mDisplay, mywindow, NoEventMask); |
1 | 196 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
197 glXMakeCurrent( mDisplay,mywindow,wsGLXContext ); |
1 | 198 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
199 XFlush(mDisplay); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
200 XSync(mDisplay, False); |
1 | 201 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
202 // mygc = XCreateGC(mDisplay, mywindow, 0L, &xgcv); |
1 | 203 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
204 // myximage = XGetImage(mDisplay, mywindow, 0, 0, |
1 | 205 // width, image_height, AllPlanes, ZPixmap); |
206 // ImageData = myximage->data; | |
207 // bpp = myximage->bits_per_pixel; | |
208 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
209 //XSelectInput(mDisplay, mywindow, StructureNotifyMask); // !!!! |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
210 XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask ); |
1 | 211 |
212 // printf("Window setup ok\n"); | |
213 | |
214 #if 0 | |
215 // If we have blue in the lowest bit then obviously RGB | |
216 mode = ((myximage->blue_mask & 0x01) != 0) ? MODE_RGB : MODE_BGR; | |
217 #ifdef WORDS_BIGENDIAN | |
218 if (myximage->byte_order != MSBFirst) | |
219 #else | |
220 if (myximage->byte_order != LSBFirst) | |
221 #endif | |
222 { | |
1302 | 223 printf("[gl] no support for non-native XImage byte order!\n"); |
1 | 224 return -1; |
225 } | |
226 | |
227 printf("DEPTH=%d BPP=%d\n",depth,bpp); | |
228 #endif | |
229 | |
230 /* | |
231 * If depth is 24 then it may either be a 3 or 4 byte per pixel | |
232 * format. We can't use bpp because then we would lose the | |
233 * distinction between 15/16bit depth (2 byte formate assumed). | |
234 * | |
235 * FIXME - change yuv2rgb_init to take both depth and bpp | |
236 * parameters | |
237 */ | |
238 | |
239 texture_width=32; | |
240 while(texture_width<image_width) texture_width*=2; | |
241 while(texture_width<image_height) texture_width*=2; | |
242 texture_height=texture_width; | |
243 | |
244 if(format==IMGFMT_YV12){ | |
245 yuv2rgb_init(8*BYTES_PP, MODE_BGR); | |
1290 | 246 printf("[gl] YUV init OK!\n"); |
1 | 247 image_bpp=8*BYTES_PP; |
248 image_bytes=BYTES_PP; | |
249 } else { | |
250 image_bpp=format&0xFF; | |
251 image_bytes=(image_bpp+7)/8; | |
252 } | |
253 | |
254 ImageData=malloc(texture_width*texture_height*image_bytes); | |
255 memset(ImageData,128,texture_width*texture_height*image_bytes); | |
256 | |
257 glDisable(GL_BLEND); | |
258 glDisable(GL_DEPTH_TEST); | |
259 glDepthMask(GL_FALSE); | |
260 glDisable(GL_CULL_FACE); | |
261 | |
262 glEnable(GL_TEXTURE_2D); | |
263 | |
1290 | 264 printf("[gl] Creating %dx%d texture...\n",texture_width,texture_height); |
1 | 265 |
266 #if 1 | |
267 // glBindTexture(GL_TEXTURE_2D, texture_id); | |
268 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); | |
269 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); | |
270 #ifdef TEXTUREFORMAT_32BPP | |
271 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, texture_width, texture_height, 0, | |
272 #else | |
273 glTexImage2D(GL_TEXTURE_2D, 0, BYTES_PP, texture_width, texture_height, 0, | |
274 #endif | |
275 (image_bytes==4)?GL_RGBA:GL_BGR, GL_UNSIGNED_BYTE, ImageData); | |
276 #endif | |
277 | |
278 resize(d_width,d_height); | |
279 | |
280 glClearColor( 1.0f,0.0f,1.0f,0.0f ); | |
281 glClear( GL_COLOR_BUFFER_BIT ); | |
282 | |
283 // printf("OpenGL setup OK!\n"); | |
284 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
285 saver_off(mDisplay); // turning off screen saver |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
286 |
1 | 287 return 0; |
288 } | |
289 | |
290 static const vo_info_t* | |
291 get_info(void) | |
292 { | |
293 return &vo_info; | |
294 } | |
295 | |
31 | 296 static void check_events(void) |
1 | 297 { |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
298 int e=vo_x11_check_events(mDisplay); |
31 | 299 if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight); |
300 } | |
1 | 301 |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
302 static void draw_osd(void) |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
303 { |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
304 } |
31 | 305 |
306 static void | |
307 flip_page(void) | |
308 { | |
309 | |
1 | 310 // glEnable(GL_TEXTURE_2D); |
311 // glBindTexture(GL_TEXTURE_2D, texture_id); | |
312 | |
313 glColor3f(1,1,1); | |
314 glBegin(GL_QUADS); | |
315 glTexCoord2f(0,0);glVertex2i(0,0); | |
316 glTexCoord2f(0,1);glVertex2i(0,texture_height); | |
317 glTexCoord2f(1,1);glVertex2i(texture_width,texture_height); | |
318 glTexCoord2f(1,0);glVertex2i(texture_width,0); | |
319 glEnd(); | |
320 | |
321 // glFlush(); | |
322 glFinish(); | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
323 glXSwapBuffers( mDisplay,mywindow ); |
1 | 324 |
325 } | |
326 | |
327 //static inline uint32_t draw_slice_x11(uint8_t *src[], uint32_t slice_num) | |
328 static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) | |
329 { | |
330 int i; | |
331 int dstride=w*BYTES_PP; | |
332 | |
333 // dstride=(dstride+15)&(~15); | |
334 | |
335 yuv2rgb(ImageData, src[0], src[1], src[2], | |
336 w,h, dstride, stride[0],stride[1]); | |
337 | |
338 // emms (); | |
339 | |
340 for(i=0;i<h;i++){ | |
341 glTexSubImage2D( GL_TEXTURE_2D, // target | |
342 0, // level | |
343 x, // x offset | |
344 y+i, // y offset | |
345 w, // width | |
346 1, // height | |
347 (BYTES_PP==4)?GL_RGBA:GL_RGB, // format | |
348 GL_UNSIGNED_BYTE, // type | |
349 ImageData+i*dstride ); // *pixels | |
350 } | |
351 | |
352 return 0; | |
353 } | |
354 | |
355 static inline uint32_t | |
356 draw_frame_x11_yv12(uint8_t *src[]) | |
357 { | |
358 int i; | |
359 // printf("Converting YUV->RGB...\n"); | |
360 yuv2rgb(ImageData, src[0], src[1], src[2], | |
361 image_width, image_height, | |
362 image_width*BYTES_PP, image_width, image_width/2 ); | |
363 // printf("Ready!\n"); | |
364 | |
365 // emms (); | |
366 | |
367 for(i=0;i<image_height;i++){ | |
368 glTexSubImage2D( GL_TEXTURE_2D, // target | |
369 0, // level | |
370 0, // x offset | |
371 i, // y offset | |
372 image_width, // width | |
373 1, // height | |
374 (BYTES_PP==4)?GL_RGBA:GL_RGB, // format | |
375 GL_UNSIGNED_BYTE, // type | |
376 ImageData+i*BYTES_PP*image_width ); // *pixels | |
377 } | |
378 | |
379 // Display_Image(ImageData); | |
380 return 0; | |
381 } | |
382 | |
383 | |
384 static inline uint32_t | |
385 draw_frame_x11_bgr(uint8_t *src[]) | |
386 { | |
387 int i; | |
388 uint8_t *s=src[0]; | |
389 uint8_t *de=&ImageData[3*image_width]; | |
390 | |
391 for(i=0;i<image_height;i++){ | |
392 uint8_t *d=ImageData; | |
393 while(d<de){ | |
394 d[0]=s[2]; | |
395 d[1]=s[1]; | |
396 d[2]=s[0]; | |
397 s+=3;d+=3; | |
398 } | |
399 glTexSubImage2D( GL_TEXTURE_2D, // target | |
400 0, // level | |
401 0, // x offset | |
402 // image_height-1-i, // y offset | |
403 i, // y offset | |
404 image_width, // width | |
405 1, // height | |
406 (image_bytes==4)?GL_RGBA:GL_RGB, // format | |
407 GL_UNSIGNED_BYTE, // type | |
408 ImageData); // *pixels | |
409 } | |
410 | |
411 // Display_Image(ImageData); | |
412 return 0; | |
413 } | |
414 | |
415 static inline uint32_t | |
416 draw_frame_x11_rgb(uint8_t *src[]) | |
417 { | |
418 int i; | |
419 uint8_t *ImageData=src[0]; | |
420 | |
421 for(i=0;i<image_height;i++){ | |
422 glTexSubImage2D( GL_TEXTURE_2D, // target | |
423 0, // level | |
424 0, // x offset | |
425 // image_height-1-i, // y offset | |
426 i, // y offset | |
427 image_width, // width | |
428 1, // height | |
429 (image_bytes==4)?GL_RGBA:GL_RGB, // format | |
430 GL_UNSIGNED_BYTE, // type | |
431 ImageData+i*image_bytes*image_width ); // *pixels | |
432 } | |
433 | |
434 // Display_Image(ImageData); | |
435 return 0; | |
436 } | |
437 | |
438 | |
439 static uint32_t | |
440 draw_frame(uint8_t *src[]) | |
441 { | |
442 if(image_format==IMGFMT_YV12) | |
443 return draw_frame_x11_yv12(src); | |
444 else | |
445 if((image_format&IMGFMT_RGB_MASK)==IMGFMT_RGB) | |
446 return draw_frame_x11_rgb(src); | |
447 else | |
448 return draw_frame_x11_bgr(src); | |
449 } | |
450 | |
451 static uint32_t | |
452 query_format(uint32_t format) | |
453 { | |
454 switch(format){ | |
455 case IMGFMT_YV12: | |
456 case IMGFMT_RGB|24: | |
457 case IMGFMT_BGR|24: | |
458 return 1; | |
459 } | |
460 return 0; | |
461 } | |
462 | |
463 | |
464 static void | |
465 uninit(void) | |
466 { | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
467 saver_on(mDisplay); // screen saver back on |
4440
0824e6605974
removed obsoleted Terminate_Display_Process, using vo_x11_uninit
alex
parents:
4433
diff
changeset
|
468 |
0824e6605974
removed obsoleted Terminate_Display_Process, using vo_x11_uninit
alex
parents:
4433
diff
changeset
|
469 vo_x11_uninit(mDisplay, mywindow); |
1 | 470 } |
4352 | 471 |
472 static uint32_t preinit(const char *arg) | |
473 { | |
474 return 0; | |
475 } | |
476 | |
477 static void query_vaa(vo_vaa_t *vaa) | |
478 { | |
479 memset(vaa,0,sizeof(vo_vaa_t)); | |
480 } |