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
0dd8320e
Commit
0dd8320e
authored
Jul 17, 2017
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/vf_stack: move to "activate" design.
parent
4e0e9ce2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
21 deletions
+15
-21
Makefile
libavfilter/Makefile
+2
-2
vf_stack.c
libavfilter/vf_stack.c
+13
-19
No files found.
libavfilter/Makefile
View file @
0dd8320e
...
...
@@ -202,7 +202,7 @@ OBJS-$(CONFIG_HISTEQ_FILTER) += vf_histeq.o
OBJS-$(CONFIG_HISTOGRAM_FILTER)
+=
vf_histogram.o
OBJS-$(CONFIG_HQDN3D_FILTER)
+=
vf_hqdn3d.o
OBJS-$(CONFIG_HQX_FILTER)
+=
vf_hqx.o
OBJS-$(CONFIG_HSTACK_FILTER)
+=
vf_stack.o
framesync.o
OBJS-$(CONFIG_HSTACK_FILTER)
+=
vf_stack.o
framesync
2
.o
OBJS-$(CONFIG_HUE_FILTER)
+=
vf_hue.o
OBJS-$(CONFIG_HWDOWNLOAD_FILTER)
+=
vf_hwdownload.o
OBJS-$(CONFIG_HWMAP_FILTER)
+=
vf_hwmap.o
...
...
@@ -322,7 +322,7 @@ OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o
OBJS-$(CONFIG_VIDSTABDETECT_FILTER)
+=
vidstabutils.o
vf_vidstabdetect.o
OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER)
+=
vidstabutils.o
vf_vidstabtransform.o
OBJS-$(CONFIG_VIGNETTE_FILTER)
+=
vf_vignette.o
OBJS-$(CONFIG_VSTACK_FILTER)
+=
vf_stack.o
framesync.o
OBJS-$(CONFIG_VSTACK_FILTER)
+=
vf_stack.o
framesync
2
.o
OBJS-$(CONFIG_W3FDIF_FILTER)
+=
vf_w3fdif.o
OBJS-$(CONFIG_WAVEFORM_FILTER)
+=
vf_waveform.o
OBJS-$(CONFIG_WEAVE_FILTER)
+=
vf_weave.o
...
...
libavfilter/vf_stack.c
View file @
0dd8320e
...
...
@@ -26,7 +26,7 @@
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "framesync.h"
#include "framesync
2
.h"
#include "video.h"
typedef
struct
StackContext
{
...
...
@@ -58,12 +58,6 @@ static int query_formats(AVFilterContext *ctx)
return
ff_set_common_formats
(
ctx
,
pix_fmts
);
}
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
in
)
{
StackContext
*
s
=
inlink
->
dst
->
priv
;
return
ff_framesync_filter_frame
(
&
s
->
fs
,
inlink
,
in
);
}
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
StackContext
*
s
=
ctx
->
priv
;
...
...
@@ -83,7 +77,6 @@ static av_cold int init(AVFilterContext *ctx)
pad
.
name
=
av_asprintf
(
"input%d"
,
i
);
if
(
!
pad
.
name
)
return
AVERROR
(
ENOMEM
);
pad
.
filter_frame
=
filter_frame
;
if
((
ret
=
ff_insert_inpad
(
ctx
,
i
,
&
pad
))
<
0
)
{
av_freep
(
&
pad
.
name
);
...
...
@@ -104,7 +97,7 @@ static int process_frame(FFFrameSync *fs)
int
i
,
p
,
ret
,
offset
[
4
]
=
{
0
};
for
(
i
=
0
;
i
<
s
->
nb_inputs
;
i
++
)
{
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
return
ret
;
}
...
...
@@ -187,7 +180,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
time_base
=
time_base
;
outlink
->
frame_rate
=
frame_rate
;
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
))
<
0
)
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -203,13 +196,7 @@ static int config_output(AVFilterLink *outlink)
in
[
i
].
after
=
s
->
shortest
?
EXT_STOP
:
EXT_INFINITY
;
}
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
request_frame
(
AVFilterLink
*
outlink
)
{
StackContext
*
s
=
outlink
->
src
->
priv
;
return
ff_framesync_request_frame
(
&
s
->
fs
,
outlink
);
return
ff_framesync2_configure
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -217,13 +204,19 @@ static av_cold void uninit(AVFilterContext *ctx)
StackContext
*
s
=
ctx
->
priv
;
int
i
;
ff_framesync_uninit
(
&
s
->
fs
);
ff_framesync
2
_uninit
(
&
s
->
fs
);
av_freep
(
&
s
->
frames
);
for
(
i
=
0
;
i
<
ctx
->
nb_inputs
;
i
++
)
av_freep
(
&
ctx
->
input_pads
[
i
].
name
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
StackContext
*
s
=
ctx
->
priv
;
return
ff_framesync2_activate
(
&
s
->
fs
);
}
#define OFFSET(x) offsetof(StackContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
static
const
AVOption
stack_options
[]
=
{
...
...
@@ -237,7 +230,6 @@ static const AVFilterPad outputs[] = {
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
config_props
=
config_output
,
.
request_frame
=
request_frame
,
},
{
NULL
}
};
...
...
@@ -256,6 +248,7 @@ AVFilter ff_vf_hstack = {
.
outputs
=
outputs
,
.
init
=
init
,
.
uninit
=
uninit
,
.
activate
=
activate
,
.
flags
=
AVFILTER_FLAG_DYNAMIC_INPUTS
,
};
...
...
@@ -275,6 +268,7 @@ AVFilter ff_vf_vstack = {
.
outputs
=
outputs
,
.
init
=
init
,
.
uninit
=
uninit
,
.
activate
=
activate
,
.
flags
=
AVFILTER_FLAG_DYNAMIC_INPUTS
,
};
...
...
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