Commit eebe0b02 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '63e58c55'

* commit '63e58c55':
  vf_delogo: switch to an AVOptions-based system.

Conflicts:
	libavfilter/vf_delogo.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 1c3cdf53 63e58c55
...@@ -2486,12 +2486,7 @@ Suppress a TV station logo by a simple interpolation of the surrounding ...@@ -2486,12 +2486,7 @@ Suppress a TV station logo by a simple interpolation of the surrounding
pixels. Just set a rectangle covering the logo and watch it disappear pixels. Just set a rectangle covering the logo and watch it disappear
(and sometimes something even uglier appear - your mileage may vary). (and sometimes something even uglier appear - your mileage may vary).
The filter accepts parameters as a string of the form This filter accepts the following options:
"@var{x}:@var{y}:@var{w}:@var{h}:@var{band}", or as a list of
@var{key}=@var{value} pairs, separated by ":".
The description of the accepted parameters follows.
@table @option @table @option
@item x, y @item x, y
...@@ -2520,12 +2515,6 @@ finding the right @var{x}, @var{y}, @var{w}, @var{h} parameters, and ...@@ -2520,12 +2515,6 @@ finding the right @var{x}, @var{y}, @var{w}, @var{h} parameters, and
Set a rectangle covering the area with top left corner coordinates 0,0 Set a rectangle covering the area with top left corner coordinates 0,0
and size 100x77, setting a band of size 10: and size 100x77, setting a band of size 10:
@example @example
delogo=0:0:100:77:10
@end example
@item
As the previous example, but use named options:
@example
delogo=x=0:y=0:w=100:h=77:band=10 delogo=x=0:y=0:w=100:h=77:band=10
@end example @end example
......
...@@ -661,6 +661,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque ...@@ -661,6 +661,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
!strcmp(filter->filter->name, "boxblur" ) || !strcmp(filter->filter->name, "boxblur" ) ||
!strcmp(filter->filter->name, "crop" ) || !strcmp(filter->filter->name, "crop" ) ||
!strcmp(filter->filter->name, "cropdetect") || !strcmp(filter->filter->name, "cropdetect") ||
!strcmp(filter->filter->name, "delogo" ) ||
!strcmp(filter->filter->name, "format") || !strcmp(filter->filter->name, "format") ||
!strcmp(filter->filter->name, "noformat") || !strcmp(filter->filter->name, "noformat") ||
!strcmp(filter->filter->name, "resample") !strcmp(filter->filter->name, "resample")
......
...@@ -143,14 +143,14 @@ typedef struct { ...@@ -143,14 +143,14 @@ typedef struct {
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static const AVOption delogo_options[]= { static const AVOption delogo_options[]= {
{"x", "set logo x position", OFFSET(x), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, { "x", "set logo x position", OFFSET(x), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
{"y", "set logo y position", OFFSET(y), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, { "y", "set logo y position", OFFSET(y), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
{"w", "set logo width", OFFSET(w), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, { "w", "set logo width", OFFSET(w), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
{"h", "set logo height", OFFSET(h), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, FLAGS}, { "h", "set logo height", OFFSET(h), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
{"band", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.i64 = 4}, -1, INT_MAX, FLAGS}, { "band", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, { .i64 = 4 }, -1, INT_MAX, FLAGS },
{"t", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.i64 = 4}, -1, INT_MAX, FLAGS}, { "t", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, { .i64 = 4 }, -1, INT_MAX, FLAGS },
{"show", "show delogo area", OFFSET(show), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS}, { "show", "show delogo area", OFFSET(show), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
{NULL}, { NULL },
}; };
AVFILTER_DEFINE_CLASS(delogo); AVFILTER_DEFINE_CLASS(delogo);
...@@ -259,17 +259,14 @@ static const AVFilterPad avfilter_vf_delogo_outputs[] = { ...@@ -259,17 +259,14 @@ static const AVFilterPad avfilter_vf_delogo_outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] = { "x", "y", "w", "h", "band", NULL };
AVFilter avfilter_vf_delogo = { AVFilter avfilter_vf_delogo = {
.name = "delogo", .name = "delogo",
.description = NULL_IF_CONFIG_SMALL("Remove logo from input video."), .description = NULL_IF_CONFIG_SMALL("Remove logo from input video."),
.priv_size = sizeof(DelogoContext), .priv_size = sizeof(DelogoContext),
.priv_class = &delogo_class,
.init = init, .init = init,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = avfilter_vf_delogo_inputs, .inputs = avfilter_vf_delogo_inputs,
.outputs = avfilter_vf_delogo_outputs, .outputs = avfilter_vf_delogo_outputs,
.priv_class = &delogo_class,
.shorthand = shorthand,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment