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
92b57e8d
Commit
92b57e8d
authored
Nov 28, 2012
by
Anton Khirnov
Committed by
Michael Niedermayer
Nov 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_fps: switch to filter_frame
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e67fdbff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
22 deletions
+4
-22
vf_fps.c
libavfilter/vf_fps.c
+4
-22
No files found.
libavfilter/vf_fps.c
View file @
92b57e8d
...
...
@@ -152,9 +152,7 @@ static int request_frame(AVFilterLink *outlink)
buf
->
pts
=
av_rescale_q
(
s
->
first_pts
,
ctx
->
inputs
[
0
]
->
time_base
,
outlink
->
time_base
)
+
s
->
frames_out
;
if
((
ret
=
ff_start_frame
(
outlink
,
buf
))
<
0
||
(
ret
=
ff_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
))
<
0
||
(
ret
=
ff_end_frame
(
outlink
))
<
0
)
if
((
ret
=
ff_filter_frame
(
outlink
,
buf
))
<
0
)
return
ret
;
s
->
frames_out
++
;
...
...
@@ -179,16 +177,14 @@ static int write_to_fifo(AVFifoBuffer *fifo, AVFilterBufferRef *buf)
return
0
;
}
static
int
end_frame
(
AVFilterLink
*
inlink
)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
buf
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
FPSContext
*
s
=
ctx
->
priv
;
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterBufferRef
*
buf
=
inlink
->
cur_buf
;
int64_t
delta
;
int
i
,
ret
;
inlink
->
cur_buf
=
NULL
;
s
->
frames_in
++
;
/* discard frames until we get the first timestamp */
if
(
s
->
pts
==
AV_NOPTS_VALUE
)
{
...
...
@@ -259,9 +255,7 @@ static int end_frame(AVFilterLink *inlink)
buf_out
->
pts
=
av_rescale_q
(
s
->
first_pts
,
inlink
->
time_base
,
outlink
->
time_base
)
+
s
->
frames_out
;
if
((
ret
=
ff_start_frame
(
outlink
,
buf_out
))
<
0
||
(
ret
=
ff_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
))
<
0
||
(
ret
=
ff_end_frame
(
outlink
))
<
0
)
{
if
((
ret
=
ff_filter_frame
(
outlink
,
buf_out
))
<
0
)
{
avfilter_unref_bufferp
(
&
buf
);
return
ret
;
}
...
...
@@ -276,24 +270,12 @@ static int end_frame(AVFilterLink *inlink)
return
ret
;
}
static
int
null_start_frame
(
AVFilterLink
*
link
,
AVFilterBufferRef
*
buf
)
{
return
0
;
}
static
int
null_draw_slice
(
AVFilterLink
*
link
,
int
y
,
int
h
,
int
slice_dir
)
{
return
0
;
}
static
const
AVFilterPad
avfilter_vf_fps_inputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
min_perms
=
AV_PERM_READ
|
AV_PERM_PRESERVE
,
.
start_frame
=
null_start_frame
,
.
draw_slice
=
null_draw_slice
,
.
end_frame
=
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