diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-09-15 13:27:59 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-09-15 13:27:59 +0000 |
commit | 21faec3791f543a2ef23a92d57ddadf5519e5723 (patch) | |
tree | 6ed954c917b84459f7940037c163093b38b53df3 /libmpcodecs | |
parent | b32aa254f96c5f07d61b2464610bb1a5948bd897 (diff) | |
download | mpv-21faec3791f543a2ef23a92d57ddadf5519e5723.tar.bz2 mpv-21faec3791f543a2ef23a92d57ddadf5519e5723.tar.xz |
Add repeated screenshot mode to vf_screenshot.
It is triggered by "screenshot 1".
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19839 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf_screenshot.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libmpcodecs/vf_screenshot.c b/libmpcodecs/vf_screenshot.c index 54939acc50..c3a9453320 100644 --- a/libmpcodecs/vf_screenshot.c +++ b/libmpcodecs/vf_screenshot.c @@ -27,6 +27,10 @@ struct vf_priv_s { int frameno; char fname[102]; + /// shot stores current screenshot mode: + /// 0: don't take screenshots + /// 1: take single screenshot, reset to 0 afterwards + /// 2: take screenshots of each frame int shot, store_slices; int dw, dh, stride; uint8_t *buffer; @@ -208,7 +212,8 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts) } if(vf->priv->shot) { - vf->priv->shot=0; + if (vf->priv->shot==1) + vf->priv->shot=0; gen_fname(vf->priv); if (vf->priv->fname[0]) { if (!vf->priv->store_slices) @@ -223,8 +228,20 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts) int control (vf_instance_t *vf, int request, void *data) { + /** data contains an integer argument + * 0: take screenshot with the next frame + * 1: take screenshots with each frame until the same command is given once again + **/ if(request==VFCTRL_SCREENSHOT) { - vf->priv->shot=1; + if (data && *(int*)data) { // repeated screenshot mode + if (vf->priv->shot==2) + vf->priv->shot=0; + else + vf->priv->shot=2; + } else { // single screenshot + if (!vf->priv->shot) + vf->priv->shot=1; + } return CONTROL_TRUE; } return vf_next_control (vf, request, data); |