Mercurial > mplayer.hg
annotate libvo/vo_gl.c @ 9174:0333afac3a56
closing some tags in Zr section
author | gabucino |
---|---|
date | Thu, 30 Jan 2003 19:32:19 +0000 |
parents | 2c4cebb8637d |
children | 5e286cc6ad21 |
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 #include <stdio.h> | |
9 #include <stdlib.h> | |
10 #include <string.h> | |
11 #include <math.h> | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4658
diff
changeset
|
12 #include <errno.h> |
1 | 13 |
14 #include "config.h" | |
15 #include "video_out.h" | |
16 #include "video_out_internal.h" | |
17 | |
18 #include <X11/Xlib.h> | |
19 #include <X11/Xutil.h> | |
20 //#include <X11/keysym.h> | |
21 #include <GL/glx.h> | |
22 #include <errno.h> | |
2732 | 23 #include "../postproc/rgb2rgb.h" |
1 | 24 |
25 #include <GL/gl.h> | |
26 | |
31 | 27 #include "x11_common.h" |
2057 | 28 #include "aspect.h" |
31 | 29 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7931
diff
changeset
|
30 static vo_info_t info = |
1 | 31 { |
32 "X11 (OpenGL)", | |
33 "gl", | |
34 "Arpad Gereoffy <arpi@esp-team.scene.hu>", | |
35 "" | |
36 }; | |
37 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7931
diff
changeset
|
38 LIBVO_EXTERN(gl) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7931
diff
changeset
|
39 |
1 | 40 /* local data */ |
41 static unsigned char *ImageData=NULL; | |
42 | |
43 static GLXContext wsGLXContext; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
44 static int wsGLXAttrib[] = { GLX_RGBA, |
1 | 45 GLX_RED_SIZE,1, |
46 GLX_GREEN_SIZE,1, | |
47 GLX_BLUE_SIZE,1, | |
48 GLX_DOUBLEBUFFER, | |
49 None }; | |
50 | |
51 | |
52 static uint32_t image_width; | |
53 static uint32_t image_height; | |
54 static uint32_t image_format; | |
55 static uint32_t image_bpp; | |
56 static uint32_t image_bytes; | |
57 | |
58 static uint32_t texture_width; | |
59 static uint32_t texture_height; | |
60 | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
61 static int slice_height=1; |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
62 |
612 | 63 static void resize(int x,int y){ |
1290 | 64 printf("[gl] Resize: %dx%d\n",x,y); |
1 | 65 glViewport( 0, 0, x, y ); |
66 | |
67 glMatrixMode(GL_PROJECTION); | |
68 glLoadIdentity(); | |
69 glOrtho(0, image_width, image_height, 0, -1,1); | |
70 | |
71 glMatrixMode(GL_MODELVIEW); | |
72 glLoadIdentity(); | |
73 } | |
74 | |
75 /* connect to server, create and map window, | |
76 * allocate colors and (shared) memory | |
77 */ | |
78 static uint32_t | |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
7111
diff
changeset
|
79 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) |
1 | 80 { |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
81 // int screen; |
1 | 82 unsigned int fg, bg; |
83 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
|
84 // char *name = ":0.0"; |
1 | 85 XSizeHints hint; |
86 XVisualInfo *vinfo; | |
87 XEvent xev; | |
88 | |
1109 | 89 // XGCValues xgcv; |
1 | 90 XSetWindowAttributes xswa; |
91 unsigned long xswamask; | |
92 | |
93 image_height = height; | |
94 image_width = width; | |
95 image_format = format; | |
96 | |
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
|
97 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
|
98 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
|
99 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
|
100 |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
101 aspect(&d_width,&d_height,A_NOZOOM); |
2040 | 102 #ifdef X11_FULLSCREEN |
6095 | 103 // if( flags&0x01 ){ // (-fs) |
104 // aspect(&d_width,&d_height,A_ZOOM); | |
105 // } | |
2040 | 106 #endif |
1 | 107 hint.x = 0; |
108 hint.y = 0; | |
109 hint.width = d_width; | |
110 hint.height = d_height; | |
111 hint.flags = PPosition | PSize; | |
112 | |
113 /* Get some colors */ | |
114 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
115 bg = WhitePixel(mDisplay, mScreen); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
116 fg = BlackPixel(mDisplay, mScreen); |
1 | 117 |
118 /* Make the window */ | |
119 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
120 vinfo=glXChooseVisual( mDisplay,mScreen,wsGLXAttrib ); |
1290 | 121 if (vinfo == NULL) |
122 { | |
123 printf("[gl] no GLX support present\n"); | |
124 return -1; | |
125 } | |
1 | 126 |
127 xswa.background_pixel = 0; | |
128 xswa.border_pixel = 1; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
129 xswa.colormap = XCreateColormap(mDisplay, mRootWin, vinfo->visual, AllocNone); |
1 | 130 xswamask = CWBackPixel | CWBorderPixel | CWColormap; |
1137
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
131 |
7777 | 132 if ( vo_window == None ) |
133 { | |
134 vo_window = XCreateWindow(mDisplay, mRootWin, | |
135 hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa); | |
1 | 136 |
7777 | 137 vo_x11_classhint( mDisplay,vo_window,"gl" ); |
138 vo_hidecursor(mDisplay,vo_window); | |
1 | 139 |
7777 | 140 // if ( flags&0x01 ) vo_x11_decoration( mDisplay,vo_window,0 ); |
141 XSelectInput(mDisplay, vo_window, StructureNotifyMask); | |
142 /* Tell other applications about this window */ | |
143 XSetStandardProperties(mDisplay, vo_window, hello, hello, None, NULL, 0, &hint); | |
144 /* Map window. */ | |
145 XMapWindow(mDisplay, vo_window); | |
146 if ( flags&1 ) vo_x11_fullscreen(); | |
4017 | 147 #ifdef HAVE_XINERAMA |
7777 | 148 vo_x11_xinerama_move(mDisplay,vo_window); |
4017 | 149 #endif |
1 | 150 |
7777 | 151 /* Wait for map. */ |
152 do | |
153 { | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
154 XNextEvent(mDisplay, &xev); |
7777 | 155 } |
156 while (xev.type != MapNotify || xev.xmap.event != vo_window); | |
1 | 157 |
7777 | 158 XSelectInput(mDisplay, vo_window, NoEventMask); |
159 } | |
1 | 160 |
7777 | 161 if ( vo_config_count ) glXDestroyContext( mDisplay,wsGLXContext ); |
162 wsGLXContext=glXCreateContext( mDisplay,vinfo,NULL,True ); | |
163 glXMakeCurrent( mDisplay,vo_window,wsGLXContext ); | |
1 | 164 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
165 XFlush(mDisplay); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
166 XSync(mDisplay, False); |
1 | 167 |
6953
ce67cc1f0beb
ignore BadAccess error at XSelectInput() (grabbing mouse etc) with warning
arpi
parents:
6212
diff
changeset
|
168 vo_x11_selectinput_witherr(mDisplay, vo_window, StructureNotifyMask | KeyPressMask | PointerMotionMask |
4658 | 169 | ButtonPressMask | ButtonReleaseMask |
170 ); | |
1 | 171 |
172 #if 0 | |
173 // If we have blue in the lowest bit then obviously RGB | |
174 mode = ((myximage->blue_mask & 0x01) != 0) ? MODE_RGB : MODE_BGR; | |
175 #ifdef WORDS_BIGENDIAN | |
176 if (myximage->byte_order != MSBFirst) | |
177 #else | |
178 if (myximage->byte_order != LSBFirst) | |
179 #endif | |
180 { | |
1302 | 181 printf("[gl] no support for non-native XImage byte order!\n"); |
1 | 182 return -1; |
183 } | |
184 | |
185 printf("DEPTH=%d BPP=%d\n",depth,bpp); | |
186 #endif | |
187 | |
188 /* | |
189 * If depth is 24 then it may either be a 3 or 4 byte per pixel | |
190 * format. We can't use bpp because then we would lose the | |
191 * distinction between 15/16bit depth (2 byte formate assumed). | |
192 * | |
193 * FIXME - change yuv2rgb_init to take both depth and bpp | |
194 * parameters | |
195 */ | |
196 | |
197 texture_width=32; | |
198 while(texture_width<image_width) texture_width*=2; | |
199 while(texture_width<image_height) texture_width*=2; | |
200 texture_height=texture_width; | |
201 | |
202 if(format==IMGFMT_YV12){ | |
203 yuv2rgb_init(8*BYTES_PP, MODE_BGR); | |
1290 | 204 printf("[gl] YUV init OK!\n"); |
1 | 205 image_bpp=8*BYTES_PP; |
206 image_bytes=BYTES_PP; | |
207 } else { | |
208 image_bpp=format&0xFF; | |
209 image_bytes=(image_bpp+7)/8; | |
210 } | |
211 | |
7777 | 212 if ( ImageData ) free( ImageData ); |
1 | 213 ImageData=malloc(texture_width*texture_height*image_bytes); |
214 memset(ImageData,128,texture_width*texture_height*image_bytes); | |
215 | |
216 glDisable(GL_BLEND); | |
217 glDisable(GL_DEPTH_TEST); | |
218 glDepthMask(GL_FALSE); | |
219 glDisable(GL_CULL_FACE); | |
220 | |
221 glEnable(GL_TEXTURE_2D); | |
222 | |
1290 | 223 printf("[gl] Creating %dx%d texture...\n",texture_width,texture_height); |
1 | 224 |
225 #if 1 | |
226 // glBindTexture(GL_TEXTURE_2D, texture_id); | |
227 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); | |
228 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); | |
229 #ifdef TEXTUREFORMAT_32BPP | |
230 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, texture_width, texture_height, 0, | |
231 #else | |
232 glTexImage2D(GL_TEXTURE_2D, 0, BYTES_PP, texture_width, texture_height, 0, | |
233 #endif | |
234 (image_bytes==4)?GL_RGBA:GL_BGR, GL_UNSIGNED_BYTE, ImageData); | |
235 #endif | |
236 | |
237 resize(d_width,d_height); | |
238 | |
239 glClearColor( 1.0f,0.0f,1.0f,0.0f ); | |
240 glClear( GL_COLOR_BUFFER_BIT ); | |
241 | |
242 // printf("OpenGL setup OK!\n"); | |
243 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
244 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
|
245 |
1 | 246 return 0; |
247 } | |
248 | |
31 | 249 static void check_events(void) |
1 | 250 { |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
251 int e=vo_x11_check_events(mDisplay); |
31 | 252 if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight); |
253 } | |
1 | 254 |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
255 static void draw_osd(void) |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
256 { |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
257 } |
31 | 258 |
259 static void | |
260 flip_page(void) | |
261 { | |
262 | |
1 | 263 // glEnable(GL_TEXTURE_2D); |
264 // glBindTexture(GL_TEXTURE_2D, texture_id); | |
265 | |
266 glColor3f(1,1,1); | |
267 glBegin(GL_QUADS); | |
268 glTexCoord2f(0,0);glVertex2i(0,0); | |
269 glTexCoord2f(0,1);glVertex2i(0,texture_height); | |
270 glTexCoord2f(1,1);glVertex2i(texture_width,texture_height); | |
271 glTexCoord2f(1,0);glVertex2i(texture_width,0); | |
272 glEnd(); | |
273 | |
274 // glFlush(); | |
275 glFinish(); | |
6095 | 276 glXSwapBuffers( mDisplay,vo_window ); |
277 | |
1 | 278 } |
279 | |
280 //static inline uint32_t draw_slice_x11(uint8_t *src[], uint32_t slice_num) | |
281 static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) | |
282 { | |
283 int i; | |
284 int dstride=w*BYTES_PP; | |
285 | |
286 // dstride=(dstride+15)&(~15); | |
287 | |
288 yuv2rgb(ImageData, src[0], src[1], src[2], | |
289 w,h, dstride, stride[0],stride[1]); | |
290 | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
291 for(i=0;i<h;i+=slice_height){ |
1 | 292 glTexSubImage2D( GL_TEXTURE_2D, // target |
293 0, // level | |
294 x, // x offset | |
295 y+i, // y offset | |
296 w, // width | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
297 (i+slice_height<=h)?slice_height:h-i, // height |
1 | 298 (BYTES_PP==4)?GL_RGBA:GL_RGB, // format |
299 GL_UNSIGNED_BYTE, // type | |
300 ImageData+i*dstride ); // *pixels | |
301 } | |
302 | |
303 return 0; | |
304 } | |
305 | |
306 static inline uint32_t | |
307 draw_frame_x11_yv12(uint8_t *src[]) | |
308 { | |
309 int i; | |
310 // printf("Converting YUV->RGB...\n"); | |
311 yuv2rgb(ImageData, src[0], src[1], src[2], | |
312 image_width, image_height, | |
313 image_width*BYTES_PP, image_width, image_width/2 ); | |
314 | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
315 for(i=0;i<image_height;i+=slice_height){ |
1 | 316 glTexSubImage2D( GL_TEXTURE_2D, // target |
317 0, // level | |
318 0, // x offset | |
319 i, // y offset | |
320 image_width, // width | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
321 (i+slice_height<=image_height)?slice_height:image_height-i, // height |
1 | 322 (BYTES_PP==4)?GL_RGBA:GL_RGB, // format |
323 GL_UNSIGNED_BYTE, // type | |
324 ImageData+i*BYTES_PP*image_width ); // *pixels | |
325 } | |
326 | |
327 return 0; | |
328 } | |
329 | |
330 | |
331 static inline uint32_t | |
332 draw_frame_x11_bgr(uint8_t *src[]) | |
333 { | |
334 int i; | |
335 uint8_t *s=src[0]; | |
336 | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
337 for(i=0;i<image_height;i+=slice_height){ |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
338 int h=(i+slice_height<=image_height)?slice_height:image_height-i; |
1 | 339 uint8_t *d=ImageData; |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
340 uint8_t *de=&ImageData[3*image_width*h]; |
1 | 341 while(d<de){ |
342 d[0]=s[2]; | |
343 d[1]=s[1]; | |
344 d[2]=s[0]; | |
345 s+=3;d+=3; | |
346 } | |
347 glTexSubImage2D( GL_TEXTURE_2D, // target | |
348 0, // level | |
349 0, // x offset | |
350 // image_height-1-i, // y offset | |
351 i, // y offset | |
352 image_width, // width | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
353 h, // height |
1 | 354 (image_bytes==4)?GL_RGBA:GL_RGB, // format |
355 GL_UNSIGNED_BYTE, // type | |
356 ImageData); // *pixels | |
357 } | |
358 | |
359 return 0; | |
360 } | |
361 | |
362 static inline uint32_t | |
363 draw_frame_x11_rgb(uint8_t *src[]) | |
364 { | |
365 int i; | |
366 uint8_t *ImageData=src[0]; | |
367 | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
368 for(i=0;i<image_height;i+=slice_height){ |
1 | 369 glTexSubImage2D( GL_TEXTURE_2D, // target |
370 0, // level | |
371 0, // x offset | |
372 // image_height-1-i, // y offset | |
373 i, // y offset | |
374 image_width, // width | |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
375 (i+slice_height<=image_height)?slice_height:image_height-i, // height |
1 | 376 (image_bytes==4)?GL_RGBA:GL_RGB, // format |
377 GL_UNSIGNED_BYTE, // type | |
378 ImageData+i*image_bytes*image_width ); // *pixels | |
379 } | |
380 | |
381 return 0; | |
382 } | |
383 | |
384 | |
385 static uint32_t | |
386 draw_frame(uint8_t *src[]) | |
387 { | |
388 if(image_format==IMGFMT_YV12) | |
389 return draw_frame_x11_yv12(src); | |
390 else | |
391 if((image_format&IMGFMT_RGB_MASK)==IMGFMT_RGB) | |
392 return draw_frame_x11_rgb(src); | |
393 else | |
394 return draw_frame_x11_bgr(src); | |
395 } | |
396 | |
397 static uint32_t | |
398 query_format(uint32_t format) | |
399 { | |
400 switch(format){ | |
401 case IMGFMT_YV12: | |
6212 | 402 return VFCAP_CSP_SUPPORTED; |
1 | 403 case IMGFMT_RGB|24: |
404 case IMGFMT_BGR|24: | |
6212 | 405 return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; |
1 | 406 } |
407 return 0; | |
408 } | |
409 | |
410 | |
411 static void | |
412 uninit(void) | |
413 { | |
6095 | 414 if ( !vo_config_count ) return; |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
415 saver_on(mDisplay); // screen saver back on |
6095 | 416 vo_x11_uninit(); |
1 | 417 } |
4352 | 418 |
419 static uint32_t preinit(const char *arg) | |
420 { | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4658
diff
changeset
|
421 if(arg) |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4658
diff
changeset
|
422 { |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
423 slice_height = atoi(arg); |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
424 if (slice_height <= 0) |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
425 slice_height = 65536; |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4658
diff
changeset
|
426 } |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
427 else |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
428 { |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
429 slice_height = 4; |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
430 } |
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
431 printf("[vo_gl] Using %d as slice_height (0 means image_height).\n", slice_height); |
7777 | 432 |
7931 | 433 if( !vo_init() ) return -1; // Can't open X11 |
7777 | 434 |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4658
diff
changeset
|
435 return 0; |
4352 | 436 } |
437 | |
4596 | 438 static uint32_t control(uint32_t request, void *data, ...) |
4352 | 439 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
440 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
441 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
442 return query_format(*((uint32_t*)data)); |
6095 | 443 case VOCTRL_FULLSCREEN: |
444 vo_x11_fullscreen(); | |
445 return VO_TRUE; | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
446 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
447 return VO_NOTIMPL; |
4352 | 448 } |