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
bde1e8bf
Commit
bde1e8bf
authored
Dec 15, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/overlay: make use of av_opt_set_from_string()
Simplify.
parent
5e402a53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
37 deletions
+15
-37
filters.texi
doc/filters.texi
+11
-10
version.h
libavfilter/version.h
+1
-1
vf_overlay.c
libavfilter/vf_overlay.c
+3
-26
No files found.
doc/filters.texi
View file @
bde1e8bf
...
@@ -3176,12 +3176,19 @@ Overlay one video on top of another.
...
@@ -3176,12 +3176,19 @@ Overlay one video on top of another.
It takes two inputs and one output, the first input is the "main"
It takes two inputs and one output, the first input is the "main"
video on which the second input is overlayed.
video on which the second input is overlayed.
It accepts the parameters: @var{x}:@var{y}[:@var{options}].
This filter accepts a list of @var{key}=@var{value} pairs as argument,
separated by ":". If the key of the first options is omitted, the
arguments are interpreted according to the syntax @var{x}:@var{y}.
A description of the accepted options follows.
@var{x} is the x coordinate of the overlayed video on the main video,
@table @option
@var{y} is the y coordinate. @var{x} and @var{y} are expressions containing
@item x, y
the following parameters:
Set the expression for the x and y coordinates of the overlayed video
on the main video. Default value is 0.
The @var{x} and @var{y} expressions can contain the following
parameters:
@table @option
@table @option
@item main_w, main_h
@item main_w, main_h
main input width and height
main input width and height
...
@@ -3196,12 +3203,6 @@ overlay input width and height
...
@@ -3196,12 +3203,6 @@ overlay input width and height
same as @var{overlay_w} and @var{overlay_h}
same as @var{overlay_w} and @var{overlay_h}
@end table
@end table
@var{options} is an optional list of @var{key}=@var{value} pairs,
separated by ":".
The description of the accepted options follows.
@table @option
@item rgb
@item rgb
If set to 1, force the filter to accept inputs in the RGB
If set to 1, force the filter to accept inputs in the RGB
color space. Default value is 0.
color space. Default value is 0.
...
...
libavfilter/version.h
View file @
bde1e8bf
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 29
#define LIBAVFILTER_VERSION_MINOR 29
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_overlay.c
View file @
bde1e8bf
...
@@ -110,42 +110,19 @@ AVFILTER_DEFINE_CLASS(overlay);
...
@@ -110,42 +110,19 @@ AVFILTER_DEFINE_CLASS(overlay);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
{
OverlayContext
*
over
=
ctx
->
priv
;
OverlayContext
*
over
=
ctx
->
priv
;
char
*
args1
=
av_strdup
(
args
);
static
const
char
*
shorthand
[]
=
{
"x"
,
"y"
,
NULL
};
char
*
expr
,
*
bufptr
=
NULL
;
int
ret
=
0
;
over
->
class
=
&
overlay_class
;
over
->
class
=
&
overlay_class
;
av_opt_set_defaults
(
over
);
av_opt_set_defaults
(
over
);
if
(
expr
=
av_strtok
(
args1
,
":"
,
&
bufptr
))
{
return
av_opt_set_from_string
(
over
,
args
,
shorthand
,
"="
,
":"
);
av_free
(
over
->
x_expr
);
if
(
!
(
over
->
x_expr
=
av_strdup
(
expr
)))
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
}
if
(
expr
=
av_strtok
(
NULL
,
":"
,
&
bufptr
))
{
av_free
(
over
->
y_expr
);
if
(
!
(
over
->
y_expr
=
av_strdup
(
expr
)))
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
}
if
(
bufptr
&&
(
ret
=
av_set_options_string
(
over
,
bufptr
,
"="
,
":"
))
<
0
)
goto
end
;
end:
av_free
(
args1
);
return
ret
;
}
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
{
OverlayContext
*
over
=
ctx
->
priv
;
OverlayContext
*
over
=
ctx
->
priv
;
av_freep
(
&
over
->
x_expr
);
av_opt_free
(
over
);
av_freep
(
&
over
->
y_expr
);
avfilter_unref_bufferp
(
&
over
->
overpicref
);
avfilter_unref_bufferp
(
&
over
->
overpicref
);
ff_bufqueue_discard_all
(
&
over
->
queue_main
);
ff_bufqueue_discard_all
(
&
over
->
queue_main
);
...
...
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