summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-01 01:06:59 +0200
committerwm4 <wm4@nowhere>2012-08-01 01:06:59 +0200
commite9a18efa2b937f7627447e9f3c82c38ddf6b6eee (patch)
tree350b384958a6246769ab66caaa116103c8ef4c91
parent4f80c5ee422d6827a3e084f5aaf66bbc710dbcc5 (diff)
downloadmpv-e9a18efa2b937f7627447e9f3c82c38ddf6b6eee.tar.bz2
mpv-e9a18efa2b937f7627447e9f3c82c38ddf6b6eee.tar.xz
VO: add mechanisms to change VO commandline for VOs supporting it
-rw-r--r--command.c13
-rw-r--r--input/input.c2
-rw-r--r--input/input.h3
-rw-r--r--libvo/video_out.h2
4 files changed, 20 insertions, 0 deletions
diff --git a/command.c b/command.c
index 13a205dd63..6f44aecf47 100644
--- a/command.c
+++ b/command.c
@@ -3625,6 +3625,19 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
#endif
+ case MP_CMD_VO_CMDLINE:
+ if (mpctx->video_out) {
+ char *s = cmd->args[0].v.s;
+ mp_msg(MSGT_CPLAYER, MSGL_INFO, "Setting vo cmd line to '%s'.\n",
+ s);
+ if (vo_control(mpctx->video_out, VOCTRL_SET_COMMAND_LINE, s) > 0) {
+ set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, "vo='%s'", s);
+ } else {
+ set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, "Failed!");
+ }
+ }
+ break;
+
case MP_CMD_AF_SWITCH:
if (sh_audio) {
af_uninit(mpctx->mixer.afilter);
diff --git a/input/input.c b/input/input.c
index 836c9df14a..73e48436dd 100644
--- a/input/input.c
+++ b/input/input.c
@@ -224,6 +224,8 @@ static const mp_cmd_t mp_cmds[] = {
{ MP_CMD_SHOW_CHAPTERS, "show_chapters_osd", },
{ MP_CMD_SHOW_TRACKS, "show_tracks_osd", },
+ { MP_CMD_VO_CMDLINE, "vo_cmdline", { ARG_STRING } },
+
{0}
};
diff --git a/input/input.h b/input/input.h
index 922cc21bbc..a4d9b8dab6 100644
--- a/input/input.h
+++ b/input/input.h
@@ -155,6 +155,9 @@ enum mp_command_type {
MP_CMD_SHOW_CHAPTERS,
MP_CMD_SHOW_TRACKS,
+
+ /// Video output commands
+ MP_CMD_VO_CMDLINE,
};
// The arg types
diff --git a/libvo/video_out.h b/libvo/video_out.h
index a6bd19643f..82302a91d4 100644
--- a/libvo/video_out.h
+++ b/libvo/video_out.h
@@ -77,6 +77,8 @@ enum mp_voctrl {
VOCTRL_GET_YUV_COLORSPACE, // struct mp_csp_details
VOCTRL_SCREENSHOT, // struct voctrl_screenshot_args
+
+ VOCTRL_SET_COMMAND_LINE, // char*
};
// VOCTRL_SET_EQUALIZER