summaryrefslogtreecommitdiffstats
path: root/player/screenshot.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-20 23:11:03 +0200
committerwm4 <wm4@nowhere>2015-04-20 23:11:03 +0200
commita3680d1b2d137461008d38486cdb2d5013291e61 (patch)
treee3bafaac8a13edf57ff3456333a26fd057ac0790 /player/screenshot.c
parentccfe4d64184ae4c2983ae6b099c7c7ebb3770d0f (diff)
downloadmpv-a3680d1b2d137461008d38486cdb2d5013291e61.tar.bz2
mpv-a3680d1b2d137461008d38486cdb2d5013291e61.tar.xz
client API: add a screenshot_raw command
Requested. The wild code for setting up the mpv_node probably deserves to be cleaned up later. Fixes #1800.
Diffstat (limited to 'player/screenshot.c')
-rw-r--r--player/screenshot.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/player/screenshot.c b/player/screenshot.c
index f722b9561f..a47de292d5 100644
--- a/player/screenshot.c
+++ b/player/screenshot.c
@@ -357,6 +357,16 @@ static struct mp_image *screenshot_get(struct MPContext *mpctx, int mode)
return image;
}
+struct mp_image *screenshot_get_rgb(struct MPContext *mpctx, int mode)
+{
+ struct mp_image *mpi = screenshot_get(mpctx, mode);
+ if (!mpi)
+ return NULL;
+ struct mp_image *res = convert_image(mpi, IMGFMT_BGR0, mpctx->log);
+ talloc_free(mpi);
+ return res;
+}
+
void screenshot_to_file(struct MPContext *mpctx, const char *filename, int mode,
bool osd)
{