summaryrefslogtreecommitdiffstats
path: root/video/out/gpu
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-20 22:12:29 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-29 02:21:32 +0300
commit0be3a94e0b81d553849f9520f7ee9f2b6e34c6b4 (patch)
tree134776298cf75cab691454409f2c359096ba560b /video/out/gpu
parent36565c099debbcfdfe800a5c2c1c9c9fada0a48b (diff)
downloadmpv-0be3a94e0b81d553849f9520f7ee9f2b6e34c6b4.tar.bz2
mpv-0be3a94e0b81d553849f9520f7ee9f2b6e34c6b4.tar.xz
vo_libmpv: support GPU rendered screenshots
Like DR, this needed a lot of preparation, and here's the boring glue code that finally implements it.
Diffstat (limited to 'video/out/gpu')
-rw-r--r--video/out/gpu/libmpv_gpu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/gpu/libmpv_gpu.c b/video/out/gpu/libmpv_gpu.c
index 3674d678c7..f687c97b51 100644
--- a/video/out/gpu/libmpv_gpu.c
+++ b/video/out/gpu/libmpv_gpu.c
@@ -190,6 +190,14 @@ static struct mp_image *get_image(struct render_backend *ctx, int imgfmt,
return gl_video_get_image(p->renderer, imgfmt, w, h, stride_align);
}
+static void screenshot(struct render_backend *ctx, struct vo_frame *frame,
+ struct voctrl_screenshot *args)
+{
+ struct priv *p = ctx->priv;
+
+ gl_video_screenshot(p->renderer, frame, args);
+}
+
static void destroy(struct render_backend *ctx)
{
struct priv *p = ctx->priv;
@@ -217,5 +225,6 @@ const struct render_backend_fns render_backend_gpu = {
.get_target_size = get_target_size,
.render = render,
.get_image = get_image,
+ .screenshot = screenshot,
.destroy = destroy,
};