Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
63e58c55
Commit
63e58c55
authored
Feb 25, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_delogo: switch to an AVOptions-based system.
parent
460e7b4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
35 deletions
+11
-35
filters.texi
doc/filters.texi
+1
-12
vf_delogo.c
libavfilter/vf_delogo.c
+10
-23
No files found.
doc/filters.texi
View file @
63e58c55
...
...
@@ -772,12 +772,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
(and sometimes something even uglier appear - your mileage may vary).
The filter accepts parameters as a string of the form
"@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.
This filter accepts the following options:
@table @option
@item x, y
...
...
@@ -807,12 +802,6 @@ Some examples follow.
Set a rectangle covering the area with top left corner coordinates 0,0
and size 100x77, setting a band of size 10:
@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
@end example
...
...
libavfilter/vf_delogo.c
View file @
63e58c55
...
...
@@ -136,16 +136,17 @@ typedef struct {
}
DelogoContext
;
#define OFFSET(x) offsetof(DelogoContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
delogo_options
[]
=
{
{
"x"
,
"set logo x position"
,
OFFSET
(
x
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
INT_MAX
},
{
"y"
,
"set logo y position"
,
OFFSET
(
y
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
INT_MAX
},
{
"w"
,
"set logo width"
,
OFFSET
(
w
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
INT_MAX
},
{
"h"
,
"set logo height"
,
OFFSET
(
h
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
INT_MAX
},
{
"band"
,
"set delogo area band size"
,
OFFSET
(
band
),
AV_OPT_TYPE_INT
,
{.
i64
=
4
},
-
1
,
INT_MAX
},
{
"t"
,
"set delogo area band size"
,
OFFSET
(
band
),
AV_OPT_TYPE_INT
,
{.
i64
=
4
},
-
1
,
INT_MAX
},
{
"show"
,
"show delogo area"
,
OFFSET
(
show
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
},
{
NULL
},
{
"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
},
{
"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
},
{
"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
},
{
"show"
,
"show delogo area"
,
OFFSET
(
show
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
FLAGS
},
{
NULL
},
};
static
const
char
*
delogo_get_name
(
void
*
ctx
)
...
...
@@ -175,21 +176,6 @@ static int query_formats(AVFilterContext *ctx)
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
DelogoContext
*
delogo
=
ctx
->
priv
;
int
ret
=
0
;
delogo
->
class
=
&
delogo_class
;
av_opt_set_defaults
(
delogo
);
if
(
args
)
ret
=
sscanf
(
args
,
"%d:%d:%d:%d:%d"
,
&
delogo
->
x
,
&
delogo
->
y
,
&
delogo
->
w
,
&
delogo
->
h
,
&
delogo
->
band
);
if
(
ret
==
5
)
{
if
(
delogo
->
band
<
0
)
delogo
->
show
=
1
;
}
else
if
((
ret
=
(
av_set_options_string
(
delogo
,
args
,
"="
,
":"
)))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error parsing options string: '%s'
\n
"
,
args
);
return
ret
;
}
#define CHECK_UNSET_OPT(opt) \
if (delogo->opt == -1) { \
...
...
@@ -282,6 +268,7 @@ AVFilter avfilter_vf_delogo = {
.
name
=
"delogo"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Remove logo from input video."
),
.
priv_size
=
sizeof
(
DelogoContext
),
.
priv_class
=
&
delogo_class
,
.
init
=
init
,
.
query_formats
=
query_formats
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment