summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf.c16
-rw-r--r--video/filter/vf_delogo.c2
-rw-r--r--video/filter/vf_gradfun.c2
-rw-r--r--video/filter/vf_hqdn3d.c2
-rw-r--r--video/filter/vf_lavfi.c1
-rw-r--r--video/filter/vf_lavfi.h27
-rw-r--r--video/filter/vf_pullup.c2
-rw-r--r--video/filter/vf_rotate.c3
-rw-r--r--video/filter/vf_stereo3d.c41
-rw-r--r--video/filter/vf_unsharp.c2
-rw-r--r--video/filter/vf_yadif.c2
11 files changed, 45 insertions, 55 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index d60379ca6b..a228ba3a76 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -77,25 +77,25 @@ static const vf_info_t *const filter_list[] = {
&vf_info_format,
&vf_info_noformat,
&vf_info_flip,
- &vf_info_rotate,
&vf_info_mirror,
#if HAVE_LIBAVFILTER
&vf_info_lavfi,
-#endif
-
- &vf_info_screenshot,
-
+ &vf_info_rotate,
&vf_info_noise,
- &vf_info_eq,
&vf_info_gradfun,
&vf_info_unsharp,
&vf_info_hqdn3d,
- &vf_info_dsize,
&vf_info_pullup,
&vf_info_delogo,
- &vf_info_sub,
&vf_info_yadif,
+#endif
+
+ &vf_info_screenshot,
+
+ &vf_info_eq,
+ &vf_info_dsize,
+ &vf_info_sub,
&vf_info_stereo3d,
&vf_info_buffer,
#if HAVE_DLOPEN
diff --git a/video/filter/vf_delogo.c b/video/filter/vf_delogo.c
index e7da8d1aa5..8fdbd77fa2 100644
--- a/video/filter/vf_delogo.c
+++ b/video/filter/vf_delogo.c
@@ -48,7 +48,7 @@ static int vf_open(vf_instance_t *vf){
return 1;
}
- MP_FATAL(vf, "Requires libavfilter.\n");
+ MP_FATAL(vf, "This version of libavfilter has no 'delogo' filter.\n");
return 0;
}
diff --git a/video/filter/vf_gradfun.c b/video/filter/vf_gradfun.c
index b352521001..4831bcc214 100644
--- a/video/filter/vf_gradfun.c
+++ b/video/filter/vf_gradfun.c
@@ -79,7 +79,7 @@ static int vf_open(vf_instance_t *vf)
return 1;
}
- MP_FATAL(vf, "Requires libavfilter.\n");
+ MP_FATAL(vf, "This version of libavfilter has no 'gradfun' filter.\n");
return 0;
}
diff --git a/video/filter/vf_hqdn3d.c b/video/filter/vf_hqdn3d.c
index b06bf2e42c..063bf44908 100644
--- a/video/filter/vf_hqdn3d.c
+++ b/video/filter/vf_hqdn3d.c
@@ -42,7 +42,7 @@ static int vf_open(vf_instance_t *vf)
return 1;
}
- MP_FATAL(vf, "Requires libavfilter.\n");
+ MP_FATAL(vf, "This version of libavfilter has no 'hqdn3' filter.\n");
return 0;
}
diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c
index a356229a30..cb4c348552 100644
--- a/video/filter/vf_lavfi.c
+++ b/video/filter/vf_lavfi.c
@@ -38,6 +38,7 @@
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
+#include "config.h"
#include "common/av_common.h"
#include "common/msg.h"
#include "options/m_option.h"
diff --git a/video/filter/vf_lavfi.h b/video/filter/vf_lavfi.h
index d28d7e55d6..0b1f49323a 100644
--- a/video/filter/vf_lavfi.h
+++ b/video/filter/vf_lavfi.h
@@ -1,15 +1,11 @@
#ifndef MP_VF_LAVFI_H_
#define MP_VF_LAVFI_H_
-#include "config.h"
-
#include "common/common.h"
#include "vf.h"
struct vf_lw_opts;
-#if HAVE_LIBAVFILTER
-
extern const struct m_sub_options vf_lw_conf;
int vf_lw_set_graph(struct vf_instance *vf, struct vf_lw_opts *lavfi_opts,
@@ -21,28 +17,5 @@ void vf_lw_set_reconfig_cb(struct vf_instance *vf,
int (*reconfig)(struct vf_instance *vf,
struct mp_image_params *in,
struct mp_image_params *out));
-#else
-static inline
-int vf_lw_set_graph(struct vf_instance *vf, struct vf_lw_opts *lavfi_opts,
- char *filter, char *opts, ...)
-{
- return -1;
-}
-static void *vf_lw_old_priv(struct vf_instance *vf)
-{
- return 0;
-}
-static void vf_lw_update_graph(struct vf_instance *vf, char *filter, char *opts, ...)
-{
-}
-static void vf_lw_set_reconfig_cb(struct vf_instance *vf,
- int (*reconfig)(struct vf_instance *vf,
- struct mp_image_params *in,
- struct mp_image_params *out))
-{
-}
-#include "options/m_option.h"
-static const struct m_sub_options vf_lw_conf = {0};
-#endif
#endif
diff --git a/video/filter/vf_pullup.c b/video/filter/vf_pullup.c
index fbf500d8cd..86aaf54fc5 100644
--- a/video/filter/vf_pullup.c
+++ b/video/filter/vf_pullup.c
@@ -48,7 +48,7 @@ static int vf_open(vf_instance_t *vf)
return 1;
}
- MP_FATAL(vf, "Requires libavfilter.\n");
+ MP_FATAL(vf, "This version of libavfilter has no 'pullup' filter.\n");
return 0;
}
diff --git a/video/filter/vf_rotate.c b/video/filter/vf_rotate.c
index 9f0c60dd44..2df8f94591 100644
--- a/video/filter/vf_rotate.c
+++ b/video/filter/vf_rotate.c
@@ -66,8 +66,7 @@ static int vf_open(vf_instance_t *vf)
return 1;
}
- MP_FATAL(vf, "Requires libavfilter.\n");
- return 1;
+ return 0;
}
#define OPT_BASE_STRUCT struct vf_priv_s
diff --git a/video/filter/vf_stereo3d.c b/video/filter/vf_stereo3d.c
index e5a84f4ffc..886483cfe5 100644
--- a/video/filter/vf_stereo3d.c
+++ b/video/filter/vf_stereo3d.c
@@ -510,6 +510,8 @@ static bool handle_auto_in(struct vf_instance *vf)
return true;
}
+#if HAVE_LIBAVFILTER
+
static int lavfi_reconfig(struct vf_instance *vf,
struct mp_image_params *in,
struct mp_image_params *out)
@@ -528,6 +530,32 @@ static int lavfi_reconfig(struct vf_instance *vf,
return 0;
}
+static void lavfi_init(vf_instance_t *vf)
+{
+ if (vf->priv->in.fmt == STEREO_AUTO &&
+ vf_lw_set_graph(vf, vf->priv->lw_opts, "stereo3d", "null") >= 0)
+ {
+ vf_lw_set_reconfig_cb(vf, lavfi_reconfig);
+ return;
+ }
+
+ if (vf_lw_set_graph(vf, vf->priv->lw_opts, "stereo3d", "%s:%s",
+ rev_map_name(vf->priv->in.fmt),
+ rev_map_name(vf->priv->out.fmt)) >= 0)
+ return;
+}
+
+#else
+
+const struct m_sub_options vf_lw_conf = {0};
+
+static void lavfi_init(vf_instance_t *vf)
+{
+ // doing nothing will make it use the internal implementation
+}
+
+#endif
+
static int vf_open(vf_instance_t *vf)
{
vf->config = config;
@@ -541,18 +569,7 @@ static int vf_open(vf_instance_t *vf)
if (vf->priv->in.fmt == STEREO_AUTO)
vf->priv->auto_in = 1;
- if (vf->priv->in.fmt == STEREO_AUTO &&
- vf_lw_set_graph(vf, vf->priv->lw_opts, "stereo3d", "null") >= 0)
- {
- vf_lw_set_reconfig_cb(vf, lavfi_reconfig);
- return 1;
- }
-
- if (vf_lw_set_graph(vf, vf->priv->lw_opts, "stereo3d", "%s:%s",
- rev_map_name(vf->priv->in.fmt),
- rev_map_name(vf->priv->out.fmt)) >= 0)
- return 1;
-
+ lavfi_init(vf);
return 1;
}
diff --git a/video/filter/vf_unsharp.c b/video/filter/vf_unsharp.c
index cfd490f9fa..81ffbb73c4 100644
--- a/video/filter/vf_unsharp.c
+++ b/video/filter/vf_unsharp.c
@@ -55,7 +55,7 @@ static int vf_open(vf_instance_t *vf)
return 1;
}
- MP_FATAL(vf, "Requires libavfilter.\n");
+ MP_FATAL(vf, "This version of libavfilter has no 'unsharp' filter.\n");
return 0;
}
diff --git a/video/filter/vf_yadif.c b/video/filter/vf_yadif.c
index b8ae679ab4..428188c0e1 100644
--- a/video/filter/vf_yadif.c
+++ b/video/filter/vf_yadif.c
@@ -52,7 +52,7 @@ static int vf_open(vf_instance_t *vf)
return 1;
}
- MP_FATAL(vf, "Requires libavfilter.\n");
+ MP_FATAL(vf, "This version of libavfilter has no 'yadif' filter.\n");
return 0;
}