player/command: remove video-aspect property

4 years is enough of deprecation period.
This commit is contained in:
Kacper Michajłow 2023-08-25 15:22:15 +02:00 committed by Dudemanguy
parent edd7189a72
commit 3ab5401b38
6 changed files with 11 additions and 79 deletions

View File

@ -53,6 +53,7 @@ Interface changes
- remove `sub-forced-only-cur` property (`--sub-forced-events-only` is a replacement) - remove `sub-forced-only-cur` property (`--sub-forced-events-only` is a replacement)
- add `hdr-metadata` property - add `hdr-metadata` property
- change `--directory-mode` default to `lazy` - change `--directory-mode` default to `lazy`
- remove deprecated `video-aspect` property
--- mpv 0.36.0 --- --- mpv 0.36.0 ---
- add `--target-contrast` - add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used. - Target luminance value is now also applied when ICC profile is used.

View File

@ -2663,13 +2663,6 @@ Property list
It may be saner to report an absolute DPI, however, this is the way HiDPI 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``. 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`` ``osd-width``, ``osd-height``
Last known OSD width (can be 0). This is needed if you want to use the 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 ``overlay-add`` command. It gives you the actual OSD/window size (not

View File

@ -214,7 +214,7 @@ Command Line Switches
``-af volnorm`` (removed; use acompressor ffmpeg filter instead) ``-af volnorm`` (removed; use acompressor ffmpeg filter instead)
``-afm hwac3`` ``--ad=spdif:ac3,spdif:dts`` ``-afm hwac3`` ``--ad=spdif:ac3,spdif:dts``
``-ao alsa:device=hw=0.3`` ``--ao=alsa:device=[hw:0,3]`` ``-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-bottom-margin`` ``--vf=sub=bottom:top``
``-ass`` ``--sub-ass`` ``-ass`` ``--sub-ass``
``-audiofile-cache`` (removed; the main cache settings are used) ``-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)`` | | ``pt_step -1 [0|1]`` | ``playlist-prev [weak|force] (same)`` |
+--------------------------------+----------------------------------------+ +--------------------------------+----------------------------------------+
| ``switch_ratio [<ratio>]`` | ``set video-aspect <ratio>`` | | ``switch_ratio [<ratio>]`` | ``set video-aspect-override <ratio>`` |
| | | | | |
| | ``set video-aspect 0`` (reset aspect) | | | ``set video-aspect-override 0`` (reset)|
+--------------------------------+----------------------------------------+ +--------------------------------+----------------------------------------+
| ``step_property_osd <prop>`` | ``cycle <prop> <step>`` (wraps), | | ``step_property_osd <prop>`` | ``cycle <prop> <step>`` (wraps), |
| ``<step> <dir>`` | ``add <prop> <step>`` (clamps). | | ``<step> <dir>`` | ``add <prop> <step>`` (clamps). |

View File

@ -79,7 +79,7 @@ EOF
video-bitrate video-bitrate
video-codec video-codec
video-format video-format
video-aspect video-params/aspect
container-fps container-fps
width width
height height

View File

@ -266,35 +266,35 @@
@"action" : @"cmd:", @"action" : @"cmd:",
@"key" : @"", @"key" : @"",
@"target" : self, @"target" : self,
@"cmd" : @"set video-aspect \"4:3\"" @"cmd" : @"set video-aspect-override \"4:3\""
}], }],
[NSMutableDictionary dictionaryWithDictionary:@{ [NSMutableDictionary dictionaryWithDictionary:@{
@"name" : @"Aspect Ratio 16:9", @"name" : @"Aspect Ratio 16:9",
@"action" : @"cmd:", @"action" : @"cmd:",
@"key" : @"", @"key" : @"",
@"target" : self, @"target" : self,
@"cmd" : @"set video-aspect \"16:9\"" @"cmd" : @"set video-aspect-override \"16:9\""
}], }],
[NSMutableDictionary dictionaryWithDictionary:@{ [NSMutableDictionary dictionaryWithDictionary:@{
@"name" : @"Aspect Ratio 1.85:1", @"name" : @"Aspect Ratio 1.85:1",
@"action" : @"cmd:", @"action" : @"cmd:",
@"key" : @"", @"key" : @"",
@"target" : self, @"target" : self,
@"cmd" : @"set video-aspect \"1.85:1\"" @"cmd" : @"set video-aspect-override \"1.85:1\""
}], }],
[NSMutableDictionary dictionaryWithDictionary:@{ [NSMutableDictionary dictionaryWithDictionary:@{
@"name" : @"Aspect Ratio 2.35:1", @"name" : @"Aspect Ratio 2.35:1",
@"action" : @"cmd:", @"action" : @"cmd:",
@"key" : @"", @"key" : @"",
@"target" : self, @"target" : self,
@"cmd" : @"set video-aspect \"2.35:1\"" @"cmd" : @"set video-aspect-override \"2.35:1\""
}], }],
[NSMutableDictionary dictionaryWithDictionary:@{ [NSMutableDictionary dictionaryWithDictionary:@{
@"name" : @"Reset Aspect Ratio", @"name" : @"Reset Aspect Ratio",
@"action" : @"cmd:", @"action" : @"cmd:",
@"key" : @"", @"key" : @"",
@"target" : self, @"target" : self,
@"cmd" : @"set video-aspect \"-1\"" @"cmd" : @"set video-aspect-override \"-1\""
}], }],
@{ @"name": @"separator" }, @{ @"name": @"separator" },
[NSMutableDictionary dictionaryWithDictionary:@{ [NSMutableDictionary dictionaryWithDictionary:@{

View File

@ -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); 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) #define doubles_equal(x, y) (fabs((x) - (y)) <= 0.001)
static int mp_property_video_aspect_override(void *ctx, struct m_property *prop, 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}, {"current-vo", mp_property_vo},
{"container-fps", mp_property_fps}, {"container-fps", mp_property_fps},
{"estimated-vf-fps", mp_property_vf_fps}, {"estimated-vf-fps", mp_property_vf_fps},
{"video-aspect", mp_property_aspect},
{"video-aspect-override", mp_property_video_aspect_override}, {"video-aspect-override", mp_property_video_aspect_override},
{"vid", property_switch_track, .priv = (void *)(const int[]){0, STREAM_VIDEO}}, {"vid", property_switch_track, .priv = (void *)(const int[]){0, STREAM_VIDEO}},
{"hwdec-current", mp_property_hwdec_current}, {"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", E(MPV_EVENT_VIDEO_RECONFIG, "video-out-params", "video-params",
"video-format", "video-codec", "video-bitrate", "dwidth", "dheight", "video-format", "video-codec", "video-bitrate", "dwidth", "dheight",
"width", "height", "fps", "aspect", "aspect-name", "vo-configured", "current-vo", "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"), "hwdec", "hwdec-current", "hwdec-interop"),
E(MPV_EVENT_AUDIO_RECONFIG, "audio-format", "audio-codec", "audio-bitrate", E(MPV_EVENT_AUDIO_RECONFIG, "audio-format", "audio-codec", "audio-bitrate",
"samplerate", "channels", "audio", "volume", "mute", "samplerate", "channels", "audio", "volume", "mute",