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
69d4420a
Commit
69d4420a
authored
Nov 29, 2012
by
Anton Khirnov
Committed by
Michael Niedermayer
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavfilter/split: switch to filter_frame
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
94fdef81
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
59 deletions
+9
-59
split.c
libavfilter/split.c
+9
-59
No files found.
libavfilter/split.c
View file @
69d4420a
...
...
@@ -68,7 +68,7 @@ static void split_uninit(AVFilterContext *ctx)
av_freep
(
&
ctx
->
output_pads
[
i
].
name
);
}
static
int
start_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
picref
)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
frame
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
int
i
,
ret
=
AVERROR_EOF
;
...
...
@@ -78,44 +78,17 @@ static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
if
(
ctx
->
outputs
[
i
]
->
closed
)
continue
;
buf_out
=
avfilter_ref_buffer
(
picref
,
~
AV_PERM_WRITE
);
if
(
!
buf_out
)
return
AVERROR
(
ENOMEM
);
ret
=
ff_start_frame
(
ctx
->
outputs
[
i
],
buf_out
);
if
(
ret
<
0
)
buf_out
=
avfilter_ref_buffer
(
frame
,
~
AV_PERM_WRITE
);
if
(
!
buf_out
)
{
ret
=
AVERROR
(
ENOMEM
);
break
;
}
return
ret
;
}
static
int
draw_slice
(
AVFilterLink
*
inlink
,
int
y
,
int
h
,
int
slice_dir
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
int
i
,
ret
=
AVERROR_EOF
;
for
(
i
=
0
;
i
<
ctx
->
nb_outputs
;
i
++
)
{
if
(
ctx
->
outputs
[
i
]
->
closed
)
continue
;
ret
=
ff_draw_slice
(
ctx
->
outputs
[
i
],
y
,
h
,
slice_dir
);
if
(
ret
<
0
)
break
;
}
return
ret
;
}
static
int
end_frame
(
AVFilterLink
*
inlink
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
int
i
,
ret
=
AVERROR_EOF
;
for
(
i
=
0
;
i
<
ctx
->
nb_outputs
;
i
++
)
{
if
(
ctx
->
outputs
[
i
]
->
closed
)
continue
;
ret
=
ff_end_frame
(
ctx
->
outputs
[
i
]);
ret
=
ff_filter_frame
(
ctx
->
outputs
[
i
],
buf_out
);
if
(
ret
<
0
)
break
;
}
avfilter_unref_bufferp
(
&
frame
);
return
ret
;
}
...
...
@@ -124,9 +97,7 @@ static const AVFilterPad avfilter_vf_split_inputs[] = {
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
get_video_buffer
=
ff_null_get_video_buffer
,
.
start_frame
=
start_frame
,
.
draw_slice
=
draw_slice
,
.
end_frame
=
end_frame
,
.
filter_frame
=
filter_frame
,
},
{
NULL
}
};
...
...
@@ -142,33 +113,12 @@ AVFilter avfilter_vf_split = {
.
outputs
=
NULL
,
};
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
samplesref
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
int
i
,
ret
=
0
;
for
(
i
=
0
;
i
<
ctx
->
nb_outputs
;
i
++
)
{
AVFilterBufferRef
*
buf_out
=
avfilter_ref_buffer
(
samplesref
,
~
AV_PERM_WRITE
);
if
(
!
buf_out
)
{
ret
=
AVERROR
(
ENOMEM
);
break
;
}
ret
=
ff_filter_frame
(
inlink
->
dst
->
outputs
[
i
],
buf_out
);
if
(
ret
<
0
)
break
;
}
avfilter_unref_buffer
(
samplesref
);
return
ret
;
}
static
const
AVFilterPad
avfilter_af_asplit_inputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
get_audio_buffer
=
ff_null_get_audio_buffer
,
.
filter_frame
=
filter_frame
.
filter_frame
=
filter_frame
,
},
{
NULL
}
};
...
...
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