Hello community, here is the log from the commit of package xine-lib checked in at Sat Aug 2 06:10:54 CEST 2008. -------- --- xine-lib/xine-lib.changes 2008-07-25 14:57:19.000000000 +0200 +++ xine-lib/xine-lib.changes 2008-08-01 20:04:23.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Aug 1 20:03:30 CEST 2008 - mhopf@suse.de + +- Verify whether the visual is direct rendering capable before actually + activating the opengl plugin (bnc #402687) + +------------------------------------------------------------------- New: ---- xine-checkoglvisual.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xine-lib.spec ++++++ --- /var/tmp/diff_new_pack.Np8554/_old 2008-08-02 06:09:44.000000000 +0200 +++ /var/tmp/diff_new_pack.Np8554/_new 2008-08-02 06:09:44.000000000 +0200 @@ -34,7 +34,7 @@ %endif Recommends: opensuse-codecs-installer Version: 1.1.14 -Release: 1 +Release: 8 %define abiversion 1.23 Summary: Video Player with Plug-Ins Group: Productivity/Multimedia/Video/Players @@ -64,6 +64,7 @@ Patch72: xine-lib-1.1.7-install-plugins-helper.diff Patch73: xine-lib-assert.patch Patch74: xine-configure.diff +Patch75: xine-checkoglvisual.diff # *** Only working for noncrippled source Patch80: xine-lib-various-noncrippled.diff @@ -188,6 +189,7 @@ %patch72 -p1 %patch73 -p1 %patch74 -p1 +%patch75 -p1 rm -f m4/libtool15.m4 %build @@ -452,6 +454,9 @@ %endif %changelog +* Fri Aug 01 2008 mhopf@suse.de +- Verify whether the visual is direct rendering capable before actually + activating the opengl plugin (bnc #402687) * Fri Jul 25 2008 lnussel@suse.de - Update to 1.1.14: * DVB changes: ++++++ xine-checkoglvisual.diff ++++++ diff -r 4c4d4dd22d31 src/video_out/video_out_opengl.c --- a/src/video_out/video_out_opengl.c Wed Jul 16 14:08:24 2008 +0100 +++ b/src/video_out/video_out_opengl.c Fri Aug 01 19:34:45 2008 +0200 @@ -1953,6 +1953,51 @@ * class functions */ +static int opengl_verify_direct (x11_visual_t *vis) { + int attribs[] = { + GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + None + }; + Window root, win; + XVisualInfo *visinfo; + GLXContext ctx; + XSetWindowAttributes xattr; + int ret = 0; + + if (!vis || !vis->display || + ! (root = RootWindow (vis->display, vis->screen))) { + fprintf (stderr, "[videoout_opengl]: Don't have a root window to verify\n"); + } + if (! (visinfo = glXChooseVisual (vis->display, vis->screen, attribs))) + return 0; + if (! (ctx = glXCreateContext (vis->display, visinfo, NULL, 1))) + return 0; + memset (&xattr, 0, sizeof (xattr)); + xattr.colormap = XCreateColormap(vis->display, root, visinfo->visual, AllocNone); + xattr.event_mask = StructureNotifyMask | ExposureMask; + if ( (win = XCreateWindow (vis->display, root, 0, 0, 1, 1, 0, visinfo->depth, + InputOutput, visinfo->visual, + CWBackPixel | CWBorderPixel | CWColormap | CWEventMask, + &xattr))) { + if (glXMakeCurrent (vis->display, win, ctx)) { + const char *renderer = (const char *) glGetString(GL_RENDERER); + if (glXIsDirect (vis->display, ctx) && + ! strstr (renderer, "Software") && + ! strstr (renderer, "Indirect")) + ret = 1; + glXMakeCurrent (vis->display, None, NULL); + } + XDestroyWindow (vis->display, win); + } + glXDestroyContext (vis->display, ctx); + XFreeColormap (vis->display, xattr.colormap); + + return ret; +} + static char* opengl_get_identifier (video_driver_class_t *this_gen) { return "opengl"; } @@ -1968,7 +2013,18 @@ } static void *opengl_init_class (xine_t *xine, void *visual_gen) { - opengl_class_t *this = (opengl_class_t *) calloc(1, sizeof(opengl_class_t)); + + opengl_class_t *this; + + xprintf (xine, XINE_VERBOSITY_LOG, + "video_out_opengl: Testing for hardware accelerated direct rendering visual\n"); + if (! opengl_verify_direct ((x11_visual_t *)visual_gen)) { + xprintf (xine, XINE_VERBOSITY_LOG, + "video_out_opengl: Didn't find any\n"); + return NULL; + } + + this = (opengl_class_t *) calloc (1, sizeof(opengl_class_t)); this->driver_class.open_plugin = opengl_open_plugin; this->driver_class.get_identifier = opengl_get_identifier; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de