From 616481ad290b3bc43d551d946dd5c0fe7423f8b2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 28 Jan 2015 19:40:52 +0100 Subject: vo_opengl: remove some unused functions These were intended for some plans that were never realized. Also move some comments around and fix them. --- video/out/gl_common.c | 26 +++++++------------------- video/out/gl_common.h | 14 ++------------ video/out/vo_opengl.c | 4 ++-- 3 files changed, 11 insertions(+), 33 deletions(-) diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 6b2bc388ed..577b24abec 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -617,6 +617,8 @@ static MPGLContext *mpgl_create(struct vo *vo, const char *backend_name) return ctx; } +// Create a VO window and create a GL context on it. +// vo_flags: passed to the backend's create window function MPGLContext *mpgl_init(struct vo *vo, const char *backend_name, int vo_flags) { MPGLContext *ctx = mpgl_create(vo, backend_name); @@ -651,9 +653,10 @@ cleanup: return NULL; } -bool mpgl_reconfig_window(struct MPGLContext *ctx, int flags) +// flags: passed to the backend function +bool mpgl_reconfig_window(struct MPGLContext *ctx, int vo_flags) { - return ctx->config_window(ctx, flags); + return ctx->config_window(ctx, vo_flags); } void mpgl_uninit(MPGLContext *ctx) @@ -665,29 +668,14 @@ void mpgl_uninit(MPGLContext *ctx) talloc_free(ctx); } -void mpgl_set_context(MPGLContext *ctx) +void mpgl_lock(MPGLContext *ctx) { if (ctx->set_current) ctx->set_current(ctx, true); } -void mpgl_unset_context(MPGLContext *ctx) +void mpgl_unlock(MPGLContext *ctx) { if (ctx->set_current) ctx->set_current(ctx, false); } - -void mpgl_lock(MPGLContext *ctx) -{ - mpgl_set_context(ctx); -} - -void mpgl_unlock(MPGLContext *ctx) -{ - mpgl_unset_context(ctx); -} - -bool mpgl_is_thread_safe(MPGLContext *ctx) -{ - return !!ctx->set_current; -} diff --git a/video/out/gl_common.h b/video/out/gl_common.h index 0143fea843..98b9d9c0c7 100644 --- a/video/out/gl_common.h +++ b/video/out/gl_common.h @@ -116,20 +116,10 @@ typedef struct MPGLContext { void mpgl_lock(MPGLContext *ctx); void mpgl_unlock(MPGLContext *ctx); -void mpgl_set_context(MPGLContext *ctx); -void mpgl_unset_context(MPGLContext *ctx); -bool mpgl_is_thread_safe(MPGLContext *ctx); - -// Create a VO window and create a GL context on it. -// (Calls config_window_gl3 or config_window+setGlWindow.) -// gl_flavor: 110 for legacy GL, 210 for GL 2.1 or 3.x core -// flags: passed to the backend's create window function -// Returns success. + MPGLContext *mpgl_init(struct vo *vo, const char *backend_name, int vo_flags); void mpgl_uninit(MPGLContext *ctx); - -// flags: passed to the backend function -bool mpgl_reconfig_window(struct MPGLContext *ctx, int flags); +bool mpgl_reconfig_window(struct MPGLContext *ctx, int vo_flags); int mpgl_find_backend(const char *name); diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 9da92e3858..be8fbc9d7a 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -424,7 +424,7 @@ static int preinit(struct vo *vo) goto err_out; p->gl = p->glctx->gl; - mpgl_set_context(p->glctx); + mpgl_lock(p->glctx); if (p->gl->SwapInterval) p->gl->SwapInterval(p->swap_interval); @@ -444,7 +444,7 @@ static int preinit(struct vo *vo) if (!get_and_update_icc_profile(p, &(int){0})) goto err_out; - mpgl_unset_context(p->glctx); + mpgl_unlock(p->glctx); p->hwdec_info.load_api = call_request_hwdec_api; p->hwdec_info.load_api_ctx = vo; -- cgit v1.2.3