vf_delogo: reroute to vf_lavfi

The ``file`` suboption is unsupported on lavfi.
This commit is contained in:
wm4 2013-12-03 22:22:35 +01:00
parent 86ba9a7f24
commit 5064ef87c3
2 changed files with 24 additions and 8 deletions

View File

@ -713,7 +713,7 @@ Available filters are:
``<lines>`` ``<lines>``
number of lines to select from the middle of the image (default: 12) number of lines to select from the middle of the image (default: 12)
``delogo[=x:y:w:h:t]`` ``delogo[=x:y:w:h:t:show]``
Suppresses a TV station logo by a simple interpolation of the surrounding Suppresses a TV station logo by a simple interpolation of the surrounding
pixels. Just set a rectangle covering the logo and watch it disappear (and pixels. Just set a rectangle covering the logo and watch it disappear (and
sometimes something even uglier appear - your mileage may vary). sometimes something even uglier appear - your mileage may vary).
@ -730,11 +730,9 @@ Available filters are:
You can specify a text file to load the coordinates from. Each line You can specify a text file to load the coordinates from. Each line
must have a timestamp (in seconds, and in ascending order) and the must have a timestamp (in seconds, and in ascending order) and the
``x:y:w:h:t`` coordinates (``t`` can be omitted). ``x:y:w:h:t`` coordinates (``t`` can be omitted).
(Not supported when using libavfilter.)
.. note:: ``show``
Draw a rectangle showing the area defined by x/y/w/h.
Deprecated. Use libavfilter's ``delogo`` or ``removelogo`` filters
through ``--vf=lavfi`` instead.
``screenshot`` ``screenshot``
Optional filter for screenshot support. This is only needed if the video Optional filter for screenshot support. This is only needed if the video

View File

@ -33,6 +33,7 @@
#include "video/img_format.h" #include "video/img_format.h"
#include "video/mp_image.h" #include "video/mp_image.h"
#include "vf.h" #include "vf.h"
#include "vf_lavfi.h"
#include "video/memcpy_pic.h" #include "video/memcpy_pic.h"
#include "mpvcore/m_option.h" #include "mpvcore/m_option.h"
@ -48,9 +49,10 @@ static struct vf_priv_s {
} *timed_rect; } *timed_rect;
int n_timed_rect; int n_timed_rect;
int cur_timed_rect; int cur_timed_rect;
struct vf_lw_opts *lw_opts;
} const vf_priv_dflt = { } const vf_priv_dflt = {
0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
NULL, NULL, 0, 0, NULL, NULL, 0, 0,
}; };
@ -63,7 +65,6 @@ static struct vf_priv_s {
*/ */
static void fix_band(struct vf_priv_s *p) static void fix_band(struct vf_priv_s *p)
{ {
p->show = 0;
if (p->band < 0) { if (p->band < 0) {
p->band = 4; p->band = 4;
p->show = 1; p->show = 1;
@ -280,10 +281,25 @@ load_error:
} }
static int vf_open(vf_instance_t *vf, char *args){ static int vf_open(vf_instance_t *vf, char *args){
struct vf_priv_s *p = vf->priv;
vf->config=config; vf->config=config;
vf->filter=filter; vf->filter=filter;
vf->query_format=query_format; vf->query_format=query_format;
int band = p->band;
int show = p->show;
if (band < 0) {
band = 4;
show = 1;
}
if (vf_lw_set_graph(vf, p->lw_opts, "delogo", "%d:%d:%d:%d:%d:%d",
p->xoff, p->yoff, p->lw, p->lh, band, show) >= 0)
{
if (p->file && p->file[0])
mp_msg(MSGT_VFILTER, MSGL_WARN, "delogo: file argument ignored\n");
return 1;
}
if (vf->priv->file) { if (vf->priv->file) {
if (load_timed_rectangles(vf->priv)) if (load_timed_rectangles(vf->priv))
return 0; return 0;
@ -312,6 +328,8 @@ static const m_option_t vf_opts_fields[] = {
OPT_INT("t", band, 0), OPT_INT("t", band, 0),
OPT_INT("band", band, 0), // alias OPT_INT("band", band, 0), // alias
OPT_STRING("file", file, 0), OPT_STRING("file", file, 0),
OPT_FLAG("show", show, 0),
OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
{0} {0}
}; };