summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/vf.rst4
-rw-r--r--player/video.c7
-rw-r--r--video/filter/vf.c6
-rw-r--r--video/filter/vf_buffer.c1
-rw-r--r--video/filter/vf_crop.c1
-rw-r--r--video/filter/vf_dlopen.c2
-rw-r--r--video/filter/vf_dsize.c2
-rw-r--r--video/filter/vf_eq.c3
-rw-r--r--video/filter/vf_expand.c2
-rw-r--r--video/filter/vf_flip.c2
-rw-r--r--video/filter/vf_gradfun.c2
-rw-r--r--video/filter/vf_lavfi.h4
-rw-r--r--video/filter/vf_mirror.c1
-rw-r--r--video/filter/vf_noformat.c1
-rw-r--r--video/filter/vf_pullup.c2
-rw-r--r--video/filter/vf_rotate.c5
-rw-r--r--video/filter/vf_scale.c7
-rw-r--r--video/filter/vf_stereo3d.c6
-rw-r--r--video/filter/vf_sub.c1
-rw-r--r--video/filter/vf_yadif.c6
20 files changed, 61 insertions, 4 deletions
diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst
index e61b758af5..28fd7d7e8e 100644
--- a/DOCS/man/vf.rst
+++ b/DOCS/man/vf.rst
@@ -55,6 +55,10 @@ normal filter parameters.
wrapper, which gives you access to most of libavfilter's filters. This
includes all filters that have been ported from MPlayer to libavfilter.
+ Most filters are deprecated in some ways, unless they're only available
+ in mpv (such as filters which deal with mpv specifics, or which are
+ implemented in mpv only).
+
Video filters are managed in lists. There are a few commands to manage the
filter list.
diff --git a/player/video.c b/player/video.c
index ee0e89c93a..eecfea5482 100644
--- a/player/video.c
+++ b/player/video.c
@@ -189,7 +189,8 @@ static int probe_deint_filters(struct vo_chain *vo_c)
if (check_output_format(vo_c, IMGFMT_D3D11VA) ||
check_output_format(vo_c, IMGFMT_D3D11NV12))
return try_filter(vo_c, "d3d11vpp", VF_DEINTERLACE_LABEL, NULL);
- return try_filter(vo_c, "yadif", VF_DEINTERLACE_LABEL, NULL);
+ char *args[] = {"warn", "no", NULL};
+ return try_filter(vo_c, "yadif", VF_DEINTERLACE_LABEL, args);
}
// Reconfigure the filter chain according to the new input format.
@@ -220,7 +221,7 @@ static void filter_reconfig(struct MPContext *mpctx, struct vo_chain *vo_c)
if (params.rotate) {
if (!(vo_c->vo->driver->caps & VO_CAP_ROTATE90) || params.rotate % 90) {
// Try to insert a rotation filter.
- char *args[] = {"angle", "auto", NULL};
+ char *args[] = {"angle", "auto", "warn", "no", NULL};
if (try_filter(vo_c, "rotate", "autorotate", args) < 0)
MP_ERR(vo_c, "Can't insert rotation filter.\n");
}
@@ -231,7 +232,7 @@ static void filter_reconfig(struct MPContext *mpctx, struct vo_chain *vo_c)
{
char *to = (char *)MP_STEREO3D_NAME(params.stereo_out);
if (to) {
- char *args[] = {"in", "auto", "out", to, NULL, NULL};
+ char *args[] = {"in", "auto", "out", to, "warn", "no", NULL, NULL};
if (try_filter(vo_c, "stereo3d", "autostereo3d", args) < 0)
MP_ERR(vo_c, "Can't insert 3D conversion filter.\n");
}
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 5208c7f824..fcf273e207 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -579,7 +579,11 @@ static void update_formats(struct vf_chain *c, struct vf_instance *vf,
}
query_formats(fmts, vf);
const char *filter = find_conv_filter(fmts, out_formats);
- struct vf_instance *conv = vf_open(c, filter, NULL);
+ char **args = NULL;
+ char *args_no_warn[] = {"warn", "no", NULL};
+ if (strcmp(filter, "scale") == 0)
+ args = args_no_warn;
+ struct vf_instance *conv = vf_open(c, filter, args);
if (conv) {
conv->autoinserted = true;
conv->next = vf->next;
diff --git a/video/filter/vf_buffer.c b/video/filter/vf_buffer.c
index 772f7cbe72..f08dfec12d 100644
--- a/video/filter/vf_buffer.c
+++ b/video/filter/vf_buffer.c
@@ -65,6 +65,7 @@ static void uninit(vf_instance_t *vf)
static int vf_open(vf_instance_t *vf)
{
+ MP_WARN(vf, "This filter is deprecated. No replacement.\n");
vf->filter_ext = filter_ext;
vf->control = control;
vf->uninit = uninit;
diff --git a/video/filter/vf_crop.c b/video/filter/vf_crop.c
index 6f9a788fef..79a2fce88c 100644
--- a/video/filter/vf_crop.c
+++ b/video/filter/vf_crop.c
@@ -100,6 +100,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
}
static int vf_open(vf_instance_t *vf){
+ MP_WARN(vf, "This filter is deprecated. Use lavfi crop instead.\n");
vf->reconfig=reconfig;
vf->filter=filter;
vf->query_format=query_format;
diff --git a/video/filter/vf_dlopen.c b/video/filter/vf_dlopen.c
index 1ef37e31a5..a53b0d191c 100644
--- a/video/filter/vf_dlopen.c
+++ b/video/filter/vf_dlopen.c
@@ -263,6 +263,8 @@ static int vf_open(vf_instance_t *vf)
return 0;
}
+ MP_WARN(vf, "This filter is deprecated. No replacement.\n");
+
vf->priv->dll = DLLOpen(vf->priv->cfg_dllname);
if (!vf->priv->dll) {
MP_ERR(vf, "library not found: %s\n",
diff --git a/video/filter/vf_dsize.c b/video/filter/vf_dsize.c
index b498b317f6..27d21c085e 100644
--- a/video/filter/vf_dsize.c
+++ b/video/filter/vf_dsize.c
@@ -83,6 +83,8 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
static int vf_open(vf_instance_t *vf)
{
+ MP_WARN(vf, "This filter is deprecated. No replacement.\n");
+
vf->reconfig = reconfig;
return 1;
}
diff --git a/video/filter/vf_eq.c b/video/filter/vf_eq.c
index 33b340e792..9be749a1de 100644
--- a/video/filter/vf_eq.c
+++ b/video/filter/vf_eq.c
@@ -390,6 +390,9 @@ int vf_open(vf_instance_t *vf)
vf_eq2_t *eq2;
double *par = vf->priv->par;
+ MP_WARN(vf, "This filter is deprecated. Use lavfi eq instead.\n"
+ "For interactive eq, there is no replacement.\n");
+
vf->control = control;
vf->query_format = query_format;
vf->filter = filter;
diff --git a/video/filter/vf_expand.c b/video/filter/vf_expand.c
index a788568e14..216c47a6ac 100644
--- a/video/filter/vf_expand.c
+++ b/video/filter/vf_expand.c
@@ -142,6 +142,8 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
}
static int vf_open(vf_instance_t *vf){
+ MP_WARN(vf, "This filter is deprecated. Use lavfi pad instead.\n");
+
vf->reconfig=reconfig;
vf->query_format=query_format;
vf->filter=filter;
diff --git a/video/filter/vf_flip.c b/video/filter/vf_flip.c
index bec7e9b52f..30658e48dd 100644
--- a/video/filter/vf_flip.c
+++ b/video/filter/vf_flip.c
@@ -41,6 +41,8 @@ static int query_format(struct vf_instance *vf, unsigned int fmt)
}
static int vf_open(vf_instance_t *vf){
+ MP_WARN(vf, "This filter is deprecated. Use lavfi vflip instead.\n");
+
vf->filter=filter;
vf->query_format = query_format;
return 1;
diff --git a/video/filter/vf_gradfun.c b/video/filter/vf_gradfun.c
index 78e1f4e3d6..c34b77f82a 100644
--- a/video/filter/vf_gradfun.c
+++ b/video/filter/vf_gradfun.c
@@ -59,6 +59,8 @@ static int lavfi_reconfig(struct vf_instance *vf,
static int vf_open(vf_instance_t *vf)
{
+ MP_WARN(vf, "%s", VF_LW_REPLACE);
+
bool have_radius = vf->priv->cfg_radius > -1;
bool have_size = vf->priv->cfg_size > -1;
diff --git a/video/filter/vf_lavfi.h b/video/filter/vf_lavfi.h
index 0b1f49323a..9196532138 100644
--- a/video/filter/vf_lavfi.h
+++ b/video/filter/vf_lavfi.h
@@ -18,4 +18,8 @@ void vf_lw_set_reconfig_cb(struct vf_instance *vf,
struct mp_image_params *in,
struct mp_image_params *out));
+#define VF_LW_REPLACE "This filter will be replaced by using libavfilter " \
+ "option syntax directly. Parts of the old syntax will stop working, " \
+ "and some defaults may change.\n"
+
#endif
diff --git a/video/filter/vf_mirror.c b/video/filter/vf_mirror.c
index 342c6abd2a..f835d38130 100644
--- a/video/filter/vf_mirror.c
+++ b/video/filter/vf_mirror.c
@@ -22,6 +22,7 @@
static int vf_open(vf_instance_t *vf)
{
+ MP_WARN(vf, "This filter is deprecated. Use lavfi hflip instead.\n");
return vf_lw_set_graph(vf, NULL, NULL, "hflip") >= 0;
}
diff --git a/video/filter/vf_noformat.c b/video/filter/vf_noformat.c
index 7fcc3de8a2..2d3985c216 100644
--- a/video/filter/vf_noformat.c
+++ b/video/filter/vf_noformat.c
@@ -44,6 +44,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt){
}
static int vf_open(vf_instance_t *vf){
+ MP_WARN(vf, "This filter is deprecated and will be removed (no replacement)\n");
vf->query_format=query_format;
return 1;
}
diff --git a/video/filter/vf_pullup.c b/video/filter/vf_pullup.c
index 39907da17c..eee6f43d7f 100644
--- a/video/filter/vf_pullup.c
+++ b/video/filter/vf_pullup.c
@@ -38,6 +38,8 @@ struct vf_priv_s {
static int vf_open(vf_instance_t *vf)
{
+ MP_WARN(vf, "%s", VF_LW_REPLACE);
+
struct vf_priv_s *p = vf->priv;
const char *pname[3] = {"y", "u", "v"};
if (vf_lw_set_graph(vf, p->lw_opts, "pullup", "%d:%d:%d:%d:%d:%s",
diff --git a/video/filter/vf_rotate.c b/video/filter/vf_rotate.c
index dcaba53c6a..be1247f4e9 100644
--- a/video/filter/vf_rotate.c
+++ b/video/filter/vf_rotate.c
@@ -29,6 +29,7 @@
struct vf_priv_s {
int angle;
+ int warn;
struct vf_lw_opts *lw_opts;
};
@@ -67,6 +68,9 @@ static int vf_open(vf_instance_t *vf)
{
struct vf_priv_s *p = vf->priv;
+ if (p->warn)
+ MP_WARN(vf, "%s", VF_LW_REPLACE);
+
if (vf_lw_set_graph(vf, p->lw_opts, NULL, "%s", rot[p->angle]) >= 0) {
vf_lw_set_reconfig_cb(vf, lavfi_reconfig);
return 1;
@@ -88,6 +92,7 @@ const vf_info_t vf_info_rotate = {
{"180", 2},
{"270", 3},
{"auto", 4})),
+ OPT_FLAG("warn", warn, 0, OPTDEF_INT(1)),
OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
{0}
},
diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c
index 8b1f0a1116..0759d28723 100644
--- a/video/filter/vf_scale.c
+++ b/video/filter/vf_scale.c
@@ -39,6 +39,8 @@
#include "options/m_option.h"
+#include "vf_lavfi.h"
+
static struct vf_priv_s {
int w, h;
int cfg_w, cfg_h;
@@ -47,11 +49,13 @@ static struct vf_priv_s {
struct mp_sws_context *sws;
int noup;
int accurate_rnd;
+ int warn;
} const vf_priv_dflt = {
0, 0,
-1, -1,
0,
{SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT},
+ .warn = 1,
};
static int find_best_out(vf_instance_t *vf, int in_format)
@@ -238,6 +242,8 @@ static int vf_open(vf_instance_t *vf)
vf->priv->sws->log = vf->log;
vf->priv->sws->params[0] = vf->priv->param[0];
vf->priv->sws->params[1] = vf->priv->param[1];
+ if (vf->priv->warn)
+ MP_WARN(vf, "%s", VF_LW_REPLACE);
return 1;
}
@@ -250,6 +256,7 @@ static const m_option_t vf_opts_fields[] = {
OPT_INTRANGE("chr-drop", v_chr_drop, 0, 0, 3),
OPT_INTRANGE("noup", noup, 0, 0, 2),
OPT_FLAG("arnd", accurate_rnd, 0),
+ OPT_FLAG("warn", warn, 0),
{0}
};
diff --git a/video/filter/vf_stereo3d.c b/video/filter/vf_stereo3d.c
index bde261712e..51cfff8afa 100644
--- a/video/filter/vf_stereo3d.c
+++ b/video/filter/vf_stereo3d.c
@@ -72,10 +72,12 @@ struct vf_priv_s {
int in_fmt;
int out_fmt;
bool auto_in;
+ int warn;
struct vf_lw_opts *lw_opts;
} const vf_priv_default = {
SIDE_BY_SIDE_LR,
ANAGLYPH_RC_DUBOIS,
+ .warn = 1,
};
const struct m_opt_choice_alternatives stereo_code_names[] = {
@@ -185,6 +187,9 @@ static void lavfi_init(vf_instance_t *vf)
static int vf_open(vf_instance_t *vf)
{
+ if (vf->priv->warn)
+ MP_WARN(vf, "%s", VF_LW_REPLACE);
+
if (vf->priv->out_fmt == STEREO_AUTO) {
MP_FATAL(vf, "No autodetection for stereo output.\n");
return 0;
@@ -200,6 +205,7 @@ static int vf_open(vf_instance_t *vf)
static const m_option_t vf_opts_fields[] = {
OPT_CHOICE_C("in", in_fmt, 0, stereo_code_names),
OPT_CHOICE_C("out", out_fmt, 0, stereo_code_names),
+ OPT_FLAG("warn", warn, 0),
OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
{0}
};
diff --git a/video/filter/vf_sub.c b/video/filter/vf_sub.c
index a3680a3b9a..184ab8deb3 100644
--- a/video/filter/vf_sub.c
+++ b/video/filter/vf_sub.c
@@ -127,6 +127,7 @@ static int control(vf_instance_t *vf, int request, void *data)
static int vf_open(vf_instance_t *vf)
{
+ MP_WARN(vf, "This filter is deprecated and will be removed (no replacement)\n");
vf->reconfig = reconfig;
vf->query_format = query_format;
vf->control = control;
diff --git a/video/filter/vf_yadif.c b/video/filter/vf_yadif.c
index d1e1ffbac0..e044dcc6d7 100644
--- a/video/filter/vf_yadif.c
+++ b/video/filter/vf_yadif.c
@@ -32,12 +32,16 @@ struct vf_priv_s {
int mode;
int interlaced_only;
struct vf_lw_opts *lw_opts;
+ int warn;
};
static int vf_open(vf_instance_t *vf)
{
struct vf_priv_s *p = vf->priv;
+ if (p->warn)
+ MP_WARN(vf, "%s", VF_LW_REPLACE);
+
#if LIBAVFILTER_VERSION_MICRO >= 100
const char *mode[] = {"send_frame", "send_field", "send_frame_nospatial",
"send_field_nospatial"};
@@ -69,6 +73,7 @@ static const m_option_t vf_opts_fields[] = {
{"frame-nospatial", 2},
{"field-nospatial", 3})),
OPT_FLAG("interlaced-only", interlaced_only, 0),
+ OPT_FLAG("warn", warn, 0),
OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
{0}
};
@@ -81,6 +86,7 @@ const vf_info_t vf_info_yadif = {
.priv_defaults = &(const struct vf_priv_s){
.mode = 1,
.interlaced_only = 1,
+ .warn = 1,
},
.options = vf_opts_fields,
};