mirror of
https://github.com/mpv-player/mpv
synced 2025-01-30 03:32:50 +00:00
VO: add mechanisms to change VO commandline for VOs supporting it
This commit is contained in:
parent
4f80c5ee42
commit
e9a18efa2b
13
command.c
13
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);
|
||||
|
@ -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}
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user