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
0190c372
Commit
0190c372
authored
Oct 05, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/framesync: allocate FFFrameSyncIn internally
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
a16251a6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
10 deletions
+22
-10
dualinput.c
libavfilter/dualinput.c
+6
-2
dualinput.h
libavfilter/dualinput.h
+0
-1
framesync.c
libavfilter/framesync.c
+8
-1
framesync.h
libavfilter/framesync.h
+4
-3
vf_mergeplanes.c
libavfilter/vf_mergeplanes.c
+4
-3
No files found.
libavfilter/dualinput.c
View file @
0190c372
...
...
@@ -42,9 +42,13 @@ static int process_frame(FFFrameSync *fs)
int
ff_dualinput_init
(
AVFilterContext
*
ctx
,
FFDualInputContext
*
s
)
{
FFFrameSyncIn
*
in
=
s
->
fs
.
in
;
FFFrameSyncIn
*
in
;
int
ret
;
ff_framesync_init
(
&
s
->
fs
,
ctx
,
2
);
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
in
[
0
].
time_base
=
ctx
->
inputs
[
0
]
->
time_base
;
...
...
libavfilter/dualinput.h
View file @
0190c372
...
...
@@ -31,7 +31,6 @@
typedef
struct
{
FFFrameSync
fs
;
FFFrameSyncIn
second_input
;
/* must be immediately after fs */
AVFrame
*
(
*
process
)(
AVFilterContext
*
ctx
,
AVFrame
*
main
,
const
AVFrame
*
second
);
int
shortest
;
///< terminate stream when the second input terminates
...
...
libavfilter/framesync.c
View file @
0190c372
...
...
@@ -46,11 +46,16 @@ enum {
STATE_EOF
,
};
void
ff_framesync_init
(
FFFrameSync
*
fs
,
void
*
parent
,
unsigned
nb_in
)
int
ff_framesync_init
(
FFFrameSync
*
fs
,
void
*
parent
,
unsigned
nb_in
)
{
fs
->
class
=
&
framesync_class
;
fs
->
parent
=
parent
;
fs
->
nb_in
=
nb_in
;
fs
->
in
=
av_calloc
(
nb_in
,
sizeof
(
*
fs
->
in
));
if
(
!
fs
->
in
)
return
AVERROR
(
ENOMEM
);
return
0
;
}
static
void
framesync_sync_level_update
(
FFFrameSync
*
fs
)
...
...
@@ -267,6 +272,8 @@ void ff_framesync_uninit(FFFrameSync *fs)
av_frame_free
(
&
fs
->
in
[
i
].
frame_next
);
ff_bufqueue_discard_all
(
&
fs
->
in
[
i
].
queue
);
}
av_freep
(
&
fs
->
in
);
}
int
ff_framesync_process_frame
(
FFFrameSync
*
fs
,
unsigned
all
)
...
...
libavfilter/framesync.h
View file @
0190c372
...
...
@@ -201,9 +201,9 @@ typedef struct FFFrameSync {
uint8_t
eof
;
/**
*
Array of inputs; all inputs must be in consecutive memory
*
Pointer to array of inputs.
*/
FFFrameSyncIn
in
[
1
];
/* must be the last field */
FFFrameSyncIn
*
in
;
}
FFFrameSync
;
...
...
@@ -215,8 +215,9 @@ typedef struct FFFrameSync {
* @param fs frame sync structure to initialize
* @param parent parent object, used for logging
* @param nb_in number of inputs
* @return >= 0 for success or a negative error code
*/
void
ff_framesync_init
(
FFFrameSync
*
fs
,
void
*
parent
,
unsigned
nb_in
);
int
ff_framesync_init
(
FFFrameSync
*
fs
,
void
*
parent
,
unsigned
nb_in
);
/**
* Configure a frame sync structure.
...
...
libavfilter/vf_mergeplanes.c
View file @
0190c372
...
...
@@ -46,7 +46,6 @@ typedef struct MergePlanesContext {
const
AVPixFmtDescriptor
*
outdesc
;
FFFrameSync
fs
;
FFFrameSyncIn
fsin
[
3
];
/* must be immediately after fs */
}
MergePlanesContext
;
#define OFFSET(x) offsetof(MergePlanesContext, x)
...
...
@@ -174,9 +173,11 @@ static int config_output(AVFilterLink *outlink)
MergePlanesContext
*
s
=
ctx
->
priv
;
InputParam
inputsp
[
4
];
FFFrameSyncIn
*
in
;
int
i
;
int
i
,
ret
;
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
))
<
0
)
return
ret
;
ff_framesync_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
);
in
=
s
->
fs
.
in
;
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
...
...
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