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
1b2ed0c3
Commit
1b2ed0c3
authored
Oct 01, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_drawbox: implement process_command
parent
027a53dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
filters.texi
doc/filters.texi
+14
-0
vf_drawbox.c
libavfilter/vf_drawbox.c
+42
-0
No files found.
doc/filters.texi
View file @
1b2ed0c3
...
...
@@ -8847,6 +8847,13 @@ drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
@end example
@end itemize
@subsection Commands
This filter supports same commands as options.
The command accepts the same syntax of the corresponding option.
If the specified expression is not valid, it is kept at its current
value.
@section drawgrid
Draw a grid on the input image.
...
...
@@ -8932,6 +8939,13 @@ drawgrid=w=iw/3:h=ih/3:t=2:c=white@@0.5
@end example
@end itemize
@subsection Commands
This filter supports same commands as options.
The command accepts the same syntax of the corresponding option.
If the specified expression is not valid, it is kept at its current
value.
@anchor{drawtext}
@section drawtext
...
...
libavfilter/vf_drawbox.c
View file @
1b2ed0c3
...
...
@@ -273,6 +273,46 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
return
ff_filter_frame
(
inlink
->
dst
->
outputs
[
0
],
frame
);
}
static
int
process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
DrawBoxContext
*
s
=
ctx
->
priv
;
int
ret
;
if
(
!
strcmp
(
cmd
,
"w"
)
||
!
strcmp
(
cmd
,
"width"
)
||
!
strcmp
(
cmd
,
"h"
)
||
!
strcmp
(
cmd
,
"height"
)
||
!
strcmp
(
cmd
,
"x"
)
||
!
strcmp
(
cmd
,
"y"
)
||
!
strcmp
(
cmd
,
"t"
)
||
!
strcmp
(
cmd
,
"thickness"
)
||
!
strcmp
(
cmd
,
"c"
)
||
!
strcmp
(
cmd
,
"color"
)
||
!
strcmp
(
cmd
,
"replace"
))
{
int
old_x
=
s
->
x
;
int
old_y
=
s
->
y
;
int
old_w
=
s
->
w
;
int
old_h
=
s
->
h
;
int
old_t
=
s
->
thickness
;
int
old_r
=
s
->
replace
;
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
av_opt_set
(
s
,
cmd
,
args
,
0
);
init
(
ctx
);
if
((
ret
=
config_input
(
inlink
))
<
0
)
{
s
->
x
=
old_x
;
s
->
y
=
old_y
;
s
->
w
=
old_w
;
s
->
h
=
old_h
;
s
->
thickness
=
old_t
;
s
->
replace
=
old_r
;
return
ret
;
}
}
else
{
ret
=
AVERROR
(
ENOSYS
);
}
return
ret
;
}
#define OFFSET(x) offsetof(DrawBoxContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
...
...
@@ -323,6 +363,7 @@ AVFilter ff_vf_drawbox = {
.
query_formats
=
query_formats
,
.
inputs
=
drawbox_inputs
,
.
outputs
=
drawbox_outputs
,
.
process_command
=
process_command
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
,
};
#endif
/* CONFIG_DRAWBOX_FILTER */
...
...
@@ -457,6 +498,7 @@ AVFilter ff_vf_drawgrid = {
.
inputs
=
drawgrid_inputs
,
.
outputs
=
drawgrid_outputs
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
,
.
process_command
=
process_command
,
};
#endif
/* CONFIG_DRAWGRID_FILTER */
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