Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
db84088e
Commit
db84088e
authored
11 years ago
by
Stefano Sabatini
Browse files
Options
Downloads
Patches
Plain Diff
lavfi/mptestsrc: use AV_OPT_TYPE_DURATION
Simplify.
parent
bbf003e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavfilter/vsrc_mptestsrc.c
+7
-14
7 additions, 14 deletions
libavfilter/vsrc_mptestsrc.c
with
7 additions
and
14 deletions
libavfilter/vsrc_mptestsrc.c
+
7
−
14
View file @
db84088e
...
...
@@ -54,9 +54,9 @@ typedef struct MPTestContext {
const
AVClass
*
class
;
unsigned
int
frame_nb
;
AVRational
frame_rate
;
int64_t
pts
,
max_pts
;
int64_t
pts
,
max_pts
,
duration
;
int
hsub
,
vsub
;
char
*
size
,
*
duration
;
char
*
size
;
enum
test_type
test
;
}
MPTestContext
;
...
...
@@ -65,8 +65,8 @@ typedef struct MPTestContext {
static
const
AVOption
mptestsrc_options
[]
=
{
{
"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
},
{
"duration"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"d"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
z
{
"duration"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
DURATION
,
{.
i64
=
-
1
},
-
1
,
INT64_MAX
,
FLAGS
},
{
"d"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
DURATION
,
{.
i64
=
-
1
},
-
1
,
INT64_MAX
,
FLAGS
},
{
"test"
,
"set test to perform"
,
OFFSET
(
test
),
AV_OPT_TYPE_INT
,
{.
i64
=
TEST_ALL
},
0
,
INT_MAX
,
FLAGS
,
"test"
},
{
"t"
,
"set test to perform"
,
OFFSET
(
test
),
AV_OPT_TYPE_INT
,
{.
i64
=
TEST_ALL
},
0
,
INT_MAX
,
FLAGS
,
"test"
},
...
...
@@ -258,22 +258,15 @@ static void ring2_test(uint8_t *dst, int dst_linesize, int off)
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
MPTestContext
*
test
=
ctx
->
priv
;
int64_t
duration
=
-
1
;
int
ret
;
if
((
test
->
duration
)
&&
(
ret
=
av_parse_time
(
&
duration
,
test
->
duration
,
1
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid duration: '%s'
\n
"
,
test
->
duration
);
return
ret
;
}
test
->
max_pts
=
duration
>=
0
?
av_rescale_q
(
duration
,
AV_TIME_BASE_Q
,
av_inv_q
(
test
->
frame_rate
))
:
-
1
;
test
->
max_pts
=
test
->
duration
>=
0
?
av_rescale_q
(
test
->
duration
,
AV_TIME_BASE_Q
,
av_inv_q
(
test
->
frame_rate
))
:
-
1
;
test
->
frame_nb
=
0
;
test
->
pts
=
0
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"rate:%d/%d duration:%f
\n
"
,
test
->
frame_rate
.
num
,
test
->
frame_rate
.
den
,
duration
<
0
?
-
1
:
test
->
max_pts
*
av_q2d
(
av_inv_q
(
test
->
frame_rate
)));
test
->
duration
<
0
?
-
1
:
test
->
max_pts
*
av_q2d
(
av_inv_q
(
test
->
frame_rate
)));
init_idct
();
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment