summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-12-20 12:47:00 +0100
committerwm4 <wm4@nowhere>2019-12-20 13:00:39 +0100
commit8e620c8e76ec0b8b5b5a0581f3f581cdf86923a4 (patch)
treee8569ca1122da5ec15c1da8ef5e475efb89b8225 /player
parent8448fe0b62a4abfaab593d5e455fa259b1d79407 (diff)
downloadmpv-8e620c8e76ec0b8b5b5a0581f3f581cdf86923a4.tar.bz2
mpv-8e620c8e76ec0b8b5b5a0581f3f581cdf86923a4.tar.xz
command: add property returning hidpi scale
Diffstat (limited to 'player')
-rw-r--r--player/command.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index ea6e3bb76c..8b41631b4b 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2325,6 +2325,17 @@ static int mp_property_vsync_jitter(void *ctx, struct m_property *prop,
return m_property_double_ro(action, arg, stddev);
}
+static int mp_property_hidpi_scale(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ struct vo *vo = mpctx->video_out;
+ double scale = 0;
+ if (!vo || vo_control(vo, VOCTRL_GET_HIDPI_SCALE, &scale) < 1 || scale <= 0)
+ return M_PROPERTY_UNAVAILABLE;
+ return m_property_double_ro(action, arg, scale);
+}
+
static int mp_property_display_names(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3398,6 +3409,7 @@ static const struct m_property mp_properties_base[] = {
{"display-fps", mp_property_display_fps},
{"estimated-display-fps", mp_property_estimated_display_fps},
{"vsync-jitter", mp_property_vsync_jitter},
+ {"display-hidpi-scale", mp_property_hidpi_scale},
{"working-directory", mp_property_cwd},