diff options
Diffstat (limited to 'video/out/opengl/context_x11egl.c')
-rw-r--r-- | video/out/opengl/context_x11egl.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/video/out/opengl/context_x11egl.c b/video/out/opengl/context_x11egl.c index 4e0b277da7..549498b435 100644 --- a/video/out/opengl/context_x11egl.c +++ b/video/out/opengl/context_x11egl.c @@ -18,14 +18,15 @@ #include <assert.h> #include <X11/Xlib.h> +#include <X11/extensions/Xpresent.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include "common/common.h" +#include "video/out/present_sync.h" #include "video/out/x11_common.h" #include "context.h" #include "egl_helpers.h" -#include "oml_sync.h" #include "utils.h" #define EGL_PLATFORM_X11_EXT 0x31D5 @@ -35,10 +36,6 @@ struct priv { EGLDisplay egl_display; EGLContext egl_context; EGLSurface egl_surface; - - EGLBoolean (*GetSyncValues)(EGLDisplay, EGLSurface, - int64_t*, int64_t*, int64_t*); - struct oml_sync sync; }; static void mpegl_uninit(struct ra_ctx *ctx) @@ -83,20 +80,16 @@ static bool mpegl_check_visible(struct ra_ctx *ctx) static void mpegl_swap_buffers(struct ra_ctx *ctx) { struct priv *p = ctx->priv; - eglSwapBuffers(p->egl_display, p->egl_surface); - - int64_t ust, msc, sbc; - if (!p->GetSyncValues || !p->GetSyncValues(p->egl_display, p->egl_surface, - &ust, &msc, &sbc)) - ust = msc = sbc = -1; - oml_sync_swap(&p->sync, ust, msc, sbc); + eglSwapBuffers(p->egl_display, p->egl_surface); + vo_x11_present(ctx->vo); + present_sync_swap(ctx->vo->x11->present); } static void mpegl_get_vsync(struct ra_ctx *ctx, struct vo_vsync_info *info) { - struct priv *p = ctx->priv; - oml_sync_get_info(&p->sync, info); + struct vo_x11_state *x11 = ctx->vo->x11; + present_sync_get_info(x11->present, info); } static bool mpegl_init(struct ra_ctx *ctx) @@ -182,10 +175,6 @@ static bool mpegl_init(struct ra_ctx *ctx) if (!ra_gl_ctx_init(ctx, &p->gl, params)) goto uninit; - const char *exts = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); - if (gl_check_extension(exts, "EGL_CHROMIUM_sync_control")) - p->GetSyncValues = (void *)eglGetProcAddress("eglGetSyncValuesCHROMIUM"); - ra_add_native_resource(ctx->ra, "x11", vo->x11->display); return true; |