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
8c5b37b4
Commit
8c5b37b4
authored
Mar 26, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/life: make use of AV_OPT_TYPE_VIDEO_RATE
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
975efc88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
vsrc_life.c
libavfilter/vsrc_life.c
+5
-16
No files found.
libavfilter/vsrc_life.c
View file @
8c5b37b4
...
...
@@ -60,8 +60,7 @@ typedef struct {
uint16_t
stay_rule
;
///< encode the behavior for filled cells
uint16_t
born_rule
;
///< encode the behavior for empty cells
uint64_t
pts
;
AVRational
time_base
;
char
*
rate
;
///< video frame rate
AVRational
frame_rate
;
double
random_fill_ratio
;
uint32_t
random_seed
;
int
stitch
;
...
...
@@ -85,8 +84,8 @@ static const AVOption life_options[] = {
{
"f"
,
"set source file"
,
OFFSET
(
filename
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"size"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"s"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"rate"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"rate"
,
"set video rate"
,
OFFSET
(
frame_rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
frame_rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"rule"
,
"set rule"
,
OFFSET
(
rule_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"B3/S23"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"random_fill_ratio"
,
"set fill ratio for filling initial grid randomly"
,
OFFSET
(
random_fill_ratio
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
1
/
M_PHI
},
0
,
1
,
FLAGS
},
{
"ratio"
,
"set fill ratio for filling initial grid randomly"
,
OFFSET
(
random_fill_ratio
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
1
/
M_PHI
},
0
,
1
,
FLAGS
},
...
...
@@ -224,7 +223,6 @@ static int init_pattern_from_file(AVFilterContext *ctx)
static
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
LifeContext
*
life
=
ctx
->
priv
;
AVRational
frame_rate
;
int
ret
;
life
->
class
=
&
life_class
;
...
...
@@ -233,12 +231,6 @@ static int init(AVFilterContext *ctx, const char *args)
if
((
ret
=
av_set_options_string
(
life
,
args
,
"="
,
":"
))
<
0
)
return
ret
;
if
((
ret
=
av_parse_video_rate
(
&
frame_rate
,
life
->
rate
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid frame rate: %s
\n
"
,
life
->
rate
);
return
AVERROR
(
EINVAL
);
}
av_freep
(
&
life
->
rate
);
if
(
!
life
->
w
&&
!
life
->
filename
)
av_opt_set
(
life
,
"size"
,
"320x240"
,
0
);
...
...
@@ -262,9 +254,6 @@ static int init(AVFilterContext *ctx, const char *args)
av_log
(
ctx
,
AV_LOG_WARNING
,
"Mold color is set while mold isn't, ignoring the color.
\n
"
);
life
->
time_base
.
num
=
frame_rate
.
den
;
life
->
time_base
.
den
=
frame_rate
.
num
;
if
(
!
life
->
filename
)
{
/* fill the grid randomly */
int
i
;
...
...
@@ -293,7 +282,7 @@ static int init(AVFilterContext *ctx, const char *args)
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"s:%dx%d r:%d/%d rule:%s stay_rule:%d born_rule:%d stitch:%d seed:%u
\n
"
,
life
->
w
,
life
->
h
,
frame_rate
.
num
,
frame_rate
.
den
,
life
->
w
,
life
->
h
,
life
->
frame_rate
.
num
,
life
->
frame_rate
.
den
,
life
->
rule_str
,
life
->
stay_rule
,
life
->
born_rule
,
life
->
stitch
,
life
->
random_seed
);
return
0
;
...
...
@@ -315,7 +304,7 @@ static int config_props(AVFilterLink *outlink)
outlink
->
w
=
life
->
w
;
outlink
->
h
=
life
->
h
;
outlink
->
time_base
=
life
->
time_base
;
outlink
->
time_base
=
av_inv_q
(
life
->
frame_rate
)
;
return
0
;
}
...
...
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