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
ffea3b00
Commit
ffea3b00
authored
Feb 25, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_settb: switch to an AVOptions-based system.
parent
33b97faa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
filters.texi
doc/filters.texi
+11
-3
vf_settb.c
libavfilter/vf_settb.c
+18
-13
No files found.
doc/filters.texi
View file @
ffea3b00
...
...
@@ -1998,7 +1998,15 @@ setsar=sar=10/11
Set the timebase to use for the output frames timestamps.
It is mainly useful for testing timebase configuration.
It accepts in input an arithmetic expression representing a rational.
This filter accepts the following options:
@table @option
@item expr
The expression which is evaluated into the output timebase.
@end table
The expression can contain the constants "PI", "E", "PHI", "AVTB" (the
default timebase), and "intb" (the input timebase).
...
...
@@ -2008,10 +2016,10 @@ Follow some examples.
@example
# set the timebase to 1/25
settb=1/25
settb=
expr=
1/25
# set the timebase to 1/10
settb=0.1
settb=
expr=
0.1
#set the timebase to 1001/1000
settb=1+0.001
...
...
libavfilter/vf_settb.c
View file @
ffea3b00
...
...
@@ -30,6 +30,7 @@
#include "libavutil/eval.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/rational.h"
#include "avfilter.h"
#include "internal.h"
...
...
@@ -54,21 +55,11 @@ enum var_name {
};
typedef
struct
{
char
tb_expr
[
256
];
const
AVClass
*
class
;
char
*
tb_expr
;
double
var_values
[
VAR_VARS_NB
];
}
SetTBContext
;
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
SetTBContext
*
settb
=
ctx
->
priv
;
av_strlcpy
(
settb
->
tb_expr
,
"intb"
,
sizeof
(
settb
->
tb_expr
));
if
(
args
)
sscanf
(
args
,
"%255[^:]"
,
settb
->
tb_expr
);
return
0
;
}
static
int
config_output_props
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
...
...
@@ -124,6 +115,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
return
ff_filter_frame
(
outlink
,
frame
);
}
#define OFFSET(x) offsetof(SetTBContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"expr"
,
"Expression determining the output timebase"
,
OFFSET
(
tb_expr
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"intb"
},
.
flags
=
FLAGS
},
{
NULL
},
};
static
const
AVClass
settb_class
=
{
.
class_name
=
"settb"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVFilterPad
avfilter_vf_settb_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -146,9 +151,9 @@ static const AVFilterPad avfilter_vf_settb_outputs[] = {
AVFilter
avfilter_vf_settb
=
{
.
name
=
"settb"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Set timebase for the output link."
),
.
init
=
init
,
.
priv_size
=
sizeof
(
SetTBContext
),
.
priv_class
=
&
settb_class
,
.
inputs
=
avfilter_vf_settb_inputs
,
...
...
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