From c23bf5311fce3b59e9111e5de646ee57b48be27f Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 25 May 2013 15:53:55 +0200 Subject: vf_lavfi: allow setting avopts --- video/filter/vf_lavfi.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'video') diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c index 77d85cb603..53e22c21b9 100644 --- a/video/filter/vf_lavfi.c +++ b/video/filter/vf_lavfi.c @@ -38,6 +38,7 @@ #include "core/mp_msg.h" #include "core/m_option.h" #include "core/m_struct.h" +#include "core/av_opts.h" #include "video/img_format.h" #include "video/mp_image.h" @@ -77,6 +78,7 @@ struct vf_priv_s { // options char *cfg_graph; int64_t cfg_sws_flags; + char *cfg_avopts; }; static const struct vf_priv_s vf_priv_dflt = { @@ -131,6 +133,12 @@ static bool recreate_graph(struct vf_instance *vf, int width, int height, if (!graph) goto error; + if (parse_avopts(graph, p->cfg_avopts) < 0) { + mp_msg(MSGT_VFILTER, MSGL_FATAL, "lavfi: could not set opts: '%s'\n", + p->cfg_avopts); + goto error; + } + AVFilterInOut *outputs = avfilter_inout_alloc(); AVFilterInOut *inputs = avfilter_inout_alloc(); if (!outputs || !inputs) @@ -323,6 +331,7 @@ static int vf_open(vf_instance_t *vf, char *args) static const m_option_t vf_opts_fields[] = { {"graph", ST_OFF(cfg_graph), CONF_TYPE_STRING, CONF_MIN, 1}, {"sws_flags", ST_OFF(cfg_sws_flags), CONF_TYPE_INT64}, + {"o", ST_OFF(cfg_avopts), CONF_TYPE_STRING}, {0} }; -- cgit v1.2.3