Author: tack
Date: Wed Dec 13 21:42:23 2006
New Revision: 2230
Modified:
trunk/xine/src/drivers/video_out_kaa.c
trunk/xine/src/drivers/video_out_kaa.h
trunk/xine/src/xine.c
Log:
Detect opengl vsync glx functions at runtime rather than compile time.
Modified: trunk/xine/src/drivers/video_out_kaa.c
==============================================================================
--- trunk/xine/src/drivers/video_out_kaa.c (original)
+++ trunk/xine/src/drivers/video_out_kaa.c Wed Dec 13 21:42:23 2006
@@ -45,6 +45,11 @@
static int _kaa_blend_osd(kaa_driver_t *this, kaa_frame_t *frame);
+#ifdef HAVE_OPENGL_VSYNC
+// set when module loads
+extern int (*glXWaitVideoSyncSGI)(int, int, unsigned int *);
+extern int (*glXGetVideoSyncSGI)(unsigned int *);
+#endif
#ifdef STOPWATCH
static void stopwatch(int n, char *text, ...)
@@ -1133,7 +1138,7 @@
this->osd_alpha = 255;
#ifdef HAVE_OPENGL_VSYNC
this->glx_display = NULL;
- if (visual->use_opengl_vsync)
+ if (visual->use_opengl_vsync && glXWaitVideoSyncSGI && glXGetVideoSyncSGI)
_kaa_setup_glx(this, (x11_visual_t *)visual->passthrough_visual);
#endif
return &this->vo_driver;
Modified: trunk/xine/src/drivers/video_out_kaa.h
==============================================================================
--- trunk/xine/src/drivers/video_out_kaa.h (original)
+++ trunk/xine/src/drivers/video_out_kaa.h Wed Dec 13 21:42:23 2006
@@ -38,7 +38,6 @@
#ifdef HAVE_OPENGL_VSYNC
-#define GLX_GLXEXT_PROTOTYPES
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <GL/gl.h>
Modified: trunk/xine/src/xine.c
==============================================================================
--- trunk/xine/src/xine.c (original)
+++ trunk/xine/src/xine.c Wed Dec 13 21:42:23 2006
@@ -1,3 +1,5 @@
+#include <dlfcn.h>
+
#include "xine.h"
#include "structmember.h"
#include "vo_driver.h"
@@ -22,6 +24,11 @@
PyObject *xine_error;
extern PyObject *xine_object_to_pyobject_dict;
+#ifdef HAVE_OPENGL_VSYNC
+int (*glXWaitVideoSyncSGI)(int, int, unsigned int *) = NULL;
+int (*glXGetVideoSyncSGI)(unsigned int *) = NULL;
+#endif
+
void
_xine_log_callback(void *xine_pyobject, int section)
{
@@ -748,6 +755,19 @@
X11Window_PyObject_Type = NULL;
}
#endif
+#ifdef HAVE_OPENGL_VSYNC
+{
+ void *handle = dlopen("libGL.so", RTLD_LAZY);
+ if (handle) {
+ glXWaitVideoSyncSGI = dlsym(handle, "glXWaitVideoSyncSGI");
+ glXGetVideoSyncSGI = dlsym(handle, "glXGetVideoSyncSGI");
+ }
+ if (glXWaitVideoSyncSGI && glXGetVideoSyncSGI)
+ printf("OpenGL vsync supported on this system.\n");
+ else
+ printf("OpenGL vsync not supported on this system.\n");
+}
+#endif
PyEval_InitThreads();
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog