summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/context.c10
-rw-r--r--video/out/opengl/context.h2
-rw-r--r--video/out/opengl/context_vdpau.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 85be3a0ace..cdaf6320cd 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -155,8 +155,7 @@ bool ra_gl_ctx_init(struct ra_ctx *ctx, GL *gl, struct ra_gl_ctx_params params)
{
struct ra_swapchain *sw = ctx->swapchain = talloc_ptrtype(NULL, sw);
*sw = (struct ra_swapchain) {
- .ctx = ctx,
- .flip_v = !params.flipped, // OpenGL framebuffers are normally inverted
+ .ctx = ctx,
};
struct priv *p = sw->priv = talloc_ptrtype(sw, p);
@@ -266,11 +265,12 @@ struct mp_image *ra_gl_ctx_screenshot(struct ra_swapchain *sw)
return screen;
}
-struct ra_tex *ra_gl_ctx_start_frame(struct ra_swapchain *sw)
+bool ra_gl_ctx_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
{
struct priv *p = sw->priv;
-
- return p->wrapped_fb;
+ out_fbo->tex = p->wrapped_fb;
+ out_fbo->flip = !p->params.flipped; // OpenGL FBs are normally flipped
+ return true;
}
bool ra_gl_ctx_submit_frame(struct ra_swapchain *sw, const struct vo_frame *frame)
diff --git a/video/out/opengl/context.h b/video/out/opengl/context.h
index bdf426b9b4..95ed374555 100644
--- a/video/out/opengl/context.h
+++ b/video/out/opengl/context.h
@@ -51,6 +51,6 @@ void ra_gl_ctx_resize(struct ra_swapchain *sw, int w, int h, int fbo);
// for whatever reason, these can be used to inherit the original behavior.
int ra_gl_ctx_color_depth(struct ra_swapchain *sw);
struct mp_image *ra_gl_ctx_screenshot(struct ra_swapchain *sw);
-struct ra_tex *ra_gl_ctx_start_frame(struct ra_swapchain *sw);
+bool ra_gl_ctx_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo);
bool ra_gl_ctx_submit_frame(struct ra_swapchain *sw, const struct vo_frame *frame);
void ra_gl_ctx_swap_buffers(struct ra_swapchain *sw);
diff --git a/video/out/opengl/context_vdpau.c b/video/out/opengl/context_vdpau.c
index a2321f78dd..e9894142ea 100644
--- a/video/out/opengl/context_vdpau.c
+++ b/video/out/opengl/context_vdpau.c
@@ -336,7 +336,7 @@ uninit:
return false;
}
-static struct ra_tex *vdpau_start_frame(struct ra_swapchain *sw)
+static bool vdpau_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
{
struct priv *p = sw->ctx->priv;
struct vo *vo = sw->ctx->vo;
@@ -355,7 +355,7 @@ static struct ra_tex *vdpau_start_frame(struct ra_swapchain *sw)
surf->mapped = true;
ra_gl_ctx_resize(sw, surf->w, surf->h, surf->fbo);
- return ra_gl_ctx_start_frame(sw);
+ return ra_gl_ctx_start_frame(sw, out_fbo);
}
static bool vdpau_submit_frame(struct ra_swapchain *sw,