From fd5637888ac5f6be60d2aac843afe5235930214a Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Jan 2013 01:17:33 +0100 Subject: screenshot: minor simplification, prefer VF over VO Remove screenshot_force and associated logic. Always try to use the screenshot video filter before trying taking screenshots with the VO, which means that --vf=screenshot now takes the role of --vf=screenshot_force. (To make this clear, not adding a video filter is still the recommended way to take screenshots; we just change how VF screenshots are forced.) Preferring VO over VF and having --vf=screenshot_force used to make sense when not all VOs supported screenshots, and some VOs had somewhat broken screenshots (like vo_xv taking screenshots with OSD in it). But all these issues are fixed now, so just get rid of the cruft. --- core/screenshot.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'core') diff --git a/core/screenshot.c b/core/screenshot.c index ae259fcbc0..e5f15948e5 100644 --- a/core/screenshot.c +++ b/core/screenshot.c @@ -272,19 +272,6 @@ static void screenshot_save(struct MPContext *mpctx, struct mp_image *image, talloc_free(image); } -static bool force_vf(struct MPContext *mpctx) -{ - if (mpctx->sh_video) { - struct vf_instance *vf = mpctx->sh_video->vfilter; - while (vf) { - if (strcmp(vf->info->name, "screenshot_force") == 0) - return true; - vf = vf->next; - } - } - return false; -} - void screenshot_request(struct MPContext *mpctx, int mode, bool each_frame) { if (mpctx->video_out && mpctx->video_out->config_ok) { @@ -307,15 +294,11 @@ void screenshot_request(struct MPContext *mpctx, int mode, bool each_frame) struct voctrl_screenshot_args args = { .full_window = (mode == MODE_FULL_WINDOW) }; - if (!force_vf(mpctx)) - vo_control(mpctx->video_out, VOCTRL_SCREENSHOT, &args); + struct vf_instance *vfilter = mpctx->sh_video->vfilter; + vfilter->control(vfilter, VFCTRL_SCREENSHOT, &args); - if (!args.out_image) { - mp_msg(MSGT_CPLAYER, MSGL_INFO, "No VO support for taking" - " screenshots, trying VFCTRL_SCREENSHOT!\n"); - struct vf_instance *vfilter = mpctx->sh_video->vfilter; - vfilter->control(vfilter, VFCTRL_SCREENSHOT, &args); - } + if (!args.out_image) + vo_control(mpctx->video_out, VOCTRL_SCREENSHOT, &args); if (args.out_image) { if (args.has_osd) @@ -323,7 +306,7 @@ void screenshot_request(struct MPContext *mpctx, int mode, bool each_frame) screenshot_save(mpctx, args.out_image, mode == MODE_SUBTITLES); } else { mp_msg(MSGT_CPLAYER, MSGL_INFO, - "...failed (need --vf=screenshot?)\n"); + "Taking screenshot failed (need --vf=screenshot?)\n"); } } } -- cgit v1.2.3