summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-01-21 21:37:49 -0600
committerDudemanguy <random342@airmail.cc>2024-02-07 14:50:09 +0000
commit003fb15cbb21d86186ab3fb5448ff8c908e1e0dd (patch)
tree4922ee5f0b838ffc3d75293fc3712b7098827afa /player/command.c
parent8dbbc2ad82d6ebfa986db4726e2e5006b7cb0a9d (diff)
downloadmpv-003fb15cbb21d86186ab3fb5448ff8c908e1e0dd.tar.bz2
mpv-003fb15cbb21d86186ab3fb5448ff8c908e1e0dd.tar.xz
player/command: add deinterlace-active property
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index ccde8647c3..66b808e438 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1357,6 +1357,18 @@ static int mp_property_core_idle(void *ctx, struct m_property *prop,
return m_property_bool_ro(action, arg, !mpctx->playback_active);
}
+static int mp_property_deinterlace(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ struct vo_chain *vo_c = mpctx->vo_chain;
+ if (!vo_c)
+ return M_PROPERTY_UNAVAILABLE;
+
+ bool deinterlace_active = mp_output_chain_deinterlace_active(vo_c->filter);
+ return m_property_bool_ro(action, arg, deinterlace_active);
+}
+
static int mp_property_idle(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3882,6 +3894,7 @@ static const struct m_property mp_properties_base[] = {
{"clock", mp_property_clock},
{"seekable", mp_property_seekable},
{"partially-seekable", mp_property_partially_seekable},
+ {"deinterlace-active", mp_property_deinterlace},
{"idle-active", mp_property_idle},
{"window-id", mp_property_window_id},
@@ -4056,7 +4069,8 @@ static const char *const *const mp_event_property_change[] = {
"secondary-sub-text", "audio-bitrate", "video-bitrate", "sub-bitrate",
"decoder-frame-drop-count", "frame-drop-count", "video-frame-info",
"vf-metadata", "af-metadata", "sub-start", "sub-end", "secondary-sub-start",
- "secondary-sub-end", "video-out-params", "video-dec-params", "video-params"),
+ "secondary-sub-end", "video-out-params", "video-dec-params", "video-params",
+ "deinterlace-active"),
E(MP_EVENT_DURATION_UPDATE, "duration"),
E(MPV_EVENT_VIDEO_RECONFIG, "video-out-params", "video-params",
"video-format", "video-codec", "video-bitrate", "dwidth", "dheight",