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
abaf4245
Commit
abaf4245
authored
Oct 06, 2014
by
Clément Bœsch
Committed by
Clément Bœsch
Oct 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter: add w/h parameters in timeline
Fixes Ticket #4008.
parent
158b3fb5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
filters.texi
doc/filters.texi
+4
-0
avfilter.c
libavfilter/avfilter.c
+19
-2
version.h
libavfilter/version.h
+1
-1
No files found.
doc/filters.texi
View file @
abaf4245
...
...
@@ -282,6 +282,10 @@ sequential number of the input frame, starting from 0
@item pos
the position in the file of the input frame, NAN if unknown
@item w
@item h
width and height of the input frame if video
@end table
Additionally, these filters support an @option{enable} command that can be used
...
...
libavfilter/avfilter.c
View file @
abaf4245
...
...
@@ -381,8 +381,23 @@ int ff_poll_frame(AVFilterLink *link)
return
min
;
}
static
const
char
*
const
var_names
[]
=
{
"t"
,
"n"
,
"pos"
,
NULL
};
enum
{
VAR_T
,
VAR_N
,
VAR_POS
,
VAR_VARS_NB
};
static
const
char
*
const
var_names
[]
=
{
"t"
,
"n"
,
"pos"
,
"w"
,
"h"
,
NULL
};
enum
{
VAR_T
,
VAR_N
,
VAR_POS
,
VAR_W
,
VAR_H
,
VAR_VARS_NB
};
static
int
set_enable_expr
(
AVFilterContext
*
ctx
,
const
char
*
expr
)
{
...
...
@@ -1071,6 +1086,8 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
int64_t
pos
=
av_frame_get_pkt_pos
(
out
);
dstctx
->
var_values
[
VAR_N
]
=
link
->
frame_count
;
dstctx
->
var_values
[
VAR_T
]
=
pts
==
AV_NOPTS_VALUE
?
NAN
:
pts
*
av_q2d
(
link
->
time_base
);
dstctx
->
var_values
[
VAR_W
]
=
link
->
w
;
dstctx
->
var_values
[
VAR_H
]
=
link
->
h
;
dstctx
->
var_values
[
VAR_POS
]
=
pos
==
-
1
?
NAN
:
pos
;
dstctx
->
is_disabled
=
fabs
(
av_expr_eval
(
dstctx
->
enable
,
dstctx
->
var_values
,
NULL
))
<
0
.
5
;
...
...
libavfilter/version.h
View file @
abaf4245
...
...
@@ -31,7 +31,7 @@
#define LIBAVFILTER_VERSION_MAJOR 5
#define LIBAVFILTER_VERSION_MINOR 1
#define LIBAVFILTER_VERSION_MICRO 10
2
#define LIBAVFILTER_VERSION_MICRO 10
3
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
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