This commit is contained in:
parent
afebcfc5db
commit
1cf5478ccd
75
xine-checkoglvisual.diff
Normal file
75
xine-checkoglvisual.diff
Normal file
@ -0,0 +1,75 @@
|
||||
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;
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
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)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 25 14:55:37 CEST 2008 - lnussel@suse.de
|
||||
|
||||
|
@ -34,7 +34,7 @@ BuildRequires: mad-devel
|
||||
%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 @@ Patch71: xine-lib-demuxcheckfor_mad_ffmpeg-LOCAL.diff
|
||||
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 @@ sed -i 's|^noinst_HEADERS = input_vdr.h|xineinclude_HEADERS = input_vdr.h|' src/
|
||||
%patch72 -p1
|
||||
%patch73 -p1
|
||||
%patch74 -p1
|
||||
%patch75 -p1
|
||||
rm -f m4/libtool15.m4
|
||||
|
||||
%build
|
||||
@ -452,6 +454,9 @@ echo "/usr/share/xine/mad" >> files.internal
|
||||
%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:
|
||||
|
Loading…
Reference in New Issue
Block a user