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
1ba95a9c
Commit
1ba95a9c
authored
Mar 17, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add avfilter_init_dict() for initializing a filter with a dict.
parent
48a5adab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
12 deletions
+44
-12
APIchanges
doc/APIchanges
+1
-0
avfilter.c
libavfilter/avfilter.c
+21
-12
avfilter.h
libavfilter/avfilter.h
+22
-0
No files found.
doc/APIchanges
View file @
1ba95a9c
...
...
@@ -21,6 +21,7 @@ API changes, most recent first:
Add AVFilterContext.graph pointing to the AVFilterGraph that contains the
filter.
Add avfilter_init_str(), deprecate avfilter_init_filter().
Add avfilter_init_dict().
2013-xx-xx - lavfi 3.7.0 - avfilter.h
Add AVFilter.priv_class for exporting filter options through the AVOptions API
...
...
libavfilter/avfilter.c
View file @
1ba95a9c
...
...
@@ -515,6 +515,26 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
}
#endif
int
avfilter_init_dict
(
AVFilterContext
*
ctx
,
AVDictionary
**
options
)
{
int
ret
=
0
;
if
(
ctx
->
filter
->
priv_class
)
{
ret
=
av_opt_set_dict
(
ctx
->
priv
,
options
);
if
(
ret
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error applying options to the filter.
\n
"
);
return
ret
;
}
}
if
(
ctx
->
filter
->
init
)
ret
=
ctx
->
filter
->
init
(
ctx
);
else
if
(
ctx
->
filter
->
init_dict
)
ret
=
ctx
->
filter
->
init_dict
(
ctx
,
options
);
return
ret
;
}
int
avfilter_init_str
(
AVFilterContext
*
filter
,
const
char
*
args
)
{
AVDictionary
*
options
=
NULL
;
...
...
@@ -616,18 +636,7 @@ int avfilter_init_str(AVFilterContext *filter, const char *args)
}
}
if
(
filter
->
filter
->
priv_class
)
{
ret
=
av_opt_set_dict
(
filter
->
priv
,
&
options
);
if
(
ret
<
0
)
{
av_log
(
filter
,
AV_LOG_ERROR
,
"Error applying options to the filter.
\n
"
);
goto
fail
;
}
}
if
(
filter
->
filter
->
init
)
ret
=
filter
->
filter
->
init
(
filter
);
else
if
(
filter
->
filter
->
init_dict
)
ret
=
filter
->
filter
->
init_dict
(
filter
,
&
options
);
ret
=
avfilter_init_dict
(
filter
,
&
options
);
if
(
ret
<
0
)
goto
fail
;
...
...
libavfilter/avfilter.h
View file @
1ba95a9c
...
...
@@ -673,6 +673,28 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
*/
int
avfilter_init_str
(
AVFilterContext
*
ctx
,
const
char
*
args
);
/**
* Initialize a filter with the supplied dictionary of options.
*
* @param ctx uninitialized filter context to initialize
* @param options An AVDictionary filled with options for this filter. On
* return this parameter will be destroyed and replaced with
* a dict containing options that were not found. This dictionary
* must be freed by the caller.
* May be NULL, then this function is equivalent to
* avfilter_init_str() with the second parameter set to NULL.
* @return 0 on success, a negative AVERROR on failure
*
* @note This function and avfilter_init_str() do essentially the same thing,
* the difference is in manner in which the options are passed. It is up to the
* calling code to choose whichever is more preferable. The two functions also
* behave differently when some of the provided options are not declared as
* supported by the filter. In such a case, avfilter_init_str() will fail, but
* this function will leave those extra options in the options AVDictionary and
* continue as usual.
*/
int
avfilter_init_dict
(
AVFilterContext
*
ctx
,
AVDictionary
**
options
);
/**
* Free a filter context. This will also remove the filter from its
* filtergraph's list of filters.
...
...
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