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
401f9c95
Commit
401f9c95
authored
Mar 26, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/cellauto: make use of AV_OPT_TYPE_VIDEO_RATE
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
8c5b37b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
vsrc_cellauto.c
libavfilter/vsrc_cellauto.c
+5
-15
No files found.
libavfilter/vsrc_cellauto.c
View file @
401f9c95
...
@@ -47,8 +47,7 @@ typedef struct {
...
@@ -47,8 +47,7 @@ typedef struct {
int
buf_prev_row_idx
,
buf_row_idx
;
int
buf_prev_row_idx
,
buf_row_idx
;
uint8_t
rule
;
uint8_t
rule
;
uint64_t
pts
;
uint64_t
pts
;
AVRational
time_base
;
AVRational
frame_rate
;
char
*
rate
;
///< video frame rate
double
random_fill_ratio
;
double
random_fill_ratio
;
uint32_t
random_seed
;
uint32_t
random_seed
;
int
stitch
,
scroll
,
start_full
;
int
stitch
,
scroll
,
start_full
;
...
@@ -65,8 +64,8 @@ static const AVOption cellauto_options[] = {
...
@@ -65,8 +64,8 @@ static const AVOption cellauto_options[] = {
{
"f"
,
"read initial pattern from file"
,
OFFSET
(
filename
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"f"
,
"read initial pattern from file"
,
OFFSET
(
filename
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"pattern"
,
"set initial pattern"
,
OFFSET
(
pattern
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"pattern"
,
"set initial pattern"
,
OFFSET
(
pattern
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"p"
,
"set initial pattern"
,
OFFSET
(
pattern
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"p"
,
"set initial pattern"
,
OFFSET
(
pattern
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"rate"
,
"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
(
rate
),
AV_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
frame_rate
),
AV_OPT_TYPE_VIDEO_RATE
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"size"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
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
},
{
"s"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"rule"
,
"set rule"
,
OFFSET
(
rule
),
AV_OPT_TYPE_INT
,
{.
i64
=
110
},
0
,
255
,
FLAGS
},
{
"rule"
,
"set rule"
,
OFFSET
(
rule
),
AV_OPT_TYPE_INT
,
{.
i64
=
110
},
0
,
255
,
FLAGS
},
...
@@ -163,7 +162,6 @@ static int init_pattern_from_file(AVFilterContext *ctx)
...
@@ -163,7 +162,6 @@ static int init_pattern_from_file(AVFilterContext *ctx)
static
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
static
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
{
CellAutoContext
*
cellauto
=
ctx
->
priv
;
CellAutoContext
*
cellauto
=
ctx
->
priv
;
AVRational
frame_rate
;
int
ret
;
int
ret
;
cellauto
->
class
=
&
cellauto_class
;
cellauto
->
class
=
&
cellauto_class
;
...
@@ -172,17 +170,9 @@ static int init(AVFilterContext *ctx, const char *args)
...
@@ -172,17 +170,9 @@ static int init(AVFilterContext *ctx, const char *args)
if
((
ret
=
av_set_options_string
(
cellauto
,
args
,
"="
,
":"
))
<
0
)
if
((
ret
=
av_set_options_string
(
cellauto
,
args
,
"="
,
":"
))
<
0
)
return
ret
;
return
ret
;
if
((
ret
=
av_parse_video_rate
(
&
frame_rate
,
cellauto
->
rate
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid frame rate: %s
\n
"
,
cellauto
->
rate
);
return
AVERROR
(
EINVAL
);
}
if
(
!
cellauto
->
w
&&
!
cellauto
->
filename
&&
!
cellauto
->
pattern
)
if
(
!
cellauto
->
w
&&
!
cellauto
->
filename
&&
!
cellauto
->
pattern
)
av_opt_set
(
cellauto
,
"size"
,
"320x518"
,
0
);
av_opt_set
(
cellauto
,
"size"
,
"320x518"
,
0
);
cellauto
->
time_base
.
num
=
frame_rate
.
den
;
cellauto
->
time_base
.
den
=
frame_rate
.
num
;
if
(
cellauto
->
filename
&&
cellauto
->
pattern
)
{
if
(
cellauto
->
filename
&&
cellauto
->
pattern
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Only one of the filename or pattern options can be used
\n
"
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Only one of the filename or pattern options can be used
\n
"
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
...
@@ -215,7 +205,7 @@ static int init(AVFilterContext *ctx, const char *args)
...
@@ -215,7 +205,7 @@ static int init(AVFilterContext *ctx, const char *args)
av_log
(
ctx
,
AV_LOG_VERBOSE
,
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"s:%dx%d r:%d/%d rule:%d stitch:%d scroll:%d full:%d seed:%u
\n
"
,
"s:%dx%d r:%d/%d rule:%d stitch:%d scroll:%d full:%d seed:%u
\n
"
,
cellauto
->
w
,
cellauto
->
h
,
frame_rate
.
num
,
frame_rate
.
den
,
cellauto
->
w
,
cellauto
->
h
,
cellauto
->
frame_rate
.
num
,
cellauto
->
frame_rate
.
den
,
cellauto
->
rule
,
cellauto
->
stitch
,
cellauto
->
scroll
,
cellauto
->
start_full
,
cellauto
->
rule
,
cellauto
->
stitch
,
cellauto
->
scroll
,
cellauto
->
start_full
,
cellauto
->
random_seed
);
cellauto
->
random_seed
);
return
0
;
return
0
;
...
@@ -236,7 +226,7 @@ static int config_props(AVFilterLink *outlink)
...
@@ -236,7 +226,7 @@ static int config_props(AVFilterLink *outlink)
outlink
->
w
=
cellauto
->
w
;
outlink
->
w
=
cellauto
->
w
;
outlink
->
h
=
cellauto
->
h
;
outlink
->
h
=
cellauto
->
h
;
outlink
->
time_base
=
cellauto
->
time_base
;
outlink
->
time_base
=
av_inv_q
(
cellauto
->
frame_rate
)
;
return
0
;
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