summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_stereo3d.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-11 17:32:41 +0100
committerwm4 <wm4@nowhere>2015-02-11 17:35:58 +0100
commit2522bff5657c7566ac956998bcb32a0c9c3d2667 (patch)
tree5619032a1a103f1d101868c1843dca23b69ce8fb /video/filter/vf_stereo3d.c
parent73d23a94059e40fd1209912d9365a2fb910eb8b1 (diff)
downloadmpv-2522bff5657c7566ac956998bcb32a0c9c3d2667.tar.bz2
mpv-2522bff5657c7566ac956998bcb32a0c9c3d2667.tar.xz
video/filters: simplify libavfilter bridge
Remove the confusing crap that allowed a filter using the libavfilter bridge to be compiled without libavfilter. Instead, compile the wrappers only if libavfilter is enabled at compile time. The only filter which still requires it is vf_stereo3d (unfortunately). Special-case this one. (The whole filter and how it interacts with lavfi is pure braindeath anyway.)
Diffstat (limited to 'video/filter/vf_stereo3d.c')
-rw-r--r--video/filter/vf_stereo3d.c41
1 files changed, 29 insertions, 12 deletions
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;
}