VO: add mechanisms to change VO commandline for VOs supporting it

This commit is contained in:
wm4 2012-08-01 01:06:59 +02:00
parent 4f80c5ee42
commit e9a18efa2b
4 changed files with 20 additions and 0 deletions

View File

@ -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);

View File

@ -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}
};

View File

@ -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

View File

@ -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