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
a42d6e6c
Commit
a42d6e6c
authored
Feb 25, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsrc_movie: switch to an AVOptions-based system.
parent
b7b3302f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
29 deletions
+15
-29
filters.texi
doc/filters.texi
+5
-7
vsrc_movie.c
libavfilter/vsrc_movie.c
+10
-22
No files found.
doc/filters.texi
View file @
a42d6e6c
...
...
@@ -2355,16 +2355,14 @@ useful in applications that do not support arbitrary filter graphs, but its use
is discouraged in those that do. Specifically in @command{avconv} this filter
should never be used, the @option{-filter_complex} option fully replaces it.
It accepts the syntax: @var{movie_name}[:@var{options}] where
@var{movie_name} is the name of the resource to read (not necessarily
a file but also a device or a stream accessed through some protocol),
and @var{options} is an optional sequence of @var{key}=@var{value}
pairs, separated by ":".
The description of the accepted options follows.
This filter accepts the following options:
@table @option
@item filename
The name of the resource to read (not necessarily a file but also a device or a
stream accessed through some protocol).
@item format_name, f
Specifies the format assumed for the movie to read, and can be either
the name of a container or an input device. If not specified the
...
...
libavfilter/vsrc_movie.c
View file @
a42d6e6c
...
...
@@ -57,15 +57,17 @@ typedef struct {
}
MovieContext
;
#define OFFSET(x) offsetof(MovieContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
movie_options
[]
=
{
{
"format_name"
,
"set format name"
,
OFFSET
(
format_name
),
AV_OPT_TYPE_STRING
,
{.
str
=
0
},
CHAR_MIN
,
CHAR_MAX
},
{
"f"
,
"set format name"
,
OFFSET
(
format_name
),
AV_OPT_TYPE_STRING
,
{.
str
=
0
},
CHAR_MIN
,
CHAR_MAX
},
{
"stream_index"
,
"set stream index"
,
OFFSET
(
stream_index
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
INT_MAX
},
{
"si"
,
"set stream index"
,
OFFSET
(
stream_index
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
INT_MAX
},
{
"seek_point"
,
"set seekpoint (seconds)"
,
OFFSET
(
seek_point_d
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
0
},
0
,
(
INT64_MAX
-
1
)
/
1000000
},
{
"sp"
,
"set seekpoint (seconds)"
,
OFFSET
(
seek_point_d
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
0
},
0
,
(
INT64_MAX
-
1
)
/
1000000
},
{
NULL
},
{
"filename"
,
NULL
,
OFFSET
(
file_name
),
AV_OPT_TYPE_STRING
,
.
flags
=
FLAGS
},
{
"format_name"
,
"set format name"
,
OFFSET
(
format_name
),
AV_OPT_TYPE_STRING
,
.
flags
=
FLAGS
},
{
"f"
,
"set format name"
,
OFFSET
(
format_name
),
AV_OPT_TYPE_STRING
,
.
flags
=
FLAGS
},
{
"stream_index"
,
"set stream index"
,
OFFSET
(
stream_index
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
INT_MAX
,
FLAGS
},
{
"si"
,
"set stream index"
,
OFFSET
(
stream_index
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
INT_MAX
,
FLAGS
},
{
"seek_point"
,
"set seekpoint (seconds)"
,
OFFSET
(
seek_point_d
),
AV_OPT_TYPE_DOUBLE
,
{
.
dbl
=
0
},
0
,
(
INT64_MAX
-
1
)
/
1000000
,
FLAGS
},
{
"sp"
,
"set seekpoint (seconds)"
,
OFFSET
(
seek_point_d
),
AV_OPT_TYPE_DOUBLE
,
{
.
dbl
=
0
},
0
,
(
INT64_MAX
-
1
)
/
1000000
,
FLAGS
},
{
NULL
},
};
static
const
char
*
movie_get_name
(
void
*
ctx
)
...
...
@@ -161,21 +163,6 @@ static int movie_init(AVFilterContext *ctx)
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
MovieContext
*
movie
=
ctx
->
priv
;
int
ret
;
movie
->
class
=
&
movie_class
;
av_opt_set_defaults
(
movie
);
if
(
args
)
movie
->
file_name
=
av_get_token
(
&
args
,
":"
);
if
(
!
movie
->
file_name
||
!*
movie
->
file_name
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"No filename provided!
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
(
*
args
++
==
':'
&&
(
ret
=
av_set_options_string
(
movie
,
args
,
"="
,
":"
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error parsing options string: '%s'
\n
"
,
args
);
return
ret
;
}
movie
->
seek_point
=
movie
->
seek_point_d
*
1000000
+
0
.
5
;
...
...
@@ -290,6 +277,7 @@ AVFilter avfilter_vsrc_movie = {
.
name
=
"movie"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Read from a movie source."
),
.
priv_size
=
sizeof
(
MovieContext
),
.
priv_class
=
&
movie_class
,
.
init
=
init
,
.
uninit
=
uninit
,
.
query_formats
=
query_formats
,
...
...
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