summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-03 22:22:35 +0100
committerwm4 <wm4@nowhere>2013-12-04 00:07:39 +0100
commit5064ef87c3efbcd6bb04d835f6950172a457a473 (patch)
tree4654f502257127b0e277f63c257b32d0bd64f99b
parent86ba9a7f24bb977898fd6b802f0165f7c297e2be (diff)
downloadmpv-5064ef87c3efbcd6bb04d835f6950172a457a473.tar.bz2
mpv-5064ef87c3efbcd6bb04d835f6950172a457a473.tar.xz
vf_delogo: reroute to vf_lavfi
The ``file`` suboption is unsupported on lavfi.
-rw-r--r--DOCS/man/en/vf.rst10
-rw-r--r--video/filter/vf_delogo.c22
2 files changed, 24 insertions, 8 deletions
diff --git a/DOCS/man/en/vf.rst b/DOCS/man/en/vf.rst
index 3bd55d88cb..3823bcf4c4 100644
--- a/DOCS/man/en/vf.rst
+++ b/DOCS/man/en/vf.rst
@@ -713,7 +713,7 @@ Available filters are:
``<lines>``
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
pixels. Just set a rectangle covering the logo and watch it disappear (and
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
must have a timestamp (in seconds, and in ascending order) and the
``x:y:w:h:t`` coordinates (``t`` can be omitted).
-
- .. note::
-
- Deprecated. Use libavfilter's ``delogo`` or ``removelogo`` filters
- through ``--vf=lavfi`` instead.
+ (Not supported when using libavfilter.)
+ ``show``
+ Draw a rectangle showing the area defined by x/y/w/h.
``screenshot``
Optional filter for screenshot support. This is only needed if the video
diff --git a/video/filter/vf_delogo.c b/video/filter/vf_delogo.c
index f609d35a81..6bd538cba5 100644
--- a/video/filter/vf_delogo.c
+++ b/video/filter/vf_delogo.c
@@ -33,6 +33,7 @@
#include "video/img_format.h"
#include "video/mp_image.h"
#include "vf.h"
+#include "vf_lavfi.h"
#include "video/memcpy_pic.h"
#include "mpvcore/m_option.h"
@@ -48,9 +49,10 @@ static struct vf_priv_s {
} *timed_rect;
int n_timed_rect;
int cur_timed_rect;
+ struct vf_lw_opts *lw_opts;
} const vf_priv_dflt = {
0,
- 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0,
NULL, NULL, 0, 0,
};
@@ -63,7 +65,6 @@ static struct vf_priv_s {
*/
static void fix_band(struct vf_priv_s *p)
{
- p->show = 0;
if (p->band < 0) {
p->band = 4;
p->show = 1;
@@ -280,10 +281,25 @@ load_error:
}
static int vf_open(vf_instance_t *vf, char *args){
+ struct vf_priv_s *p = vf->priv;
vf->config=config;
vf->filter=filter;
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 (load_timed_rectangles(vf->priv))
return 0;
@@ -312,6 +328,8 @@ static const m_option_t vf_opts_fields[] = {
OPT_INT("t", band, 0),
OPT_INT("band", band, 0), // alias
OPT_STRING("file", file, 0),
+ OPT_FLAG("show", show, 0),
+ OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
{0}
};