summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-22 12:51:23 +0100
committerwm4 <wm4@nowhere>2014-12-22 12:51:23 +0100
commitc912288e57cde1aa5f70249c065b1c0a4cfef6ec (patch)
treeb3cf24892cbc90c3353cd7df8d855437c672da28 /video/out
parent2b9a7c4b5bc5697241cb8e1448b2056d20b50b77 (diff)
downloadmpv-c912288e57cde1aa5f70249c065b1c0a4cfef6ec.tar.bz2
mpv-c912288e57cde1aa5f70249c065b1c0a4cfef6ec.tar.xz
vo_opengl_cb: parse renderer parameters
Now it accepts the same renderer arguments as vo_opengl. This also disables debug checks by default, and reverts the background color override. Both can now be controlled by the host application.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_opengl_cb.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index c0870d3b42..c292668651 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -43,6 +43,9 @@ struct vo_priv {
struct vo *vo;
struct mpv_opengl_cb_context *ctx;
+
+ int use_gl_debug;
+ struct gl_video_opts *renderer_opts;
};
struct mpv_opengl_cb_context {
@@ -206,12 +209,12 @@ int mpv_opengl_cb_render(struct mpv_opengl_cb_context *ctx, int fbo, int vp[4])
gl_video_resize(ctx->renderer, &wnd, &src, &dst, &osd, !ctx->flip);
}
- if (ctx->reconfigured) {
+ if (ctx->reconfigured && vo) {
ctx->reconfigured = false;
gl_video_config(ctx->renderer, &ctx->img_params);
- struct gl_video_opts opts = gl_video_opts_def;
- opts.background.a = 0; // transparent
- gl_video_set_options(ctx->renderer, &opts);
+ struct vo_priv *p = vo->priv;
+ gl_video_set_options(ctx->renderer, p->renderer_opts);
+ gl_video_set_debug(ctx->renderer, p->use_gl_debug);
}
struct mp_image *mpi = ctx->next_frame;
@@ -355,8 +358,10 @@ static int preinit(struct vo *vo)
return 0;
}
-#define OPT_BASE_STRUCT struct gl_priv
+#define OPT_BASE_STRUCT struct vo_priv
static const struct m_option options[] = {
+ OPT_FLAG("debug", use_gl_debug, 0),
+ OPT_SUBSTRUCT("", renderer_opts, gl_video_conf, 0),
{0},
};