From 192a7344d91de24d486effba73383b1c2790acc2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 1 Sep 2016 20:01:29 +0200 Subject: command: remove 2 deprecated properties They were delcared to be removed in mpv 0.20.0, and the next release will be 0.21.0. --- DOCS/interface-changes.rst | 1 + DOCS/man/input.rst | 18 ----------------- player/command.c | 50 ---------------------------------------------- 3 files changed, 1 insertion(+), 68 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 0b94f89963..478285a394 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -32,6 +32,7 @@ Interface changes - "fps" -> "container-fps" - "idle" -> "idle-active" the old names are deprecated + - remove deprecated "hwdec-active" and "hwdec-detected" properties --- mpv 0.20.0 --- - add --image-display-duration option - this also means that image duration is not influenced by --mf-fps anymore in the general case (this is an diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index defe6166bd..baeb1703d9 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -1331,24 +1331,6 @@ Property list multiple interop drivers for the same hardware decoder, depending on platform and VO. -``hwdec-active`` - Deprecated. To be removed in mpv 0.20.0. Use ``hwdec-current`` instead. - - Return ``yes`` or ``no``, depending on whether any type of hardware decoding - is actually in use. - -``hwdec-detected`` - Deprecated. To be removed in mpv 0.20.0. - - If hardware decoding is active, this returns the hardware decoder in use. - Otherwise, it returns either ``no``, or if applicable, the currently loaded - hardware decoding API. This is known only once the VO has opened (and - possibly later). With some VOs (like ``opengl``), this is never known in - advance, but only when the decoder attempted to create the hw decoder - successfully. Also, hw decoders with ``-copy`` suffix will return ``no`` - while no video is being decoded. All this reflects how detecting hw decoders - are detected and used internally in mpv. - ``video-format`` Video format as string. diff --git a/player/command.c b/player/command.c index d8872fa720..e5cbe2c84f 100644 --- a/player/command.c +++ b/player/command.c @@ -2284,54 +2284,6 @@ static int mp_property_hwdec_interop(void *ctx, struct m_property *prop, return m_property_strdup_ro(action, arg, name); } -static int mp_property_hwdec_active(void *ctx, struct m_property *prop, - int action, void *arg) -{ - MPContext *mpctx = ctx; - struct track *track = mpctx->current_track[0][STREAM_VIDEO]; - struct dec_video *vd = track ? track->d_video : NULL; - bool active = false; - if (vd) { - int current = 0; - video_vd_control(vd, VDCTRL_GET_HWDEC, ¤t); - active = current > 0; - } - return m_property_flag_ro(action, arg, active); -} - -static int mp_property_detected_hwdec(void *ctx, struct m_property *prop, - int action, void *arg) -{ - MPContext *mpctx = ctx; - struct track *track = mpctx->current_track[0][STREAM_VIDEO]; - struct dec_video *vd = track ? track->d_video : NULL; - - switch (action) { - case M_PROPERTY_GET_TYPE: { - // Abuse another hwdec option to resolve the value names - struct m_property dummy = {.name = "hwdec"}; - return mp_property_generic_option(mpctx, &dummy, action, arg); - } - case M_PROPERTY_GET: { - int current = 0; - if (vd) - video_vd_control(vd, VDCTRL_GET_HWDEC, ¤t); - - if (current <= 0 && vd && vd->hwdec_devs) { - struct mp_hwdec_ctx *hwctx = hwdec_devices_get_first(vd->hwdec_devs); - if (hwctx) - current = hwctx->type; - } - - // In case of the "-copy" ones, which are "detected" every time the - // decoder is opened, return "no" if no decoding is active. - *(int *)arg = current > 0 ? current : 0; - return M_PROPERTY_OK; - } - } - return M_PROPERTY_NOT_IMPLEMENTED; -} - static int mp_property_deinterlace(void *ctx, struct m_property *prop, int action, void *arg) { @@ -3858,10 +3810,8 @@ static const struct m_property mp_properties_base[] = { {"vid", mp_property_video}, {"program", mp_property_program}, {"hwdec", mp_property_hwdec}, - {"hwdec-active", mp_property_hwdec_active}, {"hwdec-current", mp_property_hwdec_current}, {"hwdec-interop", mp_property_hwdec_interop}, - {"hwdec-detected", mp_property_detected_hwdec}, {"estimated-frame-count", mp_property_frame_count}, {"estimated-frame-number", mp_property_frame_number}, -- cgit v1.2.3