summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-24 15:34:53 +0200
committerwm4 <wm4@nowhere>2014-10-24 15:34:53 +0200
commitf1481df0b63c27f1417cddf8fb0c1bf12ff58b82 (patch)
tree7fe7805891ce277f1c6388b1157f8b09315593e3 /player
parent96b339fc07a22f8ffbc8f86411fefd032066a144 (diff)
downloadmpv-f1481df0b63c27f1417cddf8fb0c1bf12ff58b82.tar.bz2
mpv-f1481df0b63c27f1417cddf8fb0c1bf12ff58b82.tar.xz
command: add vo-configured property
So a client API user can know when a window is created or destroyed. Also might be useful for the OSC: it could disable itself if video is disabled. Before this commit, there were only indirect ways of detecting this.
Diffstat (limited to 'player')
-rw-r--r--player/command.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index c2cb206a16..1109e7ac7f 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2403,6 +2403,14 @@ static int mp_property_window_scale(void *ctx, struct m_property *prop,
return M_PROPERTY_NOT_IMPLEMENTED;
}
+static int mp_property_vo_configured(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ return m_property_flag_ro(action, arg,
+ mpctx->video_out && mpctx->video_out->config_ok);
+}
+
static int mp_property_osd_w(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3050,6 +3058,7 @@ static const struct m_property mp_properties[] = {
M_PROPERTY_ALIAS("width", "video-params/w"),
M_PROPERTY_ALIAS("height", "video-params/h"),
{"window-scale", mp_property_window_scale},
+ {"vo-configured", mp_property_vo_configured},
{"fps", mp_property_fps},
{"estimated-vf-fps", mp_property_vf_fps},
{"video-aspect", mp_property_aspect},
@@ -3132,7 +3141,7 @@ static const char *const *const mp_event_property_change[] = {
"estimated-vf-fps"),
E(MPV_EVENT_VIDEO_RECONFIG, "video-out-params", "video-params",
"video-format", "video-codec", "video-bitrate", "dwidth", "dheight",
- "width", "height", "fps", "aspect"),
+ "width", "height", "fps", "aspect", "vo-configured"),
E(MPV_EVENT_AUDIO_RECONFIG, "audio-format", "audio-codec", "audio-bitrate",
"samplerate", "channels", "audio"),
E(MPV_EVENT_SEEK, "seeking"),