diff options
author | Rudolf Polzer <divverent@xonotic.org> | 2013-06-14 14:32:18 +0200 |
---|---|---|
committer | Rudolf Polzer <divverent@xonotic.org> | 2013-06-16 17:11:25 +0200 |
commit | 7ae4242820236bdd32ed080d05d674fdfe16483e (patch) | |
tree | f625666c77cc3abee2772816484ecb4a0be07230 /video/filter/vf_dlopen.c | |
parent | de63e1d15e93892c2c74c417fdf4b195b70fc8ee (diff) | |
download | mpv-7ae4242820236bdd32ed080d05d674fdfe16483e.tar.bz2 mpv-7ae4242820236bdd32ed080d05d674fdfe16483e.tar.xz |
vf_dlopen filters: add an "ildetect" filter that detects interlacing
The filter analyzes each frame for combing, and decides at the end
whether the content is likely interlaced, telecined or progressive.
Diffstat (limited to 'video/filter/vf_dlopen.c')
-rw-r--r-- | video/filter/vf_dlopen.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/video/filter/vf_dlopen.c b/video/filter/vf_dlopen.c index 5bdd884c7a..2f13287e3d 100644 --- a/video/filter/vf_dlopen.c +++ b/video/filter/vf_dlopen.c @@ -48,7 +48,7 @@ static struct vf_priv_s { const char *cfg_dllname; int cfg_argc; - const char *cfg_argv[4]; + const char *cfg_argv[16]; void *dll; struct vf_dlopen_context filter; @@ -318,11 +318,16 @@ static int vf_open(vf_instance_t *vf, char *args) vf->priv->filter.minor_version = VF_DLOPEN_MINOR_VERSION; // count arguments - for (vf->priv->cfg_argc = 0; - vf->priv->cfg_argc < sizeof(vf->priv->cfg_argv) / sizeof(vf->priv->cfg_argv[0]) && vf->priv->cfg_argv[vf->priv->cfg_argc]; - ++vf->priv->cfg_argc) + for (vf->priv->cfg_argc = sizeof(vf->priv->cfg_argv) / sizeof(vf->priv->cfg_argv[0]); + vf->priv->cfg_argc > 0 && !vf->priv->cfg_argv[vf->priv->cfg_argc - 1]; + --vf->priv->cfg_argc) ; + // fix empty arguments + for (i = 0; i < vf->priv->cfg_argc; ++i) + if (vf->priv->cfg_argv[i] == NULL) + vf->priv->cfg_argv[i] = talloc_strdup (vf->priv, ""); + if (func(&vf->priv->filter, vf->priv->cfg_argc, vf->priv->cfg_argv) < 0) { mp_msg(MSGT_VFILTER, MSGL_ERR, "function did not create a filter: %s\n", @@ -352,6 +357,18 @@ static m_option_t vf_opts_fields[] = { {"a1", ST_OFF(cfg_argv[1]), CONF_TYPE_STRING, 0, 0, 0, NULL}, {"a2", ST_OFF(cfg_argv[2]), CONF_TYPE_STRING, 0, 0, 0, NULL}, {"a3", ST_OFF(cfg_argv[3]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a4", ST_OFF(cfg_argv[4]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a5", ST_OFF(cfg_argv[5]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a6", ST_OFF(cfg_argv[6]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a7", ST_OFF(cfg_argv[7]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a8", ST_OFF(cfg_argv[8]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a9", ST_OFF(cfg_argv[9]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a10", ST_OFF(cfg_argv[10]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a11", ST_OFF(cfg_argv[11]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a12", ST_OFF(cfg_argv[12]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a13", ST_OFF(cfg_argv[13]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a14", ST_OFF(cfg_argv[14]), CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"a15", ST_OFF(cfg_argv[15]), CONF_TYPE_STRING, 0, 0, 0, NULL}, { NULL, NULL, 0, 0, 0, 0, NULL } }; |