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
befbcc37
Commit
befbcc37
authored
Mar 16, 2013
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add common code to handle options parsing.
parent
cdd78a65
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
avfilter.c
libavfilter/avfilter.c
+14
-0
avfilter.h
libavfilter/avfilter.h
+9
-0
No files found.
libavfilter/avfilter.c
View file @
befbcc37
...
...
@@ -24,6 +24,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
...
...
@@ -556,6 +557,8 @@ void avfilter_free(AVFilterContext *filter)
if
(
filter
->
filter
->
uninit
)
filter
->
filter
->
uninit
(
filter
);
if
(
filter
->
filter
->
shorthand
)
av_opt_free
(
filter
->
priv
);
for
(
i
=
0
;
i
<
filter
->
nb_inputs
;
i
++
)
{
if
((
link
=
filter
->
inputs
[
i
]))
{
...
...
@@ -600,6 +603,17 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
{
int
ret
=
0
;
if
(
filter
->
filter
->
shorthand
)
{
av_assert0
(
filter
->
priv
);
av_assert0
(
filter
->
filter
->
priv_class
);
*
(
const
AVClass
**
)
filter
->
priv
=
filter
->
filter
->
priv_class
;
av_opt_set_defaults
(
filter
->
priv
);
ret
=
av_opt_set_from_string
(
filter
->
priv
,
args
,
filter
->
filter
->
shorthand
,
"="
,
":"
);
if
(
ret
<
0
)
return
ret
;
args
=
NULL
;
}
if
(
filter
->
filter
->
init_opaque
)
ret
=
filter
->
filter
->
init_opaque
(
filter
,
args
,
opaque
);
else
if
(
filter
->
filter
->
init
)
...
...
libavfilter/avfilter.h
View file @
befbcc37
...
...
@@ -486,6 +486,15 @@ typedef struct AVFilter {
int
(
*
init_opaque
)(
AVFilterContext
*
ctx
,
const
char
*
args
,
void
*
opaque
);
const
AVClass
*
priv_class
;
///< private class, containing filter specific options
/**
* Shorthand syntax for init arguments.
* If this field is set (even to an empty list), just before init the
* private class will be set and the arguments string will be parsed
* using av_opt_set_from_string() with "=" and ":" delimiters, and
* av_opt_free() will be called just after uninit.
*/
const
char
*
const
*
shorthand
;
}
AVFilter
;
/** An instance of a filter */
...
...
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