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
c3fa6add
Commit
c3fa6add
authored
Dec 06, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/field: switch to filter_frame API
parent
3942294f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
vf_field.c
libavfilter/vf_field.c
+7
-21
No files found.
libavfilter/vf_field.c
View file @
c3fa6add
...
...
@@ -82,33 +82,21 @@ static int config_props_output(AVFilterLink *outlink)
return
0
;
}
static
int
start
_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
inpicref
)
static
int
filter
_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
inpicref
)
{
FieldContext
*
field
=
inlink
->
dst
->
priv
;
AVFilterBufferRef
*
outpicref
=
avfilter_ref_buffer
(
inpicref
,
~
0
);
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
int
i
;
if
(
!
outpicref
)
return
AVERROR
(
ENOMEM
);
outpicref
->
video
->
h
=
outlink
->
h
;
outpicref
->
video
->
interlaced
=
0
;
inpicref
->
video
->
h
=
outlink
->
h
;
inpicref
->
video
->
interlaced
=
0
;
for
(
i
=
0
;
i
<
field
->
nb_planes
;
i
++
)
{
if
(
field
->
type
==
FIELD_TYPE_BOTTOM
)
out
picref
->
data
[
i
]
=
inpicref
->
data
[
i
]
+
inpicref
->
linesize
[
i
];
out
picref
->
linesize
[
i
]
=
2
*
inpicref
->
linesize
[
i
];
in
picref
->
data
[
i
]
=
inpicref
->
data
[
i
]
+
inpicref
->
linesize
[
i
];
in
picref
->
linesize
[
i
]
=
2
*
inpicref
->
linesize
[
i
];
}
return
ff_start_frame
(
outlink
,
outpicref
);
}
static
int
draw_slice
(
AVFilterLink
*
inlink
,
int
y
,
int
h
,
int
slice_dir
)
{
FieldContext
*
field
=
inlink
->
dst
->
priv
;
int
y1
=
(
y
+
(
field
->
type
==
FIELD_TYPE_TOP
))
/
2
;
int
h1
=
(
h
+
(
field
->
type
==
FIELD_TYPE_TOP
))
/
2
;
return
ff_draw_slice
(
inlink
->
dst
->
outputs
[
0
],
y1
,
h1
,
slice_dir
);
return
ff_filter_frame
(
outlink
,
inpicref
);
}
static
const
AVFilterPad
field_inputs
[]
=
{
...
...
@@ -116,9 +104,7 @@ static const AVFilterPad field_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
=
ff_null_end_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