[MPlayer-cvslog] r19839 - in trunk: DOCS/man/en/mplayer.1 DOCS/tech/slave.txt input/input.c libmpcodecs/vf_screenshot.c mplayer.c
eugeni
subversion at mplayerhq.hu
Fri Sep 15 15:27:59 CEST 2006
Author: eugeni
Date: Fri Sep 15 15:27:59 2006
New Revision: 19839
Modified:
trunk/input/input.c
trunk/libmpcodecs/vf_screenshot.c
trunk/mplayer.c
Changes in other areas also in this revision:
Modified:
trunk/DOCS/man/en/mplayer.1
trunk/DOCS/tech/slave.txt
Log:
Add repeated screenshot mode to vf_screenshot.
It is triggered by "screenshot 1".
Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c (original)
+++ trunk/input/input.c Fri Sep 15 15:27:59 2006
@@ -128,7 +128,7 @@
{ MP_CMD_FILE_FILTER, "file_filter", 1, { { MP_CMD_ARG_INT, {0}}, {-1,{0}}}},
{ MP_CMD_VO_ROOTWIN, "vo_rootwin", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
{ MP_CMD_VO_BORDER, "vo_border", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
- { MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } },
+ { MP_CMD_SCREENSHOT, "screenshot", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_PANSCAN, "panscan",1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_SWITCH_VSYNC, "switch_vsync", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
{ MP_CMD_LOADFILE, "loadfile", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
@@ -396,7 +396,8 @@
#endif
{ { 'T', 0 }, "vo_ontop" },
{ { 'f', 0 }, "vo_fullscreen" },
- { { 's', 0 }, "screenshot" },
+ { { 's', 0 }, "screenshot 0" },
+ { { 'S', 0 }, "screenshot 1" },
{ { 'w', 0 }, "panscan -0.1" },
{ { 'e', 0 }, "panscan +0.1" },
Modified: trunk/libmpcodecs/vf_screenshot.c
==============================================================================
--- trunk/libmpcodecs/vf_screenshot.c (original)
+++ trunk/libmpcodecs/vf_screenshot.c Fri Sep 15 15:27:59 2006
@@ -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 @@
}
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 @@
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);
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c (original)
+++ trunk/mplayer.c Fri Sep 15 15:27:59 2006
@@ -4953,7 +4953,7 @@
case MP_CMD_SCREENSHOT :
if(vo_config_count){
mp_msg(MSGT_CPLAYER,MSGL_INFO,"sending VFCTRL_SCREENSHOT!\n");
- if(CONTROL_OK!=((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter, VFCTRL_SCREENSHOT, 0))
+ if(CONTROL_OK!=((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter, VFCTRL_SCREENSHOT, &cmd->args[0].v.i))
video_out->control(VOCTRL_SCREENSHOT, NULL);
}
break;
More information about the MPlayer-cvslog
mailing list