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
5c0d8bc4
Commit
5c0d8bc4
authored
Aug 09, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add avfilter_get_class() and iteration callbacks
Allow iteration over filter options.
parent
a25346e6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletion
+46
-1
APIchanges
doc/APIchanges
+4
-0
avfilter.c
libavfilter/avfilter.c
+35
-0
avfilter.h
libavfilter/avfilter.h
+6
-0
version.h
libavfilter/version.h
+1
-1
No files found.
doc/APIchanges
View file @
5c0d8bc4
...
...
@@ -15,6 +15,10 @@ libavutil: 2011-04-18
API changes, most recent first:
2012-08-13 - xxxxxxx - lavfi 3.8.100 - avfilter.h
Add avfilter_get_class() function, and priv_class field to AVFilter
struct.
2012-08-13 - xxxxxxx - lavu 51.69.100 - opt.h
Add AV_OPT_FLAG_FILTERING_PARAM symbol in opt.h.
...
...
libavfilter/avfilter.c
View file @
5c0d8bc4
...
...
@@ -432,13 +432,48 @@ static const char *default_filter_name(void *filter_ctx)
return
ctx
->
name
?
ctx
->
name
:
ctx
->
filter
->
name
;
}
static
void
*
filter_child_next
(
void
*
obj
,
void
*
prev
)
{
AVFilterContext
*
ctx
=
obj
;
if
(
!
prev
&&
ctx
->
filter
&&
ctx
->
filter
->
priv_class
)
return
ctx
->
priv
;
return
NULL
;
}
static
const
AVClass
*
filter_child_class_next
(
const
AVClass
*
prev
)
{
AVFilter
**
filter_ptr
=
NULL
;
/* find the filter that corresponds to prev */
while
(
prev
&&
*
(
filter_ptr
=
av_filter_next
(
filter_ptr
)))
if
((
*
filter_ptr
)
->
priv_class
==
prev
)
break
;
/* could not find filter corresponding to prev */
if
(
prev
&&
!
(
*
filter_ptr
))
return
NULL
;
/* find next filter with specific options */
while
(
*
(
filter_ptr
=
av_filter_next
(
filter_ptr
)))
if
((
*
filter_ptr
)
->
priv_class
)
return
(
*
filter_ptr
)
->
priv_class
;
return
NULL
;
}
static
const
AVClass
avfilter_class
=
{
.
class_name
=
"AVFilter"
,
.
item_name
=
default_filter_name
,
.
version
=
LIBAVUTIL_VERSION_INT
,
.
category
=
AV_CLASS_CATEGORY_FILTER
,
.
child_next
=
filter_child_next
,
.
child_class_next
=
filter_child_class_next
,
};
const
AVClass
*
avfilter_get_class
(
void
)
{
return
&
avfilter_class
;
}
int
avfilter_open
(
AVFilterContext
**
filter_ctx
,
AVFilter
*
filter
,
const
char
*
inst_name
)
{
AVFilterContext
*
ret
;
...
...
libavfilter/avfilter.h
View file @
5c0d8bc4
...
...
@@ -47,6 +47,10 @@ const char *avfilter_configuration(void);
*/
const
char
*
avfilter_license
(
void
);
/**
* Get the class for the AVFilterContext struct.
*/
const
AVClass
*
avfilter_get_class
(
void
);
typedef
struct
AVFilterContext
AVFilterContext
;
typedef
struct
AVFilterLink
AVFilterLink
;
...
...
@@ -469,6 +473,8 @@ typedef struct AVFilter {
* used for providing binary data.
*/
int
(
*
init_opaque
)(
AVFilterContext
*
ctx
,
const
char
*
args
,
void
*
opaque
);
const
AVClass
*
priv_class
;
///< private class, containing filter specific options
}
AVFilter
;
/** An instance of a filter */
...
...
libavfilter/version.h
View file @
5c0d8bc4
...
...
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR
7
#define LIBAVFILTER_VERSION_MINOR
8
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...
...
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