ffmpeg-cvslog
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
March 2018
- 2 participants
- 371 discussions
ffmpeg | branch: master | Josh de Kock <josh(a)itanimul.li> | Fri Mar 23 20:38:32 2018 +0000| [22381906f3fd414d5c87593960903a1bf7797ee2] | committer: Josh de Kock
cmdutils: use new APIs
Signed-off-by: Josh de Kock <josh(a)itanimul.li>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22381906f3fd414d5…
---
fftools/cmdutils.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index c0ddf0b287..a6cf002fd0 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1259,8 +1259,10 @@ static int is_device(const AVClass *avclass)
static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only, int muxdemuxers)
{
- AVInputFormat *ifmt = NULL;
- AVOutputFormat *ofmt = NULL;
+ void *ifmt_opaque = NULL;
+ const AVInputFormat *ifmt = NULL;
+ void *ofmt_opaque = NULL;
+ const AVOutputFormat *ofmt = NULL;
const char *last_name;
int is_dev;
@@ -1276,7 +1278,8 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg,
const char *long_name = NULL;
if (muxdemuxers !=SHOW_DEMUXERS) {
- while ((ofmt = av_oformat_next(ofmt))) {
+ ifmt_opaque = NULL;
+ while ((ofmt = av_muxer_iterate(&ofmt_opaque))) {
is_dev = is_device(ofmt->priv_class);
if (!is_dev && device_only)
continue;
@@ -1289,7 +1292,8 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg,
}
}
if (muxdemuxers != SHOW_MUXERS) {
- while ((ifmt = av_iformat_next(ifmt))) {
+ ofmt_opaque = NULL;
+ while ((ifmt = av_demuxer_iterate(&ifmt_opaque))) {
is_dev = is_device(ifmt->priv_class);
if (!is_dev && device_only)
continue;
@@ -1629,6 +1633,7 @@ int show_filters(void *optctx, const char *opt, const char *arg)
#if CONFIG_AVFILTER
const AVFilter *filter = NULL;
char descr[64], *descr_cur;
+ void *opaque = NULL;
int i, j;
const AVFilterPad *pad;
@@ -1640,7 +1645,7 @@ int show_filters(void *optctx, const char *opt, const char *arg)
" V = Video input/output\n"
" N = Dynamic number and/or type of input/output\n"
" | = Source or sink filter\n");
- while ((filter = avfilter_next(filter))) {
+ while ((filter = av_filter_iterate(&opaque))) {
descr_cur = descr;
for (i = 0; i < 2; i++) {
if (i) {
1
0
ffmpeg | branch: master | Josh de Kock <josh(a)itanimul.li> | Fri Mar 23 20:38:25 2018 +0000| [65452bcd6416bf94193664a45816a055d2ff15b0] | committer: Josh de Kock
lavd: remove linked lists
Signed-off-by: Josh de Kock <josh(a)itanimul.li>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65452bcd6416bf941…
---
configure | 23 +++++++------
libavdevice/alldevices.c | 87 ++++++++++++++++++++++--------------------------
libavformat/allformats.c | 78 +++++++++++++++++++++++++++++++++++++------
libavformat/avformat.h | 2 ++
4 files changed, 120 insertions(+), 70 deletions(-)
diff --git a/configure b/configure
index b57e3d709a..3ae3ae3e36 100755
--- a/configure
+++ b/configure
@@ -3622,21 +3622,12 @@ 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"
-}
-
-OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
-INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
-
find_things_extern(){
thing=$1
pattern=$2
file=$source_path/$3
- sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$thing/p" "$file"
+ out=${4:-$thing}
+ sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
}
find_filters_extern(){
@@ -3646,6 +3637,8 @@ find_filters_extern(){
}
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)
DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
@@ -7179,6 +7172,12 @@ print_enabled_components(){
filter_list)
c=$(full_filter_name $(remove_suffix _filter $c))
;;
+ indev_list)
+ c=$(add_suffix _demuxer $(remove_suffix _indev $c))
+ ;;
+ outdev_list)
+ c=$(add_suffix _muxer $(remove_suffix _outdev $c))
+ ;;
esac
printf " &ff_%s,\n" $c >> $TMPH
fi
@@ -7198,6 +7197,8 @@ print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PAR
print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
+print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
+print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
# Settings for pkg-config files
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index b767b6a718..ebf95f8a81 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -22,57 +22,48 @@
#include "libavutil/thread.h"
#include "avdevice.h"
-#define REGISTER_OUTDEV(X, x) \
- { \
- extern AVOutputFormat ff_##x##_muxer; \
- if (CONFIG_##X##_OUTDEV) \
- av_register_output_format(&ff_##x##_muxer); \
- }
+/* devices */
+extern AVInputFormat ff_alsa_demuxer;
+extern AVOutputFormat ff_alsa_muxer;
+extern AVInputFormat ff_android_camera_demuxer;
+extern AVInputFormat ff_avfoundation_demuxer;
+extern AVInputFormat ff_bktr_demuxer;
+extern AVOutputFormat ff_caca_muxer;
+extern AVInputFormat ff_decklink_demuxer;
+extern AVOutputFormat ff_decklink_muxer;
+extern AVInputFormat ff_libndi_newtek_demuxer;
+extern AVOutputFormat ff_libndi_newtek_muxer;
+extern AVInputFormat ff_dshow_demuxer;
+extern AVInputFormat ff_fbdev_demuxer;
+extern AVOutputFormat ff_fbdev_muxer;
+extern AVInputFormat ff_gdigrab_demuxer;
+extern AVInputFormat ff_iec61883_demuxer;
+extern AVInputFormat ff_jack_demuxer;
+extern AVInputFormat ff_kmsgrab_demuxer;
+extern AVInputFormat ff_lavfi_demuxer;
+extern AVInputFormat ff_openal_demuxer;
+extern AVOutputFormat ff_opengl_muxer;
+extern AVInputFormat ff_oss_demuxer;
+extern AVOutputFormat ff_oss_muxer;
+extern AVInputFormat ff_pulse_demuxer;
+extern AVOutputFormat ff_pulse_muxer;
+extern AVOutputFormat ff_sdl2_muxer;
+extern AVInputFormat ff_sndio_demuxer;
+extern AVOutputFormat ff_sndio_muxer;
+extern AVInputFormat ff_v4l2_demuxer;
+extern AVOutputFormat ff_v4l2_muxer;
+extern AVInputFormat ff_vfwcap_demuxer;
+extern AVInputFormat ff_xcbgrab_demuxer;
+extern AVOutputFormat ff_xv_muxer;
-#define REGISTER_INDEV(X, x) \
- { \
- extern AVInputFormat ff_##x##_demuxer; \
- if (CONFIG_##X##_INDEV) \
- av_register_input_format(&ff_##x##_demuxer); \
- }
+/* external libraries */
+extern AVInputFormat ff_libcdio_demuxer;
+extern AVInputFormat ff_libdc1394_demuxer;
-#define REGISTER_INOUTDEV(X, x) REGISTER_OUTDEV(X, x); REGISTER_INDEV(X, x)
-
-static void register_all(void)
-{
- /* devices */
- REGISTER_INOUTDEV(ALSA, alsa);
- REGISTER_INDEV (AVFOUNDATION, avfoundation);
- REGISTER_INDEV (BKTR, bktr);
- REGISTER_OUTDEV (CACA, caca);
- REGISTER_INOUTDEV(DECKLINK, decklink);
- REGISTER_INOUTDEV(LIBNDI_NEWTEK, libndi_newtek);
- REGISTER_INDEV (DSHOW, dshow);
- REGISTER_INOUTDEV(FBDEV, fbdev);
- REGISTER_INDEV (GDIGRAB, gdigrab);
- REGISTER_INDEV (IEC61883, iec61883);
- REGISTER_INDEV (JACK, jack);
- REGISTER_INDEV (KMSGRAB, kmsgrab);
- REGISTER_INDEV (LAVFI, lavfi);
- REGISTER_INDEV (OPENAL, openal);
- REGISTER_OUTDEV (OPENGL, opengl);
- REGISTER_INOUTDEV(OSS, oss);
- REGISTER_INOUTDEV(PULSE, pulse);
- REGISTER_OUTDEV (SDL2, sdl2);
- REGISTER_INOUTDEV(SNDIO, sndio);
- REGISTER_INOUTDEV(V4L2, v4l2);
- REGISTER_INDEV (VFWCAP, vfwcap);
- REGISTER_INDEV (XCBGRAB, xcbgrab);
- REGISTER_OUTDEV (XV, xv);
-
- /* external libraries */
- REGISTER_INDEV (LIBCDIO, libcdio);
- REGISTER_INDEV (LIBDC1394, libdc1394);
-}
+#include "libavdevice/outdev_list.c"
+#include "libavdevice/indev_list.c"
void avdevice_register_all(void)
{
- static AVOnce control = AV_ONCE_INIT;
-
- ff_thread_once(&control, register_all);
+ avpriv_register_devices(outdev_list, indev_list);
}
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index e748faf4e6..2a20548c95 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -484,24 +484,45 @@ extern AVInputFormat ff_libopenmpt_demuxer;
#include "libavformat/muxer_list.c"
#include "libavformat/demuxer_list.c"
+static const AVInputFormat * const *indev_list = NULL;
+static const AVOutputFormat * const *outdev_list = NULL;
+
const AVOutputFormat *av_muxer_iterate(void **opaque)
{
+ static const uintptr_t size = sizeof(muxer_list)/sizeof(muxer_list[0]) - 1;
uintptr_t i = (uintptr_t)*opaque;
- const AVOutputFormat *f = muxer_list[i];
+ const AVOutputFormat *f = NULL;
+
+ if (i < size - 1) {
+ f = muxer_list[i];
+ } else if (indev_list) {
+ f = outdev_list[i - size];
+ }
+
if (f)
*opaque = (void*)(i + 1);
return f;
}
-const AVInputFormat *av_demuxer_iterate(void **opaque){
+const AVInputFormat *av_demuxer_iterate(void **opaque)
+{
+ static const uintptr_t size = sizeof(demuxer_list)/sizeof(demuxer_list[0]) - 1;
uintptr_t i = (uintptr_t)*opaque;
- const AVInputFormat *f = demuxer_list[i];
+ const AVInputFormat *f = NULL;
+
+ if (i < size) {
+ f = demuxer_list[i];
+ } else if (outdev_list) {
+ f = indev_list[i - size];
+ }
if (f)
*opaque = (void*)(i + 1);
return f;
}
+static AVMutex avpriv_register_devices_mutex = AV_MUTEX_INITIALIZER;
+
#if FF_API_NEXT
FF_DISABLE_DEPRECATION_WARNINGS
static AVOnce av_format_next_init = AV_ONCE_INIT;
@@ -510,38 +531,62 @@ static void av_format_init_next(void)
{
AVOutputFormat *prevout = NULL, *out;
AVInputFormat *previn = NULL, *in;
- void *i = 0;
- while ((out = (AVOutputFormat*)av_muxer_iterate(&i))) {
+ ff_mutex_lock(&avpriv_register_devices_mutex);
+
+ for (int i = 0; (out = (AVOutputFormat*)muxer_list[i]); i++) {
if (prevout)
prevout->next = out;
prevout = out;
}
- i = 0;
- while ((in = (AVInputFormat*)av_demuxer_iterate(&i))) {
+ if (outdev_list) {
+ for (int i = 0; (out = (AVOutputFormat*)outdev_list[i]); i++) {
+ if (prevout)
+ prevout->next = out;
+ prevout = out;
+ }
+ }
+
+ for (int i = 0; (in = (AVInputFormat*)demuxer_list[i]); i++) {
if (previn)
previn->next = in;
previn = in;
}
+
+ if (indev_list) {
+ for (int i = 0; (in = (AVInputFormat*)indev_list[i]); i++) {
+ if (previn)
+ previn->next = in;
+ previn = in;
+ }
+ }
+
+ ff_mutex_unlock(&avpriv_register_devices_mutex);
}
AVInputFormat *av_iformat_next(const AVInputFormat *f)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
+
if (f)
return f->next;
- else
- return demuxer_list[0];
+ else {
+ void *opaque = NULL;
+ return (AVInputFormat *)av_demuxer_iterate(&opaque);
+ }
}
AVOutputFormat *av_oformat_next(const AVOutputFormat *f)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
+
if (f)
return f->next;
- else
- return muxer_list[0];
+ else {
+ void *opaque = NULL;
+ return (AVOutputFormat *)av_muxer_iterate(&opaque);
+ }
}
void av_register_all(void)
@@ -560,3 +605,14 @@ void av_register_output_format(AVOutputFormat *format)
}
FF_ENABLE_DEPRECATION_WARNINGS
#endif
+
+void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[])
+{
+ ff_mutex_lock(&avpriv_register_devices_mutex);
+ outdev_list = o;
+ indev_list = i;
+ ff_mutex_unlock(&avpriv_register_devices_mutex);
+#if FF_API_NEXT
+ av_format_init_next();
+#endif
+}
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index a2fe7c6bb2..ec4e5f45f5 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -3060,6 +3060,8 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
*/
AVRational av_stream_get_codec_timebase(const AVStream *st);
+
+void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]);
/**
* @}
*/
1
0
31 Mar '18
ffmpeg | branch: master | Josh de Kock <josh(a)itanimul.li> | Fri Mar 23 10:16:15 2018 +0000| [d8ae40611bc01257776b71f20d774eb720151906] | committer: Josh de Kock
Revert "lavd: add new API for iterating input and output devices"
This reverts commit 0fd475704e871ef3a535947596a012894bae3cbd.
Revert "lavd: fix iterating of input and output devices"
This reverts commit ce1d77a5e7cebce11074bf6f9e38ad6da37338ff.
Signed-off-by: Josh de Kock <josh(a)itanimul.li>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8ae40611bc012577…
---
Makefile | 3 +-
configure | 23 +++---
doc/APIchanges | 5 --
libavdevice/.gitignore | 2 -
libavdevice/alldevices.c | 179 ++++++++++++-----------------------------------
libavdevice/avdevice.c | 46 ++++++++++++
libavdevice/avdevice.h | 28 --------
libavdevice/version.h | 4 --
libavformat/allformats.c | 42 +----------
libavformat/format.c | 8 ---
libavformat/internal.h | 7 --
11 files changed, 103 insertions(+), 244 deletions(-)
diff --git a/Makefile b/Makefile
index bb93b69f89..0cd0a1d6f2 100644
--- a/Makefile
+++ b/Makefile
@@ -144,8 +144,7 @@ distclean:: clean
version.h libavutil/ffversion.h libavcodec/codec_names.h \
libavcodec/bsf_list.c libavformat/protocol_list.c \
libavcodec/codec_list.c libavcodec/parser_list.c \
- libavformat/muxer_list.c libavformat/demuxer_list.c \
- libavdevice/indev_list.c libavdevice/outdev_list.c
+ libavformat/muxer_list.c libavformat/demuxer_list.c
ifeq ($(SRC_LINK),src)
$(RM) src
endif
diff --git a/configure b/configure
index 6ef3d8abef..b57e3d709a 100755
--- a/configure
+++ b/configure
@@ -3622,12 +3622,21 @@ 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"
+}
+
+OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
+INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
+
find_things_extern(){
thing=$1
pattern=$2
file=$source_path/$3
- out=${4:-$thing}
- sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
+ sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$thing/p" "$file"
}
find_filters_extern(){
@@ -3637,8 +3646,6 @@ find_filters_extern(){
}
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)
DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
@@ -7172,12 +7179,6 @@ print_enabled_components(){
filter_list)
c=$(full_filter_name $(remove_suffix _filter $c))
;;
- indev_list)
- c=$(add_suffix _demuxer $(remove_suffix _indev $c))
- ;;
- outdev_list)
- c=$(add_suffix _muxer $(remove_suffix _outdev $c))
- ;;
esac
printf " &ff_%s,\n" $c >> $TMPH
fi
@@ -7195,8 +7196,6 @@ print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_
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
-print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
-print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
diff --git a/doc/APIchanges b/doc/APIchanges
index dbc4617f8d..235868b22a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -56,11 +56,6 @@ API changes, most recent first:
2018-02-xx - xxxxxxx - lavc 58.11.100 - avcodec.h
Add AVCodecContext.extra_hw_frames.
-2018-02-06 - 0fd475704e - lavd 58.1.100 - avdevice.h
- Deprecate use of av_input_audio_device_next(), av_input_video_device_next(),
- av_output_audio_device_next(), av_output_video_device_next().
- Add av_indev_iterate(), and av_outdev_iterate().
-
2018-xx-xx - xxxxxxx - lavf 58.9.100 - avformat.h
Deprecate use of av_register_input_format(), av_register_output_format(),
av_register_all(), av_iformat_next(), av_oformat_next().
diff --git a/libavdevice/.gitignore b/libavdevice/.gitignore
deleted file mode 100644
index 08ac3eb86a..0000000000
--- a/libavdevice/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/indev_list.c
-/outdev_list.c
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 39993354bc..b767b6a718 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -22,150 +22,57 @@
#include "libavutil/thread.h"
#include "avdevice.h"
-#if FF_API_NEXT
-#include "libavformat/internal.h"
-#endif
-
-/* devices */
-extern AVInputFormat ff_alsa_demuxer;
-extern AVOutputFormat ff_alsa_muxer;
-extern AVInputFormat ff_android_camera_demuxer;
-extern AVInputFormat ff_avfoundation_demuxer;
-extern AVInputFormat ff_bktr_demuxer;
-extern AVOutputFormat ff_caca_muxer;
-extern AVInputFormat ff_decklink_demuxer;
-extern AVOutputFormat ff_decklink_muxer;
-extern AVInputFormat ff_libndi_newtek_demuxer;
-extern AVOutputFormat ff_libndi_newtek_muxer;
-extern AVInputFormat ff_dshow_demuxer;
-extern AVInputFormat ff_fbdev_demuxer;
-extern AVOutputFormat ff_fbdev_muxer;
-extern AVInputFormat ff_gdigrab_demuxer;
-extern AVInputFormat ff_iec61883_demuxer;
-extern AVInputFormat ff_jack_demuxer;
-extern AVInputFormat ff_kmsgrab_demuxer;
-extern AVInputFormat ff_lavfi_demuxer;
-extern AVInputFormat ff_openal_demuxer;
-extern AVOutputFormat ff_opengl_muxer;
-extern AVInputFormat ff_oss_demuxer;
-extern AVOutputFormat ff_oss_muxer;
-extern AVInputFormat ff_pulse_demuxer;
-extern AVOutputFormat ff_pulse_muxer;
-extern AVOutputFormat ff_sdl2_muxer;
-extern AVInputFormat ff_sndio_demuxer;
-extern AVOutputFormat ff_sndio_muxer;
-extern AVInputFormat ff_v4l2_demuxer;
-extern AVOutputFormat ff_v4l2_muxer;
-extern AVInputFormat ff_vfwcap_demuxer;
-extern AVInputFormat ff_xcbgrab_demuxer;
-extern AVOutputFormat ff_xv_muxer;
-
-/* external libraries */
-extern AVInputFormat ff_libcdio_demuxer;
-extern AVInputFormat ff_libdc1394_demuxer;
-
-#include "libavdevice/outdev_list.c"
-#include "libavdevice/indev_list.c"
-
-const AVOutputFormat *av_outdev_iterate(void **opaque)
-{
- uintptr_t i = (uintptr_t)*opaque;
- const AVOutputFormat *f = outdev_list[i];
-
- if (f)
- *opaque = (void*)(i + 1);
- return f;
-}
-
-const AVInputFormat *av_indev_iterate(void **opaque)
-{
- uintptr_t i = (uintptr_t)*opaque;
- const AVInputFormat *f = indev_list[i];
-
- if (f)
- *opaque = (void*)(i + 1);
- return f;
-}
-
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
-static AVOnce av_device_next_init = AV_ONCE_INIT;
-
-static void av_device_init_next(void)
-{
- AVOutputFormat *prevout = NULL, *out;
- AVInputFormat *previn = NULL, *in;
- void *i = 0;
-
- while ((out = (AVOutputFormat*)av_outdev_iterate(&i))) {
- if (prevout)
- prevout->next = out;
- prevout = out;
+#define REGISTER_OUTDEV(X, x) \
+ { \
+ extern AVOutputFormat ff_##x##_muxer; \
+ if (CONFIG_##X##_OUTDEV) \
+ av_register_output_format(&ff_##x##_muxer); \
}
- i = 0;
- while ((in = (AVInputFormat*)av_indev_iterate(&i))) {
- if (previn)
- previn->next = in;
- previn = in;
+#define REGISTER_INDEV(X, x) \
+ { \
+ extern AVInputFormat ff_##x##_demuxer; \
+ if (CONFIG_##X##_INDEV) \
+ av_register_input_format(&ff_##x##_demuxer); \
}
- avpriv_register_devices(outdev_list, indev_list);
-}
-
-void avdevice_register_all(void)
-{
- ff_thread_once(&av_device_next_init, av_device_init_next);
-}
-
-static void *device_next(void *prev, int output,
- AVClassCategory c1, AVClassCategory c2)
-{
- const AVClass *pc;
- AVClassCategory category = AV_CLASS_CATEGORY_NA;
-
- ff_thread_once(&av_device_next_init, av_device_init_next);
-
- do {
- if (output) {
- if (!(prev = prev ? ((AVOutputFormat *)prev)->next : (void*)outdev_list[0]))
- break;
- pc = ((AVOutputFormat *)prev)->priv_class;
- } else {
- if (!(prev = prev ? ((AVInputFormat *)prev)->next : (void*)indev_list[0]))
- break;
- pc = ((AVInputFormat *)prev)->priv_class;
- }
- if (!pc)
- continue;
- category = pc->category;
- } while (category != c1 && category != c2);
- return prev;
-}
-
-AVInputFormat *av_input_audio_device_next(AVInputFormat *d)
-{
- return device_next(d, 0, AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
- AV_CLASS_CATEGORY_DEVICE_INPUT);
-}
+#define REGISTER_INOUTDEV(X, x) REGISTER_OUTDEV(X, x); REGISTER_INDEV(X, x)
-AVInputFormat *av_input_video_device_next(AVInputFormat *d)
+static void register_all(void)
{
- return device_next(d, 0, AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
- AV_CLASS_CATEGORY_DEVICE_INPUT);
+ /* devices */
+ REGISTER_INOUTDEV(ALSA, alsa);
+ REGISTER_INDEV (AVFOUNDATION, avfoundation);
+ REGISTER_INDEV (BKTR, bktr);
+ REGISTER_OUTDEV (CACA, caca);
+ REGISTER_INOUTDEV(DECKLINK, decklink);
+ REGISTER_INOUTDEV(LIBNDI_NEWTEK, libndi_newtek);
+ REGISTER_INDEV (DSHOW, dshow);
+ REGISTER_INOUTDEV(FBDEV, fbdev);
+ REGISTER_INDEV (GDIGRAB, gdigrab);
+ REGISTER_INDEV (IEC61883, iec61883);
+ REGISTER_INDEV (JACK, jack);
+ REGISTER_INDEV (KMSGRAB, kmsgrab);
+ REGISTER_INDEV (LAVFI, lavfi);
+ REGISTER_INDEV (OPENAL, openal);
+ REGISTER_OUTDEV (OPENGL, opengl);
+ REGISTER_INOUTDEV(OSS, oss);
+ REGISTER_INOUTDEV(PULSE, pulse);
+ REGISTER_OUTDEV (SDL2, sdl2);
+ REGISTER_INOUTDEV(SNDIO, sndio);
+ REGISTER_INOUTDEV(V4L2, v4l2);
+ REGISTER_INDEV (VFWCAP, vfwcap);
+ REGISTER_INDEV (XCBGRAB, xcbgrab);
+ REGISTER_OUTDEV (XV, xv);
+
+ /* external libraries */
+ REGISTER_INDEV (LIBCDIO, libcdio);
+ REGISTER_INDEV (LIBDC1394, libdc1394);
}
-AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d)
+void avdevice_register_all(void)
{
- return device_next(d, 1, AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
- AV_CLASS_CATEGORY_DEVICE_OUTPUT);
-}
+ static AVOnce control = AV_ONCE_INIT;
-AVOutputFormat *av_output_video_device_next(AVOutputFormat *d)
-{
- return device_next(d, 1, AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
- AV_CLASS_CATEGORY_DEVICE_OUTPUT);
+ ff_thread_once(&control, register_all);
}
-FF_DISABLE_DEPRECATION_WARNINGS
-#endif
-
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index a42d3498b5..72e1b67887 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -78,6 +78,52 @@ const char * avdevice_license(void)
return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
}
+static void *device_next(void *prev, int output,
+ AVClassCategory c1, AVClassCategory c2)
+{
+ const AVClass *pc;
+ AVClassCategory category = AV_CLASS_CATEGORY_NA;
+ do {
+ if (output) {
+ if (!(prev = av_oformat_next(prev)))
+ break;
+ pc = ((AVOutputFormat *)prev)->priv_class;
+ } else {
+ if (!(prev = av_iformat_next(prev)))
+ break;
+ pc = ((AVInputFormat *)prev)->priv_class;
+ }
+ if (!pc)
+ continue;
+ category = pc->category;
+ } while (category != c1 && category != c2);
+ return prev;
+}
+
+AVInputFormat *av_input_audio_device_next(AVInputFormat *d)
+{
+ return device_next(d, 0, AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
+ AV_CLASS_CATEGORY_DEVICE_INPUT);
+}
+
+AVInputFormat *av_input_video_device_next(AVInputFormat *d)
+{
+ return device_next(d, 0, AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
+ AV_CLASS_CATEGORY_DEVICE_INPUT);
+}
+
+AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d)
+{
+ return device_next(d, 1, AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
+ AV_CLASS_CATEGORY_DEVICE_OUTPUT);
+}
+
+AVOutputFormat *av_output_video_device_next(AVOutputFormat *d)
+{
+ return device_next(d, 1, AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT,
+ AV_CLASS_CATEGORY_DEVICE_OUTPUT);
+}
+
int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type,
void *data, size_t data_size)
{
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index dd6ad9365e..ee9462480e 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -66,29 +66,6 @@ const char *avdevice_configuration(void);
const char *avdevice_license(void);
/**
- * Iterate over all registered output devices.
- *
- * @param opaque a pointer where libavdevice will store the iteration state. Must
- * point to NULL to start the iteration.
- *
- * @return the next registered output device or NULL when the iteration is
- * finished
- */
-const AVOutputFormat *av_outdev_iterate(void **opaque);
-
-/**
- * Iterate over all registered input devices.
- *
- * @param opaque a pointer where libavdevice will store the iteration state. Must
- * point to NULL to start the iteration.
- *
- * @return the next registered input device or NULL when the iteration is
- * finished
- */
-const AVInputFormat *av_indev_iterate(void **opaque);
-
-#if FF_API_NEXT
-/**
* Initialize libavdevice and register all the input and output devices.
*/
void avdevice_register_all(void);
@@ -100,7 +77,6 @@ void avdevice_register_all(void);
* if d is non-NULL, returns the next registered input audio/video device after d
* or NULL if d is the last one.
*/
-attribute_deprecated
AVInputFormat *av_input_audio_device_next(AVInputFormat *d);
/**
@@ -110,7 +86,6 @@ AVInputFormat *av_input_audio_device_next(AVInputFormat *d);
* if d is non-NULL, returns the next registered input audio/video device after d
* or NULL if d is the last one.
*/
-attribute_deprecated
AVInputFormat *av_input_video_device_next(AVInputFormat *d);
/**
@@ -120,7 +95,6 @@ AVInputFormat *av_input_video_device_next(AVInputFormat *d);
* if d is non-NULL, returns the next registered output audio/video device after d
* or NULL if d is the last one.
*/
-attribute_deprecated
AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d);
/**
@@ -130,9 +104,7 @@ AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d);
* if d is non-NULL, returns the next registered output audio/video device after d
* or NULL if d is the last one.
*/
-attribute_deprecated
AVOutputFormat *av_output_video_device_next(AVOutputFormat *d);
-#endif
typedef struct AVDeviceRect {
int x; /**< x coordinate of top left corner */
diff --git a/libavdevice/version.h b/libavdevice/version.h
index 80285a2611..d605427bcb 100644
--- a/libavdevice/version.h
+++ b/libavdevice/version.h
@@ -47,8 +47,4 @@
* the public API and may change, break or disappear at any time.
*/
-#ifndef FF_API_NEXT
-#define FF_API_NEXT (LIBAVDEVICE_VERSION_MAJOR < 59)
-#endif
-
#endif /* AVDEVICE_VERSION_H */
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 9dc5ce8a76..e748faf4e6 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -25,9 +25,6 @@
#include "rdt.h"
#include "url.h"
#include "version.h"
-#if FF_API_NEXT
-#include "internal.h"
-#endif
/* (de)muxers */
extern AVOutputFormat ff_a64_muxer;
@@ -491,7 +488,6 @@ const AVOutputFormat *av_muxer_iterate(void **opaque)
{
uintptr_t i = (uintptr_t)*opaque;
const AVOutputFormat *f = muxer_list[i];
-
if (f)
*opaque = (void*)(i + 1);
return f;
@@ -510,9 +506,6 @@ const AVInputFormat *av_demuxer_iterate(void **opaque){
FF_DISABLE_DEPRECATION_WARNINGS
static AVOnce av_format_next_init = AV_ONCE_INIT;
-static const AVInputFormat * const *indev_list = NULL;
-static const AVOutputFormat * const *outdev_list = NULL;
-
static void av_format_init_next(void)
{
AVOutputFormat *prevout = NULL, *out;
@@ -525,61 +518,30 @@ static void av_format_init_next(void)
prevout = out;
}
- if (outdev_list) {
- for (int j = 0; (out = (AVOutputFormat*)outdev_list[j]); j++) {
- if (prevout)
- prevout->next = out;
- prevout = out;
- }
- }
-
i = 0;
while ((in = (AVInputFormat*)av_demuxer_iterate(&i))) {
if (previn)
previn->next = in;
previn = in;
}
-
- if (indev_list) {
- for (int j = 0; (in = (AVInputFormat*)indev_list[j]); j++) {
- if (previn)
- previn->next = in;
- previn = in;
- }
- }
-
-}
-
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[])
-{
- static AVMutex avpriv_register_devices_mutex = AV_MUTEX_INITIALIZER;
- ff_mutex_lock(&avpriv_register_devices_mutex);
- outdev_list = o;
- indev_list = i;
- av_format_init_next();
- ff_mutex_unlock(&avpriv_register_devices_mutex);
}
AVInputFormat *av_iformat_next(const AVInputFormat *f)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
-
if (f)
return f->next;
else
- /* If there are no demuxers but input devices, then return the first input device.
- * This will still return null if both there are both no demuxers or input devices. */
- return demuxer_list[0] ? (AVInputFormat*)demuxer_list[0] : (indev_list ? (AVInputFormat*)indev_list[0] : NULL);
+ return demuxer_list[0];
}
AVOutputFormat *av_oformat_next(const AVOutputFormat *f)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
-
if (f)
return f->next;
else
- return muxer_list[0] ? (AVOutputFormat*)muxer_list[0] : (outdev_list ? (AVOutputFormat*)outdev_list[0] : NULL);
+ return muxer_list[0];
}
void av_register_all(void)
diff --git a/libavformat/format.c b/libavformat/format.c
index 75951938cf..123f5faf6c 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -129,18 +129,10 @@ enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
AVInputFormat *av_find_input_format(const char *short_name)
{
AVInputFormat *fmt = NULL;
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
- while ((fmt = av_iformat_next(fmt)))
- if (av_match_name(short_name, fmt->name))
- return fmt;
-FF_ENABLE_DEPRECATION_WARNINGS
-#else
void *i = 0;
while ((fmt = av_demuxer_iterate(&i)))
if (av_match_name(short_name, fmt->name))
return fmt;
-#endif
return NULL;
}
diff --git a/libavformat/internal.h b/libavformat/internal.h
index a020b1b417..619063097f 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -731,11 +731,4 @@ int ff_unlock_avformat(void);
*/
void ff_format_set_url(AVFormatContext *s, char *url);
-#if FF_API_NEXT
-/**
- * Register devices in deprecated format linked list.
- */
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]);
-#endif
-
#endif /* AVFORMAT_INTERNAL_H */
1
0
ffmpeg | branch: master | Josh de Kock <josh(a)itanimul.li> | Sun Feb 18 17:20:26 2018 +0000| [8f1382f80e0d4184c54c14afdda6482f050fbba7] | committer: Josh de Kock
lavfi: add new iteration API
Signed-off-by: Josh de Kock <josh(a)itanimul.li>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8f1382f80e0d4184c…
---
configure | 29 +-
doc/APIchanges | 4 +
doc/writing_filters.txt | 6 +-
libavfilter/allfilters.c | 825 +++++++++++++++++++++++++----------------------
libavfilter/avfilter.c | 50 +--
libavfilter/avfilter.h | 29 +-
libavfilter/version.h | 3 +
7 files changed, 490 insertions(+), 456 deletions(-)
diff --git a/configure b/configure
index 81fb3fbf75..6ef3d8abef 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/doc/APIchanges b/doc/APIchanges
index 83c7a40a55..dbc4617f8d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -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.
diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt
index 5cd4ecd6a4..98b9c6f3d2 100644
--- a/doc/writing_filters.txt
+++ b/doc/writing_filters.txt
@@ -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 ---
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 1cf13409ca..6eac828616 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -23,411 +23,456 @@
#include "avfilter.h"
#include "config.h"
+extern AVFilter ff_af_abench;
+extern AVFilter ff_af_acompressor;
+extern AVFilter ff_af_acontrast;
+extern AVFilter ff_af_acopy;
+extern AVFilter ff_af_acrossfade;
+extern AVFilter ff_af_acrusher;
+extern AVFilter ff_af_adelay;
+extern AVFilter ff_af_aecho;
+extern AVFilter ff_af_aemphasis;
+extern AVFilter ff_af_aeval;
+extern AVFilter ff_af_afade;
+extern AVFilter ff_af_afftfilt;
+extern AVFilter ff_af_afir;
+extern AVFilter ff_af_aformat;
+extern AVFilter ff_af_agate;
+extern AVFilter ff_af_aiir;
+extern AVFilter ff_af_ainterleave;
+extern AVFilter ff_af_alimiter;
+extern AVFilter ff_af_allpass;
+extern AVFilter ff_af_aloop;
+extern AVFilter ff_af_amerge;
+extern AVFilter ff_af_ametadata;
+extern AVFilter ff_af_amix;
+extern AVFilter ff_af_anequalizer;
+extern AVFilter ff_af_anull;
+extern AVFilter ff_af_apad;
+extern AVFilter ff_af_aperms;
+extern AVFilter ff_af_aphaser;
+extern AVFilter ff_af_apulsator;
+extern AVFilter ff_af_arealtime;
+extern AVFilter ff_af_aresample;
+extern AVFilter ff_af_areverse;
+extern AVFilter ff_af_aselect;
+extern AVFilter ff_af_asendcmd;
+extern AVFilter ff_af_asetnsamples;
+extern AVFilter ff_af_asetpts;
+extern AVFilter ff_af_asetrate;
+extern AVFilter ff_af_asettb;
+extern AVFilter ff_af_ashowinfo;
+extern AVFilter ff_af_asidedata;
+extern AVFilter ff_af_asplit;
+extern AVFilter ff_af_astats;
+extern AVFilter ff_af_astreamselect;
+extern AVFilter ff_af_atempo;
+extern AVFilter ff_af_atrim;
+extern AVFilter ff_af_azmq;
+extern AVFilter ff_af_bandpass;
+extern AVFilter ff_af_bandreject;
+extern AVFilter ff_af_bass;
+extern AVFilter ff_af_biquad;
+extern AVFilter ff_af_bs2b;
+extern AVFilter ff_af_channelmap;
+extern AVFilter ff_af_channelsplit;
+extern AVFilter ff_af_chorus;
+extern AVFilter ff_af_compand;
+extern AVFilter ff_af_compensationdelay;
+extern AVFilter ff_af_crossfeed;
+extern AVFilter ff_af_crystalizer;
+extern AVFilter ff_af_dcshift;
+extern AVFilter ff_af_drmeter;
+extern AVFilter ff_af_dynaudnorm;
+extern AVFilter ff_af_earwax;
+extern AVFilter ff_af_ebur128;
+extern AVFilter ff_af_equalizer;
+extern AVFilter ff_af_extrastereo;
+extern AVFilter ff_af_firequalizer;
+extern AVFilter ff_af_flanger;
+extern AVFilter ff_af_haas;
+extern AVFilter ff_af_hdcd;
+extern AVFilter ff_af_headphone;
+extern AVFilter ff_af_highpass;
+extern AVFilter ff_af_join;
+extern AVFilter ff_af_ladspa;
+extern AVFilter ff_af_loudnorm;
+extern AVFilter ff_af_lowpass;
+extern AVFilter ff_af_lv2;
+extern AVFilter ff_af_mcompand;
+extern AVFilter ff_af_pan;
+extern AVFilter ff_af_replaygain;
+extern AVFilter ff_af_resample;
+extern AVFilter ff_af_rubberband;
+extern AVFilter ff_af_sidechaincompress;
+extern AVFilter ff_af_sidechaingate;
+extern AVFilter ff_af_silencedetect;
+extern AVFilter ff_af_silenceremove;
+extern AVFilter ff_af_sofalizer;
+extern AVFilter ff_af_stereotools;
+extern AVFilter ff_af_stereowiden;
+extern AVFilter ff_af_superequalizer;
+extern AVFilter ff_af_surround;
+extern AVFilter ff_af_treble;
+extern AVFilter ff_af_tremolo;
+extern AVFilter ff_af_vibrato;
+extern AVFilter ff_af_volume;
+extern AVFilter ff_af_volumedetect;
-#define REGISTER_FILTER(X, x, y) \
- { \
- extern AVFilter ff_##y##_##x; \
- if (CONFIG_##X##_FILTER) \
- avfilter_register(&ff_##y##_##x); \
- }
+extern AVFilter ff_asrc_aevalsrc;
+extern AVFilter ff_asrc_anoisesrc;
+extern AVFilter ff_asrc_anullsrc;
+extern AVFilter ff_asrc_flite;
+extern AVFilter ff_asrc_hilbert;
+extern AVFilter ff_asrc_sine;
-#define REGISTER_FILTER_UNCONDITIONAL(x) \
- { \
- extern AVFilter ff_##x; \
- avfilter_register(&ff_##x); \
- }
+extern AVFilter ff_asink_anullsink;
+
+extern AVFilter ff_vf_alphaextract;
+extern AVFilter ff_vf_alphamerge;
+extern AVFilter ff_vf_ass;
+extern AVFilter ff_vf_atadenoise;
+extern AVFilter ff_vf_avgblur;
+extern AVFilter ff_vf_avgblur_opencl;
+extern AVFilter ff_vf_bbox;
+extern AVFilter ff_vf_bench;
+extern AVFilter ff_vf_bitplanenoise;
+extern AVFilter ff_vf_blackdetect;
+extern AVFilter ff_vf_blackframe;
+extern AVFilter ff_vf_blend;
+extern AVFilter ff_vf_boxblur;
+extern AVFilter ff_vf_bwdif;
+extern AVFilter ff_vf_chromakey;
+extern AVFilter ff_vf_ciescope;
+extern AVFilter ff_vf_codecview;
+extern AVFilter ff_vf_colorbalance;
+extern AVFilter ff_vf_colorchannelmixer;
+extern AVFilter ff_vf_colorkey;
+extern AVFilter ff_vf_colorlevels;
+extern AVFilter ff_vf_colormatrix;
+extern AVFilter ff_vf_colorspace;
+extern AVFilter ff_vf_convolution;
+extern AVFilter ff_vf_convolution_opencl;
+extern AVFilter ff_vf_convolve;
+extern AVFilter ff_vf_copy;
+extern AVFilter ff_vf_coreimage;
+extern AVFilter ff_vf_cover_rect;
+extern AVFilter ff_vf_crop;
+extern AVFilter ff_vf_cropdetect;
+extern AVFilter ff_vf_curves;
+extern AVFilter ff_vf_datascope;
+extern AVFilter ff_vf_dctdnoiz;
+extern AVFilter ff_vf_deband;
+extern AVFilter ff_vf_decimate;
+extern AVFilter ff_vf_deconvolve;
+extern AVFilter ff_vf_deflate;
+extern AVFilter ff_vf_deflicker;
+extern AVFilter ff_vf_deinterlace_qsv;
+extern AVFilter ff_vf_deinterlace_vaapi;
+extern AVFilter ff_vf_dejudder;
+extern AVFilter ff_vf_delogo;
+extern AVFilter ff_vf_denoise_vaapi;
+extern AVFilter ff_vf_deshake;
+extern AVFilter ff_vf_despill;
+extern AVFilter ff_vf_detelecine;
+extern AVFilter ff_vf_dilation;
+extern AVFilter ff_vf_displace;
+extern AVFilter ff_vf_doubleweave;
+extern AVFilter ff_vf_drawbox;
+extern AVFilter ff_vf_drawgraph;
+extern AVFilter ff_vf_drawgrid;
+extern AVFilter ff_vf_drawtext;
+extern AVFilter ff_vf_edgedetect;
+extern AVFilter ff_vf_elbg;
+extern AVFilter ff_vf_entropy;
+extern AVFilter ff_vf_eq;
+extern AVFilter ff_vf_erosion;
+extern AVFilter ff_vf_extractplanes;
+extern AVFilter ff_vf_fade;
+extern AVFilter ff_vf_fftfilt;
+extern AVFilter ff_vf_field;
+extern AVFilter ff_vf_fieldhint;
+extern AVFilter ff_vf_fieldmatch;
+extern AVFilter ff_vf_fieldorder;
+extern AVFilter ff_vf_fillborders;
+extern AVFilter ff_vf_find_rect;
+extern AVFilter ff_vf_floodfill;
+extern AVFilter ff_vf_format;
+extern AVFilter ff_vf_fps;
+extern AVFilter ff_vf_framepack;
+extern AVFilter ff_vf_framerate;
+extern AVFilter ff_vf_framestep;
+extern AVFilter ff_vf_frei0r;
+extern AVFilter ff_vf_fspp;
+extern AVFilter ff_vf_gblur;
+extern AVFilter ff_vf_geq;
+extern AVFilter ff_vf_gradfun;
+extern AVFilter ff_vf_haldclut;
+extern AVFilter ff_vf_hflip;
+extern AVFilter ff_vf_histeq;
+extern AVFilter ff_vf_histogram;
+extern AVFilter ff_vf_hqdn3d;
+extern AVFilter ff_vf_hqx;
+extern AVFilter ff_vf_hstack;
+extern AVFilter ff_vf_hue;
+extern AVFilter ff_vf_hwdownload;
+extern AVFilter ff_vf_hwmap;
+extern AVFilter ff_vf_hwupload;
+extern AVFilter ff_vf_hwupload_cuda;
+extern AVFilter ff_vf_hysteresis;
+extern AVFilter ff_vf_idet;
+extern AVFilter ff_vf_il;
+extern AVFilter ff_vf_inflate;
+extern AVFilter ff_vf_interlace;
+extern AVFilter ff_vf_interleave;
+extern AVFilter ff_vf_kerndeint;
+extern AVFilter ff_vf_lenscorrection;
+extern AVFilter ff_vf_libvmaf;
+extern AVFilter ff_vf_limiter;
+extern AVFilter ff_vf_loop;
+extern AVFilter ff_vf_lumakey;
+extern AVFilter ff_vf_lut;
+extern AVFilter ff_vf_lut2;
+extern AVFilter ff_vf_lut3d;
+extern AVFilter ff_vf_lutrgb;
+extern AVFilter ff_vf_lutyuv;
+extern AVFilter ff_vf_maskedclamp;
+extern AVFilter ff_vf_maskedmerge;
+extern AVFilter ff_vf_mcdeint;
+extern AVFilter ff_vf_mergeplanes;
+extern AVFilter ff_vf_mestimate;
+extern AVFilter ff_vf_metadata;
+extern AVFilter ff_vf_midequalizer;
+extern AVFilter ff_vf_minterpolate;
+extern AVFilter ff_vf_mix;
+extern AVFilter ff_vf_mpdecimate;
+extern AVFilter ff_vf_negate;
+extern AVFilter ff_vf_nlmeans;
+extern AVFilter ff_vf_nnedi;
+extern AVFilter ff_vf_noformat;
+extern AVFilter ff_vf_noise;
+extern AVFilter ff_vf_normalize;
+extern AVFilter ff_vf_null;
+extern AVFilter ff_vf_ocr;
+extern AVFilter ff_vf_ocv;
+extern AVFilter ff_vf_oscilloscope;
+extern AVFilter ff_vf_overlay;
+extern AVFilter ff_vf_overlay_opencl;
+extern AVFilter ff_vf_overlay_qsv;
+extern AVFilter ff_vf_owdenoise;
+extern AVFilter ff_vf_pad;
+extern AVFilter ff_vf_palettegen;
+extern AVFilter ff_vf_paletteuse;
+extern AVFilter ff_vf_perms;
+extern AVFilter ff_vf_perspective;
+extern AVFilter ff_vf_phase;
+extern AVFilter ff_vf_pixdesctest;
+extern AVFilter ff_vf_pixscope;
+extern AVFilter ff_vf_pp;
+extern AVFilter ff_vf_pp7;
+extern AVFilter ff_vf_premultiply;
+extern AVFilter ff_vf_prewitt;
+extern AVFilter ff_vf_procamp_vaapi;
+extern AVFilter ff_vf_program_opencl;
+extern AVFilter ff_vf_pseudocolor;
+extern AVFilter ff_vf_psnr;
+extern AVFilter ff_vf_pullup;
+extern AVFilter ff_vf_qp;
+extern AVFilter ff_vf_random;
+extern AVFilter ff_vf_readeia608;
+extern AVFilter ff_vf_readvitc;
+extern AVFilter ff_vf_realtime;
+extern AVFilter ff_vf_remap;
+extern AVFilter ff_vf_removegrain;
+extern AVFilter ff_vf_removelogo;
+extern AVFilter ff_vf_repeatfields;
+extern AVFilter ff_vf_reverse;
+extern AVFilter ff_vf_roberts;
+extern AVFilter ff_vf_rotate;
+extern AVFilter ff_vf_sab;
+extern AVFilter ff_vf_scale;
+extern AVFilter ff_vf_scale_cuda;
+extern AVFilter ff_vf_scale_npp;
+extern AVFilter ff_vf_scale_qsv;
+extern AVFilter ff_vf_scale_vaapi;
+extern AVFilter ff_vf_scale2ref;
+extern AVFilter ff_vf_select;
+extern AVFilter ff_vf_selectivecolor;
+extern AVFilter ff_vf_sendcmd;
+extern AVFilter ff_vf_separatefields;
+extern AVFilter ff_vf_setdar;
+extern AVFilter ff_vf_setfield;
+extern AVFilter ff_vf_setpts;
+extern AVFilter ff_vf_setrange;
+extern AVFilter ff_vf_setsar;
+extern AVFilter ff_vf_settb;
+extern AVFilter ff_vf_sharpness_vaapi;
+extern AVFilter ff_vf_showinfo;
+extern AVFilter ff_vf_showpalette;
+extern AVFilter ff_vf_shuffleframes;
+extern AVFilter ff_vf_shuffleplanes;
+extern AVFilter ff_vf_sidedata;
+extern AVFilter ff_vf_signalstats;
+extern AVFilter ff_vf_signature;
+extern AVFilter ff_vf_smartblur;
+extern AVFilter ff_vf_sobel;
+extern AVFilter ff_vf_split;
+extern AVFilter ff_vf_spp;
+extern AVFilter ff_vf_ssim;
+extern AVFilter ff_vf_stereo3d;
+extern AVFilter ff_vf_streamselect;
+extern AVFilter ff_vf_subtitles;
+extern AVFilter ff_vf_super2xsai;
+extern AVFilter ff_vf_swaprect;
+extern AVFilter ff_vf_swapuv;
+extern AVFilter ff_vf_tblend;
+extern AVFilter ff_vf_telecine;
+extern AVFilter ff_vf_threshold;
+extern AVFilter ff_vf_thumbnail;
+extern AVFilter ff_vf_thumbnail_cuda;
+extern AVFilter ff_vf_tile;
+extern AVFilter ff_vf_tinterlace;
+extern AVFilter ff_vf_tlut2;
+extern AVFilter ff_vf_tonemap;
+extern AVFilter ff_vf_transpose;
+extern AVFilter ff_vf_trim;
+extern AVFilter ff_vf_unpremultiply;
+extern AVFilter ff_vf_unsharp;
+extern AVFilter ff_vf_unsharp_opencl;
+extern AVFilter ff_vf_uspp;
+extern AVFilter ff_vf_vaguedenoiser;
+extern AVFilter ff_vf_vectorscope;
+extern AVFilter ff_vf_vflip;
+extern AVFilter ff_vf_vidstabdetect;
+extern AVFilter ff_vf_vidstabtransform;
+extern AVFilter ff_vf_vignette;
+extern AVFilter ff_vf_vmafmotion;
+extern AVFilter ff_vf_vpp_qsv;
+extern AVFilter ff_vf_vstack;
+extern AVFilter ff_vf_w3fdif;
+extern AVFilter ff_vf_waveform;
+extern AVFilter ff_vf_weave;
+extern AVFilter ff_vf_xbr;
+extern AVFilter ff_vf_yadif;
+extern AVFilter ff_vf_zmq;
+extern AVFilter ff_vf_zoompan;
+extern AVFilter ff_vf_zscale;
+
+extern AVFilter ff_vsrc_allrgb;
+extern AVFilter ff_vsrc_allyuv;
+extern AVFilter ff_vsrc_cellauto;
+extern AVFilter ff_vsrc_color;
+extern AVFilter ff_vsrc_coreimagesrc;
+extern AVFilter ff_vsrc_frei0r_src;
+extern AVFilter ff_vsrc_haldclutsrc;
+extern AVFilter ff_vsrc_life;
+extern AVFilter ff_vsrc_mandelbrot;
+extern AVFilter ff_vsrc_mptestsrc;
+extern AVFilter ff_vsrc_nullsrc;
+extern AVFilter ff_vsrc_openclsrc;
+extern AVFilter ff_vsrc_rgbtestsrc;
+extern AVFilter ff_vsrc_smptebars;
+extern AVFilter ff_vsrc_smptehdbars;
+extern AVFilter ff_vsrc_testsrc;
+extern AVFilter ff_vsrc_testsrc2;
+extern AVFilter ff_vsrc_yuvtestsrc;
+
+extern AVFilter ff_vsink_nullsink;
+
+/* multimedia filters */
+extern AVFilter ff_avf_abitscope;
+extern AVFilter ff_avf_adrawgraph;
+extern AVFilter ff_avf_ahistogram;
+extern AVFilter ff_avf_aphasemeter;
+extern AVFilter ff_avf_avectorscope;
+extern AVFilter ff_avf_concat;
+extern AVFilter ff_avf_showcqt;
+extern AVFilter ff_avf_showfreqs;
+extern AVFilter ff_avf_showspectrum;
+extern AVFilter ff_avf_showspectrumpic;
+extern AVFilter ff_avf_showvolume;
+extern AVFilter ff_avf_showwaves;
+extern AVFilter ff_avf_showwavespic;
+extern AVFilter ff_vaf_spectrumsynth;
-static void register_all(void)
+/* multimedia sources */
+extern AVFilter ff_avsrc_amovie;
+extern AVFilter ff_avsrc_movie;
+
+/* those filters are part of public or internal API,
+ * they are formatted to not be found by the grep
+ * as they are manually added again (due to their 'names'
+ * being the same while having different 'types'). */
+extern AVFilter ff_asrc_abuffer;
+extern AVFilter ff_vsrc_buffer;
+extern AVFilter ff_asink_abuffer;
+extern AVFilter ff_vsink_buffer;
+extern AVFilter ff_af_afifo;
+extern AVFilter ff_vf_fifo;
+
+#include "libavfilter/filter_list.c"
+
+
+const AVFilter *av_filter_iterate(void **opaque)
{
- REGISTER_FILTER(ABENCH, abench, af);
- REGISTER_FILTER(ACOMPRESSOR, acompressor, af);
- REGISTER_FILTER(ACONTRAST, acontrast, af);
- REGISTER_FILTER(ACOPY, acopy, af);
- REGISTER_FILTER(ACROSSFADE, acrossfade, af);
- REGISTER_FILTER(ACRUSHER, acrusher, af);
- REGISTER_FILTER(ADELAY, adelay, af);
- REGISTER_FILTER(AECHO, aecho, af);
- REGISTER_FILTER(AEMPHASIS, aemphasis, af);
- REGISTER_FILTER(AEVAL, aeval, af);
- REGISTER_FILTER(AFADE, afade, af);
- REGISTER_FILTER(AFFTFILT, afftfilt, af);
- REGISTER_FILTER(AFIR, afir, af);
- REGISTER_FILTER(AFORMAT, aformat, af);
- REGISTER_FILTER(AGATE, agate, af);
- REGISTER_FILTER(AIIR, aiir, af);
- REGISTER_FILTER(AINTERLEAVE, ainterleave, af);
- REGISTER_FILTER(ALIMITER, alimiter, af);
- REGISTER_FILTER(ALLPASS, allpass, af);
- REGISTER_FILTER(ALOOP, aloop, af);
- REGISTER_FILTER(AMERGE, amerge, af);
- REGISTER_FILTER(AMETADATA, ametadata, af);
- REGISTER_FILTER(AMIX, amix, af);
- REGISTER_FILTER(ANEQUALIZER, anequalizer, af);
- REGISTER_FILTER(ANULL, anull, af);
- REGISTER_FILTER(APAD, apad, af);
- REGISTER_FILTER(APERMS, aperms, af);
- REGISTER_FILTER(APHASER, aphaser, af);
- REGISTER_FILTER(APULSATOR, apulsator, af);
- REGISTER_FILTER(AREALTIME, arealtime, af);
- REGISTER_FILTER(ARESAMPLE, aresample, af);
- REGISTER_FILTER(AREVERSE, areverse, af);
- REGISTER_FILTER(ASELECT, aselect, af);
- REGISTER_FILTER(ASENDCMD, asendcmd, af);
- REGISTER_FILTER(ASETNSAMPLES, asetnsamples, af);
- REGISTER_FILTER(ASETPTS, asetpts, af);
- REGISTER_FILTER(ASETRATE, asetrate, af);
- REGISTER_FILTER(ASETTB, asettb, af);
- REGISTER_FILTER(ASHOWINFO, ashowinfo, af);
- REGISTER_FILTER(ASIDEDATA, asidedata, af);
- REGISTER_FILTER(ASPLIT, asplit, af);
- REGISTER_FILTER(ASTATS, astats, af);
- REGISTER_FILTER(ASTREAMSELECT, astreamselect, af);
- REGISTER_FILTER(ATEMPO, atempo, af);
- REGISTER_FILTER(ATRIM, atrim, af);
- REGISTER_FILTER(AZMQ, azmq, af);
- REGISTER_FILTER(BANDPASS, bandpass, af);
- REGISTER_FILTER(BANDREJECT, bandreject, af);
- REGISTER_FILTER(BASS, bass, af);
- REGISTER_FILTER(BIQUAD, biquad, af);
- REGISTER_FILTER(BS2B, bs2b, af);
- REGISTER_FILTER(CHANNELMAP, channelmap, af);
- REGISTER_FILTER(CHANNELSPLIT, channelsplit, af);
- REGISTER_FILTER(CHORUS, chorus, af);
- REGISTER_FILTER(COMPAND, compand, af);
- REGISTER_FILTER(COMPENSATIONDELAY, compensationdelay, af);
- REGISTER_FILTER(CROSSFEED, crossfeed, af);
- REGISTER_FILTER(CRYSTALIZER, crystalizer, af);
- REGISTER_FILTER(DCSHIFT, dcshift, af);
- REGISTER_FILTER(DRMETER, drmeter, af);
- REGISTER_FILTER(DYNAUDNORM, dynaudnorm, af);
- REGISTER_FILTER(EARWAX, earwax, af);
- REGISTER_FILTER(EBUR128, ebur128, af);
- REGISTER_FILTER(EQUALIZER, equalizer, af);
- REGISTER_FILTER(EXTRASTEREO, extrastereo, af);
- REGISTER_FILTER(FIREQUALIZER, firequalizer, af);
- REGISTER_FILTER(FLANGER, flanger, af);
- REGISTER_FILTER(HAAS, haas, af);
- REGISTER_FILTER(HDCD, hdcd, af);
- REGISTER_FILTER(HEADPHONE, headphone, af);
- REGISTER_FILTER(HIGHPASS, highpass, af);
- REGISTER_FILTER(JOIN, join, af);
- REGISTER_FILTER(LADSPA, ladspa, af);
- REGISTER_FILTER(LOUDNORM, loudnorm, af);
- REGISTER_FILTER(LOWPASS, lowpass, af);
- REGISTER_FILTER(LV2, lv2, af);
- REGISTER_FILTER(MCOMPAND, mcompand, af);
- REGISTER_FILTER(PAN, pan, af);
- REGISTER_FILTER(REPLAYGAIN, replaygain, af);
- REGISTER_FILTER(RESAMPLE, resample, af);
- REGISTER_FILTER(RUBBERBAND, rubberband, af);
- REGISTER_FILTER(SIDECHAINCOMPRESS, sidechaincompress, af);
- REGISTER_FILTER(SIDECHAINGATE, sidechaingate, af);
- REGISTER_FILTER(SILENCEDETECT, silencedetect, af);
- REGISTER_FILTER(SILENCEREMOVE, silenceremove, af);
- REGISTER_FILTER(SOFALIZER, sofalizer, af);
- REGISTER_FILTER(STEREOTOOLS, stereotools, af);
- REGISTER_FILTER(STEREOWIDEN, stereowiden, af);
- REGISTER_FILTER(SUPEREQUALIZER, superequalizer, af);
- REGISTER_FILTER(SURROUND, surround, af);
- REGISTER_FILTER(TREBLE, treble, af);
- REGISTER_FILTER(TREMOLO, tremolo, af);
- REGISTER_FILTER(VIBRATO, vibrato, af);
- REGISTER_FILTER(VOLUME, volume, af);
- REGISTER_FILTER(VOLUMEDETECT, volumedetect, af);
+ uintptr_t i = (uintptr_t)*opaque;
+ const AVFilter *f = filter_list[i];
+
+ if (f)
+ *opaque = (void*)(i + 1);
- REGISTER_FILTER(AEVALSRC, aevalsrc, asrc);
- REGISTER_FILTER(ANOISESRC, anoisesrc, asrc);
- REGISTER_FILTER(ANULLSRC, anullsrc, asrc);
- REGISTER_FILTER(FLITE, flite, asrc);
- REGISTER_FILTER(HILBERT, hilbert, asrc);
- REGISTER_FILTER(SINE, sine, asrc);
+ return f;
+}
- REGISTER_FILTER(ANULLSINK, anullsink, asink);
+const AVFilter *avfilter_get_by_name(const char *name)
+{
+ const AVFilter *f = NULL;
+ void *opaque = 0;
- REGISTER_FILTER(ALPHAEXTRACT, alphaextract, vf);
- REGISTER_FILTER(ALPHAMERGE, alphamerge, vf);
- REGISTER_FILTER(ASS, ass, vf);
- REGISTER_FILTER(ATADENOISE, atadenoise, vf);
- REGISTER_FILTER(AVGBLUR, avgblur, vf);
- REGISTER_FILTER(AVGBLUR_OPENCL, avgblur_opencl, vf);
- REGISTER_FILTER(BBOX, bbox, vf);
- REGISTER_FILTER(BENCH, bench, vf);
- REGISTER_FILTER(BITPLANENOISE, bitplanenoise, vf);
- REGISTER_FILTER(BLACKDETECT, blackdetect, vf);
- REGISTER_FILTER(BLACKFRAME, blackframe, vf);
- REGISTER_FILTER(BLEND, blend, vf);
- REGISTER_FILTER(BOXBLUR, boxblur, vf);
- REGISTER_FILTER(BWDIF, bwdif, vf);
- REGISTER_FILTER(CHROMAKEY, chromakey, vf);
- REGISTER_FILTER(CIESCOPE, ciescope, vf);
- REGISTER_FILTER(CODECVIEW, codecview, vf);
- REGISTER_FILTER(COLORBALANCE, colorbalance, vf);
- REGISTER_FILTER(COLORCHANNELMIXER, colorchannelmixer, vf);
- REGISTER_FILTER(COLORKEY, colorkey, vf);
- REGISTER_FILTER(COLORLEVELS, colorlevels, vf);
- REGISTER_FILTER(COLORMATRIX, colormatrix, vf);
- REGISTER_FILTER(COLORSPACE, colorspace, vf);
- REGISTER_FILTER(CONVOLUTION, convolution, vf);
- REGISTER_FILTER(CONVOLUTION_OPENCL, convolution_opencl, vf);
- REGISTER_FILTER(CONVOLVE, convolve, vf);
- REGISTER_FILTER(COPY, copy, vf);
- REGISTER_FILTER(COREIMAGE, coreimage, vf);
- REGISTER_FILTER(COVER_RECT, cover_rect, vf);
- REGISTER_FILTER(CROP, crop, vf);
- REGISTER_FILTER(CROPDETECT, cropdetect, vf);
- REGISTER_FILTER(CURVES, curves, vf);
- REGISTER_FILTER(DATASCOPE, datascope, vf);
- REGISTER_FILTER(DCTDNOIZ, dctdnoiz, vf);
- REGISTER_FILTER(DEBAND, deband, vf);
- REGISTER_FILTER(DECIMATE, decimate, vf);
- REGISTER_FILTER(DECONVOLVE, deconvolve, vf);
- REGISTER_FILTER(DEFLATE, deflate, vf);
- REGISTER_FILTER(DEFLICKER, deflicker, vf);
- REGISTER_FILTER(DEINTERLACE_QSV,deinterlace_qsv,vf);
- REGISTER_FILTER(DEINTERLACE_VAAPI, deinterlace_vaapi, vf);
- REGISTER_FILTER(DEJUDDER, dejudder, vf);
- REGISTER_FILTER(DELOGO, delogo, vf);
- REGISTER_FILTER(DENOISE_VAAPI, denoise_vaapi, vf);
- REGISTER_FILTER(DESHAKE, deshake, vf);
- REGISTER_FILTER(DESPILL, despill, vf);
- REGISTER_FILTER(DETELECINE, detelecine, vf);
- REGISTER_FILTER(DILATION, dilation, vf);
- REGISTER_FILTER(DISPLACE, displace, vf);
- REGISTER_FILTER(DOUBLEWEAVE, doubleweave, vf);
- REGISTER_FILTER(DRAWBOX, drawbox, vf);
- REGISTER_FILTER(DRAWGRAPH, drawgraph, vf);
- REGISTER_FILTER(DRAWGRID, drawgrid, vf);
- REGISTER_FILTER(DRAWTEXT, drawtext, vf);
- REGISTER_FILTER(EDGEDETECT, edgedetect, vf);
- REGISTER_FILTER(ELBG, elbg, vf);
- REGISTER_FILTER(ENTROPY, entropy, vf);
- REGISTER_FILTER(EQ, eq, vf);
- REGISTER_FILTER(EROSION, erosion, vf);
- REGISTER_FILTER(EXTRACTPLANES, extractplanes, vf);
- REGISTER_FILTER(FADE, fade, vf);
- REGISTER_FILTER(FFTFILT, fftfilt, vf);
- REGISTER_FILTER(FIELD, field, vf);
- REGISTER_FILTER(FIELDHINT, fieldhint, vf);
- REGISTER_FILTER(FIELDMATCH, fieldmatch, vf);
- REGISTER_FILTER(FIELDORDER, fieldorder, vf);
- REGISTER_FILTER(FILLBORDERS, fillborders, vf);
- REGISTER_FILTER(FIND_RECT, find_rect, vf);
- REGISTER_FILTER(FLOODFILL, floodfill, vf);
- REGISTER_FILTER(FORMAT, format, vf);
- REGISTER_FILTER(FPS, fps, vf);
- REGISTER_FILTER(FRAMEPACK, framepack, vf);
- REGISTER_FILTER(FRAMERATE, framerate, vf);
- REGISTER_FILTER(FRAMESTEP, framestep, vf);
- REGISTER_FILTER(FREI0R, frei0r, vf);
- REGISTER_FILTER(FSPP, fspp, vf);
- REGISTER_FILTER(GBLUR, gblur, vf);
- REGISTER_FILTER(GEQ, geq, vf);
- REGISTER_FILTER(GRADFUN, gradfun, vf);
- REGISTER_FILTER(HALDCLUT, haldclut, vf);
- REGISTER_FILTER(HFLIP, hflip, vf);
- REGISTER_FILTER(HISTEQ, histeq, vf);
- REGISTER_FILTER(HISTOGRAM, histogram, vf);
- REGISTER_FILTER(HQDN3D, hqdn3d, vf);
- REGISTER_FILTER(HQX, hqx, vf);
- REGISTER_FILTER(HSTACK, hstack, vf);
- REGISTER_FILTER(HUE, hue, vf);
- REGISTER_FILTER(HWDOWNLOAD, hwdownload, vf);
- REGISTER_FILTER(HWMAP, hwmap, vf);
- REGISTER_FILTER(HWUPLOAD, hwupload, vf);
- REGISTER_FILTER(HWUPLOAD_CUDA, hwupload_cuda, vf);
- REGISTER_FILTER(HYSTERESIS, hysteresis, vf);
- REGISTER_FILTER(IDET, idet, vf);
- REGISTER_FILTER(IL, il, vf);
- REGISTER_FILTER(INFLATE, inflate, vf);
- REGISTER_FILTER(INTERLACE, interlace, vf);
- REGISTER_FILTER(INTERLEAVE, interleave, vf);
- REGISTER_FILTER(KERNDEINT, kerndeint, vf);
- REGISTER_FILTER(LENSCORRECTION, lenscorrection, vf);
- REGISTER_FILTER(LIBVMAF, libvmaf, vf);
- REGISTER_FILTER(LIMITER, limiter, vf);
- REGISTER_FILTER(LOOP, loop, vf);
- REGISTER_FILTER(LUMAKEY, lumakey, vf);
- REGISTER_FILTER(LUT, lut, vf);
- REGISTER_FILTER(LUT2, lut2, vf);
- REGISTER_FILTER(LUT3D, lut3d, vf);
- REGISTER_FILTER(LUTRGB, lutrgb, vf);
- REGISTER_FILTER(LUTYUV, lutyuv, vf);
- REGISTER_FILTER(MASKEDCLAMP, maskedclamp, vf);
- REGISTER_FILTER(MASKEDMERGE, maskedmerge, vf);
- REGISTER_FILTER(MCDEINT, mcdeint, vf);
- REGISTER_FILTER(MERGEPLANES, mergeplanes, vf);
- REGISTER_FILTER(MESTIMATE, mestimate, vf);
- REGISTER_FILTER(METADATA, metadata, vf);
- REGISTER_FILTER(MIDEQUALIZER, midequalizer, vf);
- REGISTER_FILTER(MINTERPOLATE, minterpolate, vf);
- REGISTER_FILTER(MIX, mix, vf);
- REGISTER_FILTER(MPDECIMATE, mpdecimate, vf);
- REGISTER_FILTER(NEGATE, negate, vf);
- REGISTER_FILTER(NLMEANS, nlmeans, vf);
- REGISTER_FILTER(NNEDI, nnedi, vf);
- REGISTER_FILTER(NOFORMAT, noformat, vf);
- REGISTER_FILTER(NOISE, noise, vf);
- REGISTER_FILTER(NORMALIZE, normalize, vf);
- REGISTER_FILTER(NULL, null, vf);
- REGISTER_FILTER(OCR, ocr, vf);
- REGISTER_FILTER(OCV, ocv, vf);
- REGISTER_FILTER(OSCILLOSCOPE, oscilloscope, vf);
- REGISTER_FILTER(OVERLAY, overlay, vf);
- REGISTER_FILTER(OVERLAY_OPENCL, overlay_opencl, vf);
- REGISTER_FILTER(OVERLAY_QSV, overlay_qsv, vf);
- REGISTER_FILTER(OWDENOISE, owdenoise, vf);
- REGISTER_FILTER(PAD, pad, vf);
- REGISTER_FILTER(PALETTEGEN, palettegen, vf);
- REGISTER_FILTER(PALETTEUSE, paletteuse, vf);
- REGISTER_FILTER(PERMS, perms, vf);
- REGISTER_FILTER(PERSPECTIVE, perspective, vf);
- REGISTER_FILTER(PHASE, phase, vf);
- REGISTER_FILTER(PIXDESCTEST, pixdesctest, vf);
- REGISTER_FILTER(PIXSCOPE, pixscope, vf);
- REGISTER_FILTER(PP, pp, vf);
- REGISTER_FILTER(PP7, pp7, vf);
- REGISTER_FILTER(PREMULTIPLY, premultiply, vf);
- REGISTER_FILTER(PREWITT, prewitt, vf);
- REGISTER_FILTER(PROCAMP_VAAPI, procamp_vaapi, vf);
- REGISTER_FILTER(PROGRAM_OPENCL, program_opencl, vf);
- REGISTER_FILTER(PSEUDOCOLOR, pseudocolor, vf);
- REGISTER_FILTER(PSNR, psnr, vf);
- REGISTER_FILTER(PULLUP, pullup, vf);
- REGISTER_FILTER(QP, qp, vf);
- REGISTER_FILTER(RANDOM, random, vf);
- REGISTER_FILTER(READEIA608, readeia608, vf);
- REGISTER_FILTER(READVITC, readvitc, vf);
- REGISTER_FILTER(REALTIME, realtime, vf);
- REGISTER_FILTER(REMAP, remap, vf);
- REGISTER_FILTER(REMOVEGRAIN, removegrain, vf);
- REGISTER_FILTER(REMOVELOGO, removelogo, vf);
- REGISTER_FILTER(REPEATFIELDS, repeatfields, vf);
- REGISTER_FILTER(REVERSE, reverse, vf);
- REGISTER_FILTER(ROBERTS, roberts, vf);
- REGISTER_FILTER(ROTATE, rotate, vf);
- REGISTER_FILTER(SAB, sab, vf);
- REGISTER_FILTER(SCALE, scale, vf);
- REGISTER_FILTER(SCALE_CUDA, scale_cuda, vf);
- REGISTER_FILTER(SCALE_NPP, scale_npp, vf);
- REGISTER_FILTER(SCALE_QSV, scale_qsv, vf);
- REGISTER_FILTER(SCALE_VAAPI, scale_vaapi, vf);
- REGISTER_FILTER(SCALE2REF, scale2ref, vf);
- REGISTER_FILTER(SELECT, select, vf);
- REGISTER_FILTER(SELECTIVECOLOR, selectivecolor, vf);
- REGISTER_FILTER(SENDCMD, sendcmd, vf);
- REGISTER_FILTER(SEPARATEFIELDS, separatefields, vf);
- REGISTER_FILTER(SETDAR, setdar, vf);
- REGISTER_FILTER(SETFIELD, setfield, vf);
- REGISTER_FILTER(SETPTS, setpts, vf);
- REGISTER_FILTER(SETRANGE, setrange, vf);
- REGISTER_FILTER(SETSAR, setsar, vf);
- REGISTER_FILTER(SETTB, settb, vf);
- REGISTER_FILTER(SHARPNESS_VAAPI, sharpness_vaapi, vf);
- REGISTER_FILTER(SHOWINFO, showinfo, vf);
- REGISTER_FILTER(SHOWPALETTE, showpalette, vf);
- REGISTER_FILTER(SHUFFLEFRAMES, shuffleframes, vf);
- REGISTER_FILTER(SHUFFLEPLANES, shuffleplanes, vf);
- REGISTER_FILTER(SIDEDATA, sidedata, vf);
- REGISTER_FILTER(SIGNALSTATS, signalstats, vf);
- REGISTER_FILTER(SIGNATURE, signature, vf);
- REGISTER_FILTER(SMARTBLUR, smartblur, vf);
- REGISTER_FILTER(SOBEL, sobel, vf);
- REGISTER_FILTER(SPLIT, split, vf);
- REGISTER_FILTER(SPP, spp, vf);
- REGISTER_FILTER(SSIM, ssim, vf);
- REGISTER_FILTER(STEREO3D, stereo3d, vf);
- REGISTER_FILTER(STREAMSELECT, streamselect, vf);
- REGISTER_FILTER(SUBTITLES, subtitles, vf);
- REGISTER_FILTER(SUPER2XSAI, super2xsai, vf);
- REGISTER_FILTER(SWAPRECT, swaprect, vf);
- REGISTER_FILTER(SWAPUV, swapuv, vf);
- REGISTER_FILTER(TBLEND, tblend, vf);
- REGISTER_FILTER(TELECINE, telecine, vf);
- REGISTER_FILTER(THRESHOLD, threshold, vf);
- REGISTER_FILTER(THUMBNAIL, thumbnail, vf);
- REGISTER_FILTER(THUMBNAIL_CUDA, thumbnail_cuda, vf);
- REGISTER_FILTER(TILE, tile, vf);
- REGISTER_FILTER(TINTERLACE, tinterlace, vf);
- REGISTER_FILTER(TLUT2, tlut2, vf);
- REGISTER_FILTER(TONEMAP, tonemap, vf);
- REGISTER_FILTER(TRANSPOSE, transpose, vf);
- REGISTER_FILTER(TRIM, trim, vf);
- REGISTER_FILTER(UNPREMULTIPLY, unpremultiply, vf);
- REGISTER_FILTER(UNSHARP, unsharp, vf);
- REGISTER_FILTER(UNSHARP_OPENCL, unsharp_opencl, vf);
- REGISTER_FILTER(USPP, uspp, vf);
- REGISTER_FILTER(VAGUEDENOISER, vaguedenoiser, vf);
- REGISTER_FILTER(VECTORSCOPE, vectorscope, vf);
- REGISTER_FILTER(VFLIP, vflip, vf);
- REGISTER_FILTER(VIDSTABDETECT, vidstabdetect, vf);
- REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf);
- REGISTER_FILTER(VIGNETTE, vignette, vf);
- REGISTER_FILTER(VMAFMOTION, vmafmotion, vf);
- REGISTER_FILTER(VPP_QSV, vpp_qsv, vf);
- REGISTER_FILTER(VSTACK, vstack, vf);
- REGISTER_FILTER(W3FDIF, w3fdif, vf);
- REGISTER_FILTER(WAVEFORM, waveform, vf);
- REGISTER_FILTER(WEAVE, weave, vf);
- REGISTER_FILTER(XBR, xbr, vf);
- REGISTER_FILTER(YADIF, yadif, vf);
- REGISTER_FILTER(ZMQ, zmq, vf);
- REGISTER_FILTER(ZOOMPAN, zoompan, vf);
- REGISTER_FILTER(ZSCALE, zscale, vf);
+ if (!name)
+ return NULL;
- REGISTER_FILTER(ALLRGB, allrgb, vsrc);
- REGISTER_FILTER(ALLYUV, allyuv, vsrc);
- REGISTER_FILTER(CELLAUTO, cellauto, vsrc);
- REGISTER_FILTER(COLOR, color, vsrc);
- REGISTER_FILTER(COREIMAGESRC, coreimagesrc, vsrc);
- REGISTER_FILTER(FREI0R, frei0r_src, vsrc);
- REGISTER_FILTER(HALDCLUTSRC, haldclutsrc, vsrc);
- REGISTER_FILTER(LIFE, life, vsrc);
- REGISTER_FILTER(MANDELBROT, mandelbrot, vsrc);
- REGISTER_FILTER(MPTESTSRC, mptestsrc, vsrc);
- REGISTER_FILTER(NULLSRC, nullsrc, vsrc);
- REGISTER_FILTER(OPENCLSRC, openclsrc, vsrc);
- REGISTER_FILTER(RGBTESTSRC, rgbtestsrc, vsrc);
- REGISTER_FILTER(SMPTEBARS, smptebars, vsrc);
- REGISTER_FILTER(SMPTEHDBARS, smptehdbars, vsrc);
- REGISTER_FILTER(TESTSRC, testsrc, vsrc);
- REGISTER_FILTER(TESTSRC2, testsrc2, vsrc);
- REGISTER_FILTER(YUVTESTSRC, yuvtestsrc, vsrc);
+ while ((f = av_filter_iterate(&opaque)))
+ if (!strcmp(f->name, name))
+ return (AVFilter *)f;
- REGISTER_FILTER(NULLSINK, nullsink, vsink);
+ return NULL;
+}
- /* multimedia filters */
- REGISTER_FILTER(ABITSCOPE, abitscope, avf);
- REGISTER_FILTER(ADRAWGRAPH, adrawgraph, avf);
- REGISTER_FILTER(AHISTOGRAM, ahistogram, avf);
- REGISTER_FILTER(APHASEMETER, aphasemeter, avf);
- REGISTER_FILTER(AVECTORSCOPE, avectorscope, avf);
- REGISTER_FILTER(CONCAT, concat, avf);
- REGISTER_FILTER(SHOWCQT, showcqt, avf);
- REGISTER_FILTER(SHOWFREQS, showfreqs, avf);
- REGISTER_FILTER(SHOWSPECTRUM, showspectrum, avf);
- REGISTER_FILTER(SHOWSPECTRUMPIC, showspectrumpic, avf);
- REGISTER_FILTER(SHOWVOLUME, showvolume, avf);
- REGISTER_FILTER(SHOWWAVES, showwaves, avf);
- REGISTER_FILTER(SHOWWAVESPIC, showwavespic, avf);
- REGISTER_FILTER(SPECTRUMSYNTH, spectrumsynth, vaf);
- /* multimedia sources */
- REGISTER_FILTER(AMOVIE, amovie, avsrc);
- REGISTER_FILTER(MOVIE, movie, avsrc);
+#if FF_API_NEXT
+FF_DISABLE_DEPRECATION_WARNINGS
+static AVOnce av_filter_next_init = AV_ONCE_INIT;
- /* those filters are part of public or internal API => registered
- * unconditionally */
- REGISTER_FILTER_UNCONDITIONAL(asrc_abuffer);
- REGISTER_FILTER_UNCONDITIONAL(vsrc_buffer);
- REGISTER_FILTER_UNCONDITIONAL(asink_abuffer);
- REGISTER_FILTER_UNCONDITIONAL(vsink_buffer);
- REGISTER_FILTER_UNCONDITIONAL(af_afifo);
- REGISTER_FILTER_UNCONDITIONAL(vf_fifo);
+static void av_filter_init_next(void)
+{
+ AVFilter *prev = NULL, *p;
+ void *i = 0;
+ while ((p = (AVFilter*)av_filter_iterate(&i))) {
+ if (prev)
+ prev->next = p;
+ prev = p;
+ }
}
void avfilter_register_all(void)
{
- static AVOnce control = AV_ONCE_INIT;
+ ff_thread_once(&av_filter_next_init, av_filter_init_next);
+}
+
+int avfilter_register(AVFilter *filter)
+{
+ ff_thread_once(&av_filter_next_init, av_filter_init_next);
+
+ return 0;
+}
+
+const AVFilter *avfilter_next(const AVFilter *prev)
+{
+ ff_thread_once(&av_filter_next_init, av_filter_init_next);
- ff_thread_once(&control, register_all);
+ return prev ? prev->next : filter_list[0];
}
+
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 7553f7c36a..ed8161136c 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -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 = avfilter_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 = avfilter_next(f)))
+ while ((f = av_filter_iterate(&opaque)))
if (f->priv_class)
return f->priv_class;
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 2d1195eeeb..9d70e7118b 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -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,9 +723,19 @@ 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.
*
* @param name the filter name to find
@@ -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.
diff --git a/libavfilter/version.h b/libavfilter/version.h
index babb4187b4..8d77a500bf 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -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 */
1
0
ffmpeg | branch: master | Josh de Kock <josh(a)itanimul.li> | Sat Mar 17 21:34:18 2018 +0000| [cda43940da872ebc15bc1f676fe81b544196446d] | committer: Josh de Kock
checkasm/Makefile: add EXTRALIBS-libavformat
Signed-off-by: Josh de Kock <josh(a)itanimul.li>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cda43940da872ebc1…
---
tests/checkasm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index 97fbf59636..0233d2f989 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -67,7 +67,7 @@ tests/checkasm/checkasm.o: CFLAGS += -Umain
CHECKASM := tests/checkasm/checkasm$(EXESUF)
$(CHECKASM): $(CHECKASMOBJS) $(FF_STATIC_DEP_LIBS)
- $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(CHECKASMOBJS) $(FF_STATIC_DEP_LIBS) $(EXTRALIBS-avcodec) $(EXTRALIBS-avfilter) $(EXTRALIBS-avutil) $(EXTRALIBS-swresample) $(EXTRALIBS)
+ $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(CHECKASMOBJS) $(FF_STATIC_DEP_LIBS) $(EXTRALIBS-avcodec) $(EXTRALIBS-avfilter) $(EXTRALIBS-avformat) $(EXTRALIBS-avutil) $(EXTRALIBS-swresample) $(EXTRALIBS)
checkasm: $(CHECKASM)
1
0
ffmpeg | branch: master | Martin Storsjö <martin(a)martin.st> | Sat Mar 31 21:54:46 2018 +0300| [5f83935de4ef1e32d22f90016b9ddebc1e56153f] | committer: Martin Storsjö
arm: hevcdsp: Add commas between macro arguments
When targeting darwin, clang requires commas between arguments,
while the no-comma form is allowed for other targets.
Since Xcode 9.3, the bundled clang supports altmacro and doesn't
require using gas-preprocessor any longer.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5f83935de4ef1e32d…
---
libavcodec/arm/hevcdsp_qpel_neon.S | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/libavcodec/arm/hevcdsp_qpel_neon.S b/libavcodec/arm/hevcdsp_qpel_neon.S
index 86f92cf75a..caa6efa766 100644
--- a/libavcodec/arm/hevcdsp_qpel_neon.S
+++ b/libavcodec/arm/hevcdsp_qpel_neon.S
@@ -667,76 +667,76 @@ endfunc
function ff_hevc_put_qpel_h1v1_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_1 qpel_filter_1_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_1, qpel_filter_1_32b
endfunc
function ff_hevc_put_qpel_h2v1_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_2 qpel_filter_1_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_2, qpel_filter_1_32b
endfunc
function ff_hevc_put_qpel_h3v1_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_3 qpel_filter_1_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_3, qpel_filter_1_32b
endfunc
function ff_hevc_put_qpel_h1v2_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_1 qpel_filter_2_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_1, qpel_filter_2_32b
endfunc
function ff_hevc_put_qpel_h2v2_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_2 qpel_filter_2_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_2, qpel_filter_2_32b
endfunc
function ff_hevc_put_qpel_h3v2_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_3 qpel_filter_2_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_3, qpel_filter_2_32b
endfunc
function ff_hevc_put_qpel_h1v3_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_1 qpel_filter_3_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_1, qpel_filter_3_32b
endfunc
function ff_hevc_put_qpel_h2v3_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_2 qpel_filter_3_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_2, qpel_filter_3_32b
endfunc
function ff_hevc_put_qpel_h3v3_neon_8, export=1
- hevc_put_qpel_hXvY_neon_8 qpel_filter_3 qpel_filter_3_32b
+ hevc_put_qpel_hXvY_neon_8 qpel_filter_3, qpel_filter_3_32b
endfunc
function ff_hevc_put_qpel_uw_h1v1_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_1 qpel_filter_1_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_1, qpel_filter_1_32b
endfunc
function ff_hevc_put_qpel_uw_h2v1_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_2 qpel_filter_1_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_2, qpel_filter_1_32b
endfunc
function ff_hevc_put_qpel_uw_h3v1_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_3 qpel_filter_1_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_3, qpel_filter_1_32b
endfunc
function ff_hevc_put_qpel_uw_h1v2_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_1 qpel_filter_2_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_1, qpel_filter_2_32b
endfunc
function ff_hevc_put_qpel_uw_h2v2_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_2 qpel_filter_2_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_2, qpel_filter_2_32b
endfunc
function ff_hevc_put_qpel_uw_h3v2_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_3 qpel_filter_2_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_3, qpel_filter_2_32b
endfunc
function ff_hevc_put_qpel_uw_h1v3_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_1 qpel_filter_3_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_1, qpel_filter_3_32b
endfunc
function ff_hevc_put_qpel_uw_h2v3_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_2 qpel_filter_3_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_2, qpel_filter_3_32b
endfunc
function ff_hevc_put_qpel_uw_h3v3_neon_8, export=1
- hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_3 qpel_filter_3_32b
+ hevc_put_qpel_uw_hXvY_neon_8 qpel_filter_3, qpel_filter_3_32b
endfunc
.macro init_put_pixels
1
0
ffmpeg | branch: master | Martin Storsjö <martin(a)martin.st> | Sat Mar 31 21:54:41 2018 +0300| [6660bc034d212dc8fb01715d6bf3a6d3866e9715] | committer: Martin Storsjö
arm: hevcdsp: Avoid using macro expansion counters
Clang supports the macro expansion counter (used for making unique
labels within macro expansions), but not when targeting darwin.
Convert uses of the counter into normal local labels, as used
elsewhere.
Since Xcode 9.3, the bundled clang supports altmacro and doesn't
require using gas-preprocessor any longer.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6660bc034d212dc8f…
---
libavcodec/arm/hevcdsp_deblock_neon.S | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavcodec/arm/hevcdsp_deblock_neon.S b/libavcodec/arm/hevcdsp_deblock_neon.S
index 166bddb104..7cb7487ef6 100644
--- a/libavcodec/arm/hevcdsp_deblock_neon.S
+++ b/libavcodec/arm/hevcdsp_deblock_neon.S
@@ -152,7 +152,7 @@
and r9, r8, r7
cmp r9, #0
- beq weakfilter_\@
+ beq 1f
vadd.i16 q2, q11, q12
vadd.i16 q4, q9, q8
@@ -210,11 +210,11 @@
vbit q13, q3, q5
vbit q14, q2, q5
-weakfilter_\@:
+1:
mvn r8, r8
and r9, r8, r7
cmp r9, #0
- beq ready_\@
+ beq 2f
vdup.16 q4, r2
@@ -275,7 +275,7 @@ weakfilter_\@:
vbit q11, q0, q5
vbit q12, q4, q5
-ready_\@:
+2:
vqmovun.s16 d16, q8
vqmovun.s16 d18, q9
vqmovun.s16 d20, q10
1
0
arm: swscale: Only compile the rgb2yuv asm if .dn aliases are supported
by Martin Storsjö 31 Mar '18
by Martin Storsjö 31 Mar '18
31 Mar '18
ffmpeg | branch: master | Martin Storsjö <martin(a)martin.st> | Sat Mar 31 21:54:32 2018 +0300| [f33f728470434a9981a53d7560d67657b93d1e26] | committer: Martin Storsjö
arm: swscale: Only compile the rgb2yuv asm if .dn aliases are supported
Vanilla clang supports altmacro since clang 5.0, and thus doesn't
require gas-preprocessor for building the arm assembly any longer.
However, the built-in assembler doesn't support .dn directives.
This readds checks that were removed in d7320ca3ed10f0d, when
the last usage of .dn directives within libav were removed.
Alternatively, the assembly could be rewritten to not use the
.dn directive, making it available to clang users.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f33f728470434a998…
---
configure | 2 ++
libswscale/arm/rgb2yuv_neon_16.S | 3 +++
libswscale/arm/rgb2yuv_neon_32.S | 3 +++
libswscale/arm/swscale_unscaled.c | 6 ++++++
4 files changed, 14 insertions(+)
diff --git a/configure b/configure
index 99570a1415..81fb3fbf75 100755
--- a/configure
+++ b/configure
@@ -2149,6 +2149,7 @@ SYSTEM_LIBRARIES="
TOOLCHAIN_FEATURES="
as_arch_directive
+ as_dn_directive
as_fpu_directive
as_func
as_object_arch
@@ -5530,6 +5531,7 @@ EOF
check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
check_as as_arch_directive ".arch armv7-a"
+ check_as as_dn_directive "ra .dn d0.i16"
check_as as_fpu_directive ".fpu neon"
# llvm's integrated assembler supports .object_arch from llvm 3.5
diff --git a/libswscale/arm/rgb2yuv_neon_16.S b/libswscale/arm/rgb2yuv_neon_16.S
index 601bc9a9b7..ad7e679ca9 100644
--- a/libswscale/arm/rgb2yuv_neon_16.S
+++ b/libswscale/arm/rgb2yuv_neon_16.S
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
+#if HAVE_AS_DN_DIRECTIVE
#include "rgb2yuv_neon_common.S"
/* downsampled R16G16B16 x8 */
@@ -78,3 +80,4 @@ alias_qw c8x8x2, q10
.endm
loop_420sp rgbx, nv12, init, kernel_420_16x2, 16
+#endif
diff --git a/libswscale/arm/rgb2yuv_neon_32.S b/libswscale/arm/rgb2yuv_neon_32.S
index f51a5f149f..4fd0f64a09 100644
--- a/libswscale/arm/rgb2yuv_neon_32.S
+++ b/libswscale/arm/rgb2yuv_neon_32.S
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
+#if HAVE_AS_DN_DIRECTIVE
#include "rgb2yuv_neon_common.S"
/* downsampled R16G16B16 x8 */
@@ -117,3 +119,4 @@ alias_qw c8x8x2, q10
loop_420sp rgbx, nv12, init, kernel_420_16x2, 32
+#endif
diff --git a/libswscale/arm/swscale_unscaled.c b/libswscale/arm/swscale_unscaled.c
index e1597ab42d..e41f294eac 100644
--- a/libswscale/arm/swscale_unscaled.c
+++ b/libswscale/arm/swscale_unscaled.c
@@ -23,6 +23,7 @@
#include "libswscale/swscale_internal.h"
#include "libavutil/arm/cpu.h"
+#if HAVE_AS_DN_DIRECTIVE
extern void rgbx_to_nv12_neon_32(const uint8_t *src, uint8_t *y, uint8_t *chroma,
int width, int height,
int y_stride, int c_stride, int src_stride,
@@ -178,3 +179,8 @@ void ff_get_unscaled_swscale_arm(SwsContext *c)
if (have_neon(cpu_flags))
get_unscaled_swscale_neon(c);
}
+#else
+void ff_get_unscaled_swscale_arm(SwsContext *c)
+{
+}
+#endif
1
0
ffmpeg | branch: master | Paul B Mahol <onemda(a)gmail.com> | Sat Mar 31 09:26:37 2018 +0200| [0c25caa4708cc3a89a9ee9666d0257e6dc6a1573] | committer: Paul B Mahol
avfilter/avf_showvolume: let fade be also exactly 0
Signed-off-by: Paul B Mahol <onemda(a)gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c25caa4708cc3a89…
---
doc/filters.texi | 2 +-
libavfilter/avf_showvolume.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/filters.texi b/doc/filters.texi
index c05b12849f..bf2b94e240 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -19936,7 +19936,7 @@ Set channel width, allowed range is [80, 8192]. Default is 400.
Set channel height, allowed range is [1, 900]. Default is 20.
@item f
-Set fade, allowed range is [0.001, 1]. Default is 0.95.
+Set fade, allowed range is [0, 1]. Default is 0.95.
@item c
Set volume color expression.
diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c
index 6c47cce19f..267020e163 100644
--- a/libavfilter/avf_showvolume.c
+++ b/libavfilter/avf_showvolume.c
@@ -67,7 +67,7 @@ static const AVOption showvolume_options[] = {
{ "b", "set border width", OFFSET(b), AV_OPT_TYPE_INT, {.i64=1}, 0, 5, FLAGS },
{ "w", "set channel width", OFFSET(w), AV_OPT_TYPE_INT, {.i64=400}, 80, 8192, FLAGS },
{ "h", "set channel height", OFFSET(h), AV_OPT_TYPE_INT, {.i64=20}, 1, 900, FLAGS },
- { "f", "set fade", OFFSET(f), AV_OPT_TYPE_DOUBLE, {.dbl=0.95}, 0.001, 1, FLAGS },
+ { "f", "set fade", OFFSET(f), AV_OPT_TYPE_DOUBLE, {.dbl=0.95}, 0, 1, FLAGS },
{ "c", "set volume color expression", OFFSET(color), AV_OPT_TYPE_STRING, {.str="PEAK*255+floor((1-PEAK)*255)*256+0xff000000"}, 0, 0, FLAGS },
{ "t", "display channel names", OFFSET(draw_text), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ "v", "display volume value", OFFSET(draw_volume), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
1
0
ffmpeg | branch: master | Martin Vignali <martin.vignali(a)gmail.com> | Fri Mar 30 22:42:42 2018 +0200| [e8d785035320453b52f915bce083afd4109ab92c] | committer: Paul B Mahol
doc/avfilter/showvolume : fix doc for orientation param
possible value are h or v.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e8d785035320453b5…
---
doc/filters.texi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/filters.texi b/doc/filters.texi
index 5c119c0151..c05b12849f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -19961,8 +19961,8 @@ If set, displays channel names. Default is enabled.
If set, displays volume values. Default is enabled.
@item o
-Set orientation, can be @code{horizontal} or @code{vertical},
-default is @code{horizontal}.
+Set orientation, can be horizontal: @code{h} or vertical: @code{v},
+default is @code{h}.
@item s
Set step size, allowed range is [0, 5]. Default is 0, which means
1
0