From 3ab5401b38d1ff1c1bb85f108f26d508cc334c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 25 Aug 2023 15:22:15 +0200 Subject: [PATCH] player/command: remove video-aspect property 4 years is enough of deprecation period. --- DOCS/interface-changes.rst | 1 + DOCS/man/input.rst | 7 ----- DOCS/mplayer-changes.rst | 6 ++-- TOOLS/mpv_identify.sh | 2 +- osdep/macosx_menubar.m | 10 +++--- player/command.c | 64 +------------------------------------- 6 files changed, 11 insertions(+), 79 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index be1f764f76..d09073c1da 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -53,6 +53,7 @@ Interface changes - remove `sub-forced-only-cur` property (`--sub-forced-events-only` is a replacement) - add `hdr-metadata` property - change `--directory-mode` default to `lazy` + - remove deprecated `video-aspect` property --- mpv 0.36.0 --- - add `--target-contrast` - Target luminance value is now also applied when ICC profile is used. diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index a70318e449..4abbce9f0a 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -2663,13 +2663,6 @@ Property list It may be saner to report an absolute DPI, however, this is the way HiDPI support is implemented on most OS APIs. See also ``--hidpi-window-scale``. -``video-aspect`` (RW) - Deprecated. This is tied to ``--video-aspect-override``, but always - reports the current video aspect if video is active. - - The read and write components of this option can be split up into - ``video-params/aspect`` and ``video-aspect-override`` respectively. - ``osd-width``, ``osd-height`` Last known OSD width (can be 0). This is needed if you want to use the ``overlay-add`` command. It gives you the actual OSD/window size (not diff --git a/DOCS/mplayer-changes.rst b/DOCS/mplayer-changes.rst index f681ca4729..6ecb1d0e38 100644 --- a/DOCS/mplayer-changes.rst +++ b/DOCS/mplayer-changes.rst @@ -214,7 +214,7 @@ Command Line Switches ``-af volnorm`` (removed; use acompressor ffmpeg filter instead) ``-afm hwac3`` ``--ad=spdif:ac3,spdif:dts`` ``-ao alsa:device=hw=0.3`` ``--ao=alsa:device=[hw:0,3]`` - ``-aspect`` ``--video-aspect`` + ``-aspect`` ``--video-aspect-override`` ``-ass-bottom-margin`` ``--vf=sub=bottom:top`` ``-ass`` ``--sub-ass`` ``-audiofile-cache`` (removed; the main cache settings are used) @@ -321,9 +321,9 @@ input.conf and Slave Commands +--------------------------------+----------------------------------------+ | ``pt_step -1 [0|1]`` | ``playlist-prev [weak|force] (same)`` | +--------------------------------+----------------------------------------+ - | ``switch_ratio []`` | ``set video-aspect `` | + | ``switch_ratio []`` | ``set video-aspect-override `` | | | | - | | ``set video-aspect 0`` (reset aspect) | + | | ``set video-aspect-override 0`` (reset)| +--------------------------------+----------------------------------------+ | ``step_property_osd `` | ``cycle `` (wraps), | | `` `` | ``add `` (clamps). | diff --git a/TOOLS/mpv_identify.sh b/TOOLS/mpv_identify.sh index a8f9e05af3..fa0e134937 100755 --- a/TOOLS/mpv_identify.sh +++ b/TOOLS/mpv_identify.sh @@ -79,7 +79,7 @@ EOF video-bitrate video-codec video-format - video-aspect + video-params/aspect container-fps width height diff --git a/osdep/macosx_menubar.m b/osdep/macosx_menubar.m index 6fefcb97aa..c8255dd037 100644 --- a/osdep/macosx_menubar.m +++ b/osdep/macosx_menubar.m @@ -266,35 +266,35 @@ @"action" : @"cmd:", @"key" : @"", @"target" : self, - @"cmd" : @"set video-aspect \"4:3\"" + @"cmd" : @"set video-aspect-override \"4:3\"" }], [NSMutableDictionary dictionaryWithDictionary:@{ @"name" : @"Aspect Ratio 16:9", @"action" : @"cmd:", @"key" : @"", @"target" : self, - @"cmd" : @"set video-aspect \"16:9\"" + @"cmd" : @"set video-aspect-override \"16:9\"" }], [NSMutableDictionary dictionaryWithDictionary:@{ @"name" : @"Aspect Ratio 1.85:1", @"action" : @"cmd:", @"key" : @"", @"target" : self, - @"cmd" : @"set video-aspect \"1.85:1\"" + @"cmd" : @"set video-aspect-override \"1.85:1\"" }], [NSMutableDictionary dictionaryWithDictionary:@{ @"name" : @"Aspect Ratio 2.35:1", @"action" : @"cmd:", @"key" : @"", @"target" : self, - @"cmd" : @"set video-aspect \"2.35:1\"" + @"cmd" : @"set video-aspect-override \"2.35:1\"" }], [NSMutableDictionary dictionaryWithDictionary:@{ @"name" : @"Reset Aspect Ratio", @"action" : @"cmd:", @"key" : @"", @"target" : self, - @"cmd" : @"set video-aspect \"-1\"" + @"cmd" : @"set video-aspect-override \"-1\"" }], @{ @"name": @"separator" }, [NSMutableDictionary dictionaryWithDictionary:@{ diff --git a/player/command.c b/player/command.c index 008bc593a2..55928eb2cd 100644 --- a/player/command.c +++ b/player/command.c @@ -2820,67 +2820,6 @@ static int mp_property_vf_fps(void *ctx, struct m_property *prop, return m_property_double_ro(action, arg, 1.0 / avg); } -/// Video aspect (RW) (deprecated) -// FIXME: please delete this mess as soon as the deprecation period is over -static int mp_property_aspect(void *ctx, struct m_property *prop, - int action, void *arg) -{ - MPContext *mpctx = ctx; - struct m_config_option *opt; - opt = m_config_get_co_raw(mpctx->mconfig, bstr0("video-aspect-override")); - - struct command_ctx *cmd = mpctx->command_ctx; - for (int n = 0; n < cmd->num_warned_deprecated; n++) { - if (strcmp(cmd->warned_deprecated[n], prop->name) == 0) - goto skip_warn; - } - - MP_WARN(mpctx, "Warning: property 'video-aspect' is deprecated, refer to " - "'video-params/aspect' and 'video-aspect-override'.\n"); - MP_TARRAY_APPEND(cmd, cmd->warned_deprecated, cmd->num_warned_deprecated, - (char *)prop->name); - -skip_warn: ; - - float aspect = *(float *)opt->data; - if (mpctx->vo_chain && aspect <= 0) { - struct mp_image_params *params = &mpctx->vo_chain->filter->input_params; - if (params && params->p_w > 0 && params->p_h > 0) { - int d_w, d_h; - mp_image_params_get_dsize(params, &d_w, &d_h); - aspect = (float)d_w / d_h; - } - } - struct track *track = mpctx->current_track[0][STREAM_VIDEO]; - if (track && track->stream && aspect <= 0) { - struct mp_codec_params *c = track->stream->codec; - if (c->disp_w && c->disp_h) - aspect = (float)c->disp_w / c->disp_h; - } - - switch (action) { - case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = *(opt->opt); - return M_PROPERTY_OK; - case M_PROPERTY_PRINT: { - if (aspect < 0) { - *(char **)arg = talloc_asprintf(NULL, "%.3f (original)", aspect); - return M_PROPERTY_OK; - } - break; - } - case M_PROPERTY_GET: { - *(float *)arg = aspect; - return M_PROPERTY_OK; - } - case M_PROPERTY_SET: - if (m_config_set_option_raw(mpctx->mconfig, opt, arg, 0) < 0) - return M_PROPERTY_ERROR; - return M_PROPERTY_OK; - } - return M_PROPERTY_NOT_IMPLEMENTED; -} - #define doubles_equal(x, y) (fabs((x) - (y)) <= 0.001) static int mp_property_video_aspect_override(void *ctx, struct m_property *prop, @@ -3973,7 +3912,6 @@ static const struct m_property mp_properties_base[] = { {"current-vo", mp_property_vo}, {"container-fps", mp_property_fps}, {"estimated-vf-fps", mp_property_vf_fps}, - {"video-aspect", mp_property_aspect}, {"video-aspect-override", mp_property_video_aspect_override}, {"vid", property_switch_track, .priv = (void *)(const int[]){0, STREAM_VIDEO}}, {"hwdec-current", mp_property_hwdec_current}, @@ -4101,7 +4039,7 @@ static const char *const *const mp_event_property_change[] = { E(MPV_EVENT_VIDEO_RECONFIG, "video-out-params", "video-params", "video-format", "video-codec", "video-bitrate", "dwidth", "dheight", "width", "height", "fps", "aspect", "aspect-name", "vo-configured", "current-vo", - "video-aspect", "video-dec-params", "osd-dimensions", + "video-dec-params", "osd-dimensions", "hwdec", "hwdec-current", "hwdec-interop"), E(MPV_EVENT_AUDIO_RECONFIG, "audio-format", "audio-codec", "audio-bitrate", "samplerate", "channels", "audio", "volume", "mute",