summaryrefslogtreecommitdiffstats
path: root/screenshot.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-20 23:32:45 +0200
committerwm4 <wm4@nowhere>2012-10-24 21:56:34 +0200
commit11ed093182f29c796ba6fd08f6c5c80e8fdb9349 (patch)
tree69f920eab72378a8c4b659d7dfd8b1bb81968029 /screenshot.h
parent821c01a5f50284a839ab879724a5c67b3f855a84 (diff)
downloadmpv-11ed093182f29c796ba6fd08f6c5c80e8fdb9349.tar.bz2
mpv-11ed093182f29c796ba6fd08f6c5c80e8fdb9349.tar.xz
screenshot: allow taking screenshots with subtitles
This adds a new screenshot mode "subtitles", which basically takes the video frame as decoded, and renders subtitles into it. This may fail for some pixel formats, because libswscale sucks. If this becomes ever a real problem, the code could be changed to convert the image to RGBA first (or whatever the image writer wants), and then render the subtitles into it. This would avoid the additional image copy needed with vo_xv too. But for now, it seems better to go with the current method in the common case: vo_opengl creates an image copy anyway, and drawing bitmaps to yv12 is better, as no color space conversion is involved in draw_bmp.c's up/downsampling conversion.
Diffstat (limited to 'screenshot.h')
-rw-r--r--screenshot.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/screenshot.h b/screenshot.h
index 6d205990f8..01dd372aa2 100644
--- a/screenshot.h
+++ b/screenshot.h
@@ -22,7 +22,6 @@
#include <stdbool.h>
struct MPContext;
-struct mp_image;
// One time initialization at program start.
void screenshot_init(struct MPContext *mpctx);
@@ -30,13 +29,9 @@ void screenshot_init(struct MPContext *mpctx);
// Request a taking & saving a screenshot of the currently displayed frame.
// each_frame: If set, this toggles per-frame screenshots, exactly like the
// screenshot slave command (MP_CMD_SCREENSHOT).
-// full_window: If set, save the actual output window contents.
+// mode: 0: -, 1: save the actual output window contents, 2: with subtitles.
void screenshot_request(struct MPContext *mpctx, bool each_frame,
- bool full_window);
-
-// Save the screenshot contained in the image to disk.
-// The image can be in any format supported by libswscale.
-void screenshot_save(struct MPContext *mpctx, struct mp_image *image);
+ int mode);
// Called by the playback core code when a new frame is displayed.
void screenshot_flip(struct MPContext *mpctx);