mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
options: remove --vf-defaults and --af-defaults
These were deprecated a long time ago and apparently didn't even work with lavfi filters. Go ahead and remove them and additionally clean up some code related to them. m_config_from_obj_desc_and_args becomes much simpler now and a couple of arguments can be completely removed.
This commit is contained in:
parent
fb46666395
commit
177fe48d79
@ -84,6 +84,7 @@ Interface changes
|
|||||||
- remove deprecated `--oaoffset`, `--oafirst`, `--ovoffset`, `--ovfirst`,
|
- remove deprecated `--oaoffset`, `--oafirst`, `--ovoffset`, `--ovfirst`,
|
||||||
`--demuxer-force-retry-on-eof`, `--fit-border` options
|
`--demuxer-force-retry-on-eof`, `--fit-border` options
|
||||||
- remove deprecated `--record-file` option
|
- remove deprecated `--record-file` option
|
||||||
|
- remove deprecated `--vf-defaults` and `--af-defaults` options
|
||||||
--- 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.
|
||||||
|
@ -19,8 +19,8 @@ syntax is:
|
|||||||
The ``--vf`` description describes how libavfilter can be used and how to
|
The ``--vf`` description describes how libavfilter can be used and how to
|
||||||
workaround deprecated mpv filters.
|
workaround deprecated mpv filters.
|
||||||
|
|
||||||
See ``--vf`` group of options for info on how ``--af-defaults``, ``--af-add``,
|
See ``--vf`` group of options for info on how ``--af-add``, ``--af-pre``,
|
||||||
``--af-pre``, ``--af-del``, ``--af-clr``, and possibly others work.
|
``--af-del``, ``--af-clr``, and possibly others work.
|
||||||
|
|
||||||
Available filters are:
|
Available filters are:
|
||||||
|
|
||||||
|
@ -55,14 +55,6 @@ above in combination with the ``vf`` command (see `COMMAND INTERFACE`_) to get
|
|||||||
more control over this. Initially disabled filters with ``!`` are useful for
|
more control over this. Initially disabled filters with ``!`` are useful for
|
||||||
this as well.
|
this as well.
|
||||||
|
|
||||||
You can also set defaults for each filter. The defaults are applied before the
|
|
||||||
normal filter parameters. This is deprecated and never worked for the
|
|
||||||
libavfilter bridge.
|
|
||||||
|
|
||||||
``--vf-defaults=<filter1[=parameter1:parameter2:...],filter2,...>``
|
|
||||||
Set defaults for each filter. (Deprecated. ``--af-defaults`` is deprecated
|
|
||||||
as well.)
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
To get a full list of available video filters, see ``--vf=help`` and
|
To get a full list of available video filters, see ``--vf=help`` and
|
||||||
|
@ -134,16 +134,13 @@ struct mp_filter *mp_create_user_filter(struct mp_filter *parent,
|
|||||||
const char *name, char **args)
|
const char *name, char **args)
|
||||||
{
|
{
|
||||||
const struct m_obj_list *obj_list = NULL;
|
const struct m_obj_list *obj_list = NULL;
|
||||||
const char *defs_name = NULL;
|
|
||||||
enum mp_frame_type frame_type = 0;
|
enum mp_frame_type frame_type = 0;
|
||||||
if (type == MP_OUTPUT_CHAIN_VIDEO) {
|
if (type == MP_OUTPUT_CHAIN_VIDEO) {
|
||||||
frame_type = MP_FRAME_VIDEO;
|
frame_type = MP_FRAME_VIDEO;
|
||||||
obj_list = &vf_obj_list;
|
obj_list = &vf_obj_list;
|
||||||
defs_name = "vf-defaults";
|
|
||||||
} else if (type == MP_OUTPUT_CHAIN_AUDIO) {
|
} else if (type == MP_OUTPUT_CHAIN_AUDIO) {
|
||||||
frame_type = MP_FRAME_AUDIO;
|
frame_type = MP_FRAME_AUDIO;
|
||||||
obj_list = &af_obj_list;
|
obj_list = &af_obj_list;
|
||||||
defs_name = "af-defaults";
|
|
||||||
}
|
}
|
||||||
assert(frame_type && obj_list);
|
assert(frame_type && obj_list);
|
||||||
|
|
||||||
@ -163,18 +160,9 @@ struct mp_filter *mp_create_user_filter(struct mp_filter *parent,
|
|||||||
|
|
||||||
void *options = NULL;
|
void *options = NULL;
|
||||||
if (desc.options) {
|
if (desc.options) {
|
||||||
struct m_obj_settings *defs = NULL;
|
|
||||||
if (defs_name) {
|
|
||||||
mp_read_option_raw(parent->global, defs_name,
|
|
||||||
&m_option_type_obj_settings_list, &defs);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct m_config *config =
|
struct m_config *config =
|
||||||
m_config_from_obj_desc_and_args(NULL, parent->log, parent->global,
|
m_config_from_obj_desc_and_args(NULL, parent->log, parent->global,
|
||||||
&desc, name, defs, args);
|
&desc, args);
|
||||||
|
|
||||||
struct m_option dummy = {.type = &m_option_type_obj_settings_list};
|
|
||||||
m_option_free(&dummy, &defs);
|
|
||||||
|
|
||||||
if (!config)
|
if (!config)
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -168,18 +168,9 @@ static int m_config_set_obj_params(struct m_config *config, struct mp_log *log,
|
|||||||
|
|
||||||
struct m_config *m_config_from_obj_desc_and_args(void *ta_parent,
|
struct m_config *m_config_from_obj_desc_and_args(void *ta_parent,
|
||||||
struct mp_log *log, struct mpv_global *global, struct m_obj_desc *desc,
|
struct mp_log *log, struct mpv_global *global, struct m_obj_desc *desc,
|
||||||
const char *name, struct m_obj_settings *defaults, char **args)
|
char **args)
|
||||||
{
|
{
|
||||||
struct m_config *config = m_config_from_obj_desc(ta_parent, log, global, desc);
|
struct m_config *config = m_config_from_obj_desc(ta_parent, log, global, desc);
|
||||||
|
|
||||||
for (int n = 0; defaults && defaults[n].name; n++) {
|
|
||||||
struct m_obj_settings *entry = &defaults[n];
|
|
||||||
if (name && strcmp(entry->name, name) == 0) {
|
|
||||||
if (m_config_set_obj_params(config, log, global, desc, entry->attribs) < 0)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_config_set_obj_params(config, log, global, desc, args) < 0)
|
if (m_config_set_obj_params(config, log, global, desc, args) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -115,10 +115,9 @@ struct m_config *m_config_new(void *talloc_ctx, struct mp_log *log,
|
|||||||
// different sub-options for every filter (represented by separate desc
|
// different sub-options for every filter (represented by separate desc
|
||||||
// structs).
|
// structs).
|
||||||
// args is an array of key/value pairs (args=[k0, v0, k1, v1, ..., NULL]).
|
// args is an array of key/value pairs (args=[k0, v0, k1, v1, ..., NULL]).
|
||||||
// name/defaults is only needed for the legacy af-defaults/vf-defaults options.
|
|
||||||
struct m_config *m_config_from_obj_desc_and_args(void *ta_parent,
|
struct m_config *m_config_from_obj_desc_and_args(void *ta_parent,
|
||||||
struct mp_log *log, struct mpv_global *global, struct m_obj_desc *desc,
|
struct mp_log *log, struct mpv_global *global, struct m_obj_desc *desc,
|
||||||
const char *name, struct m_obj_settings *defaults, char **args);
|
char **args);
|
||||||
|
|
||||||
// Like m_config_from_obj_desc_and_args(), but don't allocate option the
|
// Like m_config_from_obj_desc_and_args(), but don't allocate option the
|
||||||
// struct, i.e. m_config.optstruct==NULL. This is used by the sub-option
|
// struct, i.e. m_config.optstruct==NULL. This is used by the sub-option
|
||||||
|
@ -574,11 +574,7 @@ static const m_option_t mp_opts[] = {
|
|||||||
|
|
||||||
// ------------------------- codec/vfilter options --------------------
|
// ------------------------- codec/vfilter options --------------------
|
||||||
|
|
||||||
{"af-defaults", OPT_SETTINGSLIST(af_defs, &af_obj_list),
|
|
||||||
.deprecation_message = "use --af + enable/disable flags"},
|
|
||||||
{"af", OPT_SETTINGSLIST(af_settings, &af_obj_list)},
|
{"af", OPT_SETTINGSLIST(af_settings, &af_obj_list)},
|
||||||
{"vf-defaults", OPT_SETTINGSLIST(vf_defs, &vf_obj_list),
|
|
||||||
.deprecation_message = "use --vf + enable/disable flags"},
|
|
||||||
{"vf", OPT_SETTINGSLIST(vf_settings, &vf_obj_list)},
|
{"vf", OPT_SETTINGSLIST(vf_settings, &vf_obj_list)},
|
||||||
|
|
||||||
{"", OPT_SUBSTRUCT(filter_opts, filter_conf)},
|
{"", OPT_SUBSTRUCT(filter_opts, filter_conf)},
|
||||||
|
@ -299,8 +299,8 @@ typedef struct MPOpts {
|
|||||||
int force_srate;
|
int force_srate;
|
||||||
double playback_speed;
|
double playback_speed;
|
||||||
bool pitch_correction;
|
bool pitch_correction;
|
||||||
struct m_obj_settings *vf_settings, *vf_defs;
|
struct m_obj_settings *vf_settings;
|
||||||
struct m_obj_settings *af_settings, *af_defs;
|
struct m_obj_settings *af_settings;
|
||||||
struct filter_opts *filter_opts;
|
struct filter_opts *filter_opts;
|
||||||
struct dec_wrapper_opts *dec_wrapper;
|
struct dec_wrapper_opts *dec_wrapper;
|
||||||
char **sub_name;
|
char **sub_name;
|
||||||
|
Loading…
Reference in New Issue
Block a user