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
8f1382f8
Commit
8f1382f8
authored
Feb 18, 2018
by
Josh de Kock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add new iteration API
Signed-off-by:
Josh de Kock
<
josh@itanimul.li
>
parent
cda43940
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
490 additions
and
456 deletions
+490
-456
configure
configure
+20
-9
APIchanges
doc/APIchanges
+4
-0
writing_filters.txt
doc/writing_filters.txt
+2
-4
allfilters.c
libavfilter/allfilters.c
+435
-390
avfilter.c
libavfilter/avfilter.c
+3
-47
avfilter.h
libavfilter/avfilter.h
+23
-6
version.h
libavfilter/version.h
+3
-0
No files found.
configure
View file @
8f1382f8
...
...
@@ -3622,15 +3622,6 @@ for v in "$@"; do
FFMPEG_CONFIGURATION
=
"
${
FFMPEG_CONFIGURATION
#
}
${
l
}${
r
}
"
done
find_things
(){
thing
=
$1
pattern
=
$2
file
=
$source_path
/
$3
sed
-n
"s/^[^#]*
$pattern
.*([^,]*, *
\(
[^,]*
\)\(
,.*
\)
*).*/
\1
_
$thing
/p"
"
$file
"
}
FILTER_LIST
=
$(
find_things filter FILTER libavfilter/allfilters.c
)
find_things_extern
(){
thing
=
$1
pattern
=
$2
...
...
@@ -3639,6 +3630,13 @@ find_things_extern(){
sed
-n
"s/^[^#]*extern.*
$pattern
*ff_
\(
[^ ]*
\)
_
$thing
;/
\1
_
$out
/p"
"
$file
"
}
find_filters_extern
(){
file
=
$source_path
/
$1
#sed -n "s/^extern AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(\w\+\);/\2_filter/p" $file
sed
-E
-n
"s/^extern AVFilter ff_([avfsinkrc]{2,5})_([a-zA-Z0-9_]+);/
\2
_filter/p"
$file
}
FILTER_LIST
=
$(
find_filters_extern libavfilter/allfilters.c
)
OUTDEV_LIST
=
$(
find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev
)
INDEV_LIST
=
$(
find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev
)
MUXER_LIST
=
$(
find_things_extern muxer AVOutputFormat libavformat/allformats.c
)
...
...
@@ -7157,6 +7155,10 @@ echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
cp_if_changed
$TMPH
libavutil/avconfig.h
full_filter_name
(){
sed
-n
"s/^extern AVFilter ff_
\(
[avfsinkrc]
\{
2,5
\}\)
_
$1
;/
\1
_
$1
/p"
$source_path
/libavfilter/allfilters.c
}
# generate the lists of enabled components
print_enabled_components
(){
file
=
$1
...
...
@@ -7167,6 +7169,9 @@ print_enabled_components(){
for
c
in
$*
;
do
if
enabled
$c
;
then
case
$name
in
filter_list
)
c
=
$(
full_filter_name
$(
remove_suffix _filter
$c
))
;;
indev_list
)
c
=
$(
add_suffix _demuxer
$(
remove_suffix _indev
$c
))
;;
...
...
@@ -7177,10 +7182,16 @@ print_enabled_components(){
printf
" &ff_%s,
\n
"
$c
>>
$TMPH
fi
done
if
[
"
$name
"
==
"filter_list"
]
;
then
for
c
in
asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer
;
do
printf
" &ff_%s,
\n
"
$c
>>
$TMPH
done
fi
echo
" NULL };"
>>
$TMPH
cp_if_changed
$TMPH
$file
}
print_enabled_components libavfilter/filter_list.c AVFilter filter_list
$FILTER_LIST
print_enabled_components libavcodec/codec_list.c AVCodec codec_list
$CODEC_LIST
print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list
$PARSER_LIST
print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters
$BSF_LIST
...
...
doc/APIchanges
View file @
8f1382f8
...
...
@@ -15,6 +15,10 @@ libavutil: 2017-10-21
API changes, most recent first:
2018-xx-xx - xxxxxxx - lavc 7.13.100 - avcodec.h
Deprecate use of avfilter_register(), avfilter_register_all(),
avfilter_next(). Add av_filter_iterate().
2018-03-xx - xxxxxxx - lavc 58.16.100 - avcodec.h
Add FF_SUB_CHARENC_MODE_IGNORE.
...
...
doc/writing_filters.txt
View file @
8f1382f8
...
...
@@ -31,10 +31,8 @@ If everything went right, you should get a foobar.png with Lena edge-detected.
That's it, your new playground is ready.
Some little details about what's going on:
libavfilter/allfilters.c:avfilter_register_all() is called at runtime to create
a list of the available filters, but it's important to know that this file is
also parsed by the configure script, which in turn will define variables for
the build system and the C:
libavfilter/allfilters.c:this file is parsed by the configure script, which in turn
will define variables for the build system and the C:
--- after running configure ---
...
...
libavfilter/allfilters.c
View file @
8f1382f8
This diff is collapsed.
Click to expand it.
libavfilter/avfilter.c
View file @
8f1382f8
...
...
@@ -575,51 +575,6 @@ int avfilter_process_command(AVFilterContext *filter, const char *cmd, const cha
return
AVERROR
(
ENOSYS
);
}
static
AVFilter
*
first_filter
;
static
AVFilter
**
last_filter
=
&
first_filter
;
const
AVFilter
*
avfilter_get_by_name
(
const
char
*
name
)
{
const
AVFilter
*
f
=
NULL
;
if
(
!
name
)
return
NULL
;
while
((
f
=
avfilter_next
(
f
)))
if
(
!
strcmp
(
f
->
name
,
name
))
return
(
AVFilter
*
)
f
;
return
NULL
;
}
static
AVMutex
filter_register_mutex
=
AV_MUTEX_INITIALIZER
;
int
avfilter_register
(
AVFilter
*
filter
)
{
AVFilter
**
f
;
/* the filter must select generic or internal exclusively */
av_assert0
((
filter
->
flags
&
AVFILTER_FLAG_SUPPORT_TIMELINE
)
!=
AVFILTER_FLAG_SUPPORT_TIMELINE
);
ff_mutex_lock
(
&
filter_register_mutex
);
f
=
last_filter
;
while
(
*
f
)
f
=
&
(
*
f
)
->
next
;
*
f
=
filter
;
filter
->
next
=
NULL
;
last_filter
=
&
filter
->
next
;
ff_mutex_unlock
(
&
filter_register_mutex
);
return
0
;
}
const
AVFilter
*
avfilter_next
(
const
AVFilter
*
prev
)
{
return
prev
?
prev
->
next
:
first_filter
;
}
int
avfilter_pad_count
(
const
AVFilterPad
*
pads
)
{
int
count
;
...
...
@@ -648,10 +603,11 @@ static void *filter_child_next(void *obj, void *prev)
static
const
AVClass
*
filter_child_class_next
(
const
AVClass
*
prev
)
{
void
*
opaque
=
NULL
;
const
AVFilter
*
f
=
NULL
;
/* find the filter that corresponds to prev */
while
(
prev
&&
(
f
=
av
filter_next
(
f
)))
while
(
prev
&&
(
f
=
av
_filter_iterate
(
&
opaque
)))
if
(
f
->
priv_class
==
prev
)
break
;
...
...
@@ -660,7 +616,7 @@ static const AVClass *filter_child_class_next(const AVClass *prev)
return
NULL
;
/* find next filter with specific options */
while
((
f
=
av
filter_next
(
f
)))
while
((
f
=
av
_filter_iterate
(
&
opaque
)))
if
(
f
->
priv_class
)
return
f
->
priv_class
;
...
...
libavfilter/avfilter.h
View file @
8f1382f8
...
...
@@ -697,7 +697,20 @@ int avfilter_config_links(AVFilterContext *filter);
*/
int
avfilter_process_command
(
AVFilterContext
*
filter
,
const
char
*
cmd
,
const
char
*
arg
,
char
*
res
,
int
res_len
,
int
flags
);
/**
* Iterate over all registered filters.
*
* @param opaque a pointer where libavfilter will store the iteration state. Must
* point to NULL to start the iteration.
*
* @return the next registered filter or NULL when the iteration is
* finished
*/
const
AVFilter
*
av_filter_iterate
(
void
**
opaque
);
#if FF_API_NEXT
/** Initialize the filter system. Register all builtin filters. */
attribute_deprecated
void
avfilter_register_all
(
void
);
/**
...
...
@@ -710,8 +723,18 @@ void avfilter_register_all(void);
* @return 0 if the registration was successful, a negative value
* otherwise
*/
attribute_deprecated
int
avfilter_register
(
AVFilter
*
filter
);
/**
* Iterate over all registered filters.
* @return If prev is non-NULL, next registered filter after prev or NULL if
* prev is the last filter. If prev is NULL, return the first registered filter.
*/
attribute_deprecated
const
AVFilter
*
avfilter_next
(
const
AVFilter
*
prev
);
#endif
/**
* Get a filter definition matching the given name.
*
...
...
@@ -721,12 +744,6 @@ int avfilter_register(AVFilter *filter);
*/
const
AVFilter
*
avfilter_get_by_name
(
const
char
*
name
);
/**
* Iterate over all registered filters.
* @return If prev is non-NULL, next registered filter after prev or NULL if
* prev is the last filter. If prev is NULL, return the first registered filter.
*/
const
AVFilter
*
avfilter_next
(
const
AVFilter
*
prev
);
/**
* Initialize a filter with the supplied parameters.
...
...
libavfilter/version.h
View file @
8f1382f8
...
...
@@ -58,5 +58,8 @@
#ifndef FF_API_FILTER_GET_SET
#define FF_API_FILTER_GET_SET (LIBAVFILTER_VERSION_MAJOR < 8)
#endif
#ifndef FF_API_NEXT
#define FF_API_NEXT (LIBAVFILTER_VERSION_MAJOR < 8)
#endif
#endif
/* AVFILTER_VERSION_H */
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