summaryrefslogtreecommitdiffstats
path: root/core/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-18 11:44:17 +0200
committerwm4 <wm4@nowhere>2013-05-18 17:45:54 +0200
commitf569d245ba37898a79e853cb6fbd906dd992b531 (patch)
tree713d484af2df18abf8c388863ea6341d64a981aa /core/input
parentd1b37aff32f459e2d9fd8361beb14138458012ec (diff)
downloadmpv-f569d245ba37898a79e853cb6fbd906dd992b531.tar.bz2
mpv-f569d245ba37898a79e853cb6fbd906dd992b531.tar.xz
core: allow changing filter filters at runtime
Add the "vf" command, which allows changing the video filter chain at runtime. For example, the 'y' key could be bound to toggle deinterlacing by adding 'y vf toggle yadif' to the input.conf. Reconfiguring the video filter chain normally resets the VO, so that it will be "stuck" until a new video frame is rendered. To mitigate this, a seek to the current position is issued when the filter chain is changed. This is done only if playback is paused, because normal playback will show an actual new frame quickly enough. If vdpau hardware decoding is used, filter insertion (whether it fails or not) will break the video for a while. This is because vo_vdpau resets decoding related things on vo_config().
Diffstat (limited to 'core/input')
-rw-r--r--core/input/input.c2
-rw-r--r--core/input/input.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/core/input/input.c b/core/input/input.c
index 7ba6b64cdc..116e963b93 100644
--- a/core/input/input.c
+++ b/core/input/input.c
@@ -198,6 +198,8 @@ static const mp_cmd_t mp_cmds[] = {
{ MP_CMD_AF_CLR, "af_clr", },
{ MP_CMD_AF_CMDLINE, "af_cmdline", { ARG_STRING, ARG_STRING } },
+ { MP_CMD_VF, "vf", { ARG_STRING, ARG_STRING } },
+
{ MP_CMD_SHOW_CHAPTERS, "show_chapters", },
{ MP_CMD_SHOW_TRACKS, "show_tracks", },
{ MP_CMD_SHOW_PLAYLIST, "show_playlist", },
diff --git a/core/input/input.h b/core/input/input.h
index 367abedfca..12823dd004 100644
--- a/core/input/input.h
+++ b/core/input/input.h
@@ -78,6 +78,9 @@ enum mp_command_type {
MP_CMD_AF_CLR,
MP_CMD_AF_CMDLINE,
+ /// Video filter commands
+ MP_CMD_VF,
+
MP_CMD_SHOW_CHAPTERS,
MP_CMD_SHOW_TRACKS,
MP_CMD_SHOW_PLAYLIST,