[FFmpeg-devel] [PATCH 1/2] lavfi: enable buffersinks unconditionally.

Nicolas George nicolas.george at normalesup.org
Wed Sep 26 19:06:25 CEST 2012


They are part of the public API. Their libav compatibility
counterpart are already enabled unconditionally.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/Makefile      |    5 +----
 libavfilter/allfilters.c  |   19 +++++++++++--------
 libavfilter/sink_buffer.c |    8 --------
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 3477eca..ed1b9b5 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -36,6 +36,7 @@ OBJS = allfilters.o                                                     \
        formats.o                                                        \
        graphdump.o                                                      \
        graphparser.o                                                    \
+       sink_buffer.o                                                    \
        src_buffer.o                                                     \
        transform.o                                                      \
        vf_scale.o                                                       \
@@ -76,8 +77,6 @@ OBJS-$(CONFIG_AEVALSRC_FILTER)               += asrc_aevalsrc.o
 OBJS-$(CONFIG_ANULLSRC_FILTER)               += asrc_anullsrc.o
 OBJS-$(CONFIG_FLITE_FILTER)                  += asrc_flite.o
 
-OBJS-$(CONFIG_ABUFFERSINK_FILTER)            += sink_buffer.o
-OBJS-$(CONFIG_FFABUFFERSINK_FILTER)          += sink_buffer.o
 OBJS-$(CONFIG_ANULLSINK_FILTER)              += asink_anullsink.o
 
 OBJS-$(CONFIG_ASS_FILTER)                    += vf_ass.o
@@ -154,8 +153,6 @@ OBJS-$(CONFIG_RGBTESTSRC_FILTER)             += vsrc_testsrc.o
 OBJS-$(CONFIG_SMPTEBARS_FILTER)              += vsrc_testsrc.o
 OBJS-$(CONFIG_TESTSRC_FILTER)                += vsrc_testsrc.o
 
-OBJS-$(CONFIG_BUFFERSINK_FILTER)             += sink_buffer.o
-OBJS-$(CONFIG_FFBUFFERSINK_FILTER)           += sink_buffer.o
 OBJS-$(CONFIG_NULLSINK_FILTER)               += vsink_nullsink.o
 
 OBJS-$(CONFIG_MP_FILTER) += libmpcodecs/mp_image.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index b28c024..49f166d 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -27,6 +27,10 @@
           extern AVFilter avfilter_##y##_##x ; \
           if(CONFIG_##X##_FILTER )  avfilter_register(&avfilter_##y##_##x ); }
 
+#define REGISTER_BUILTIN_FILTER(x,y) { \
+          extern AVFilter avfilter_##y##_##x ; \
+          avfilter_register(&avfilter_##y##_##x ); }
+
 void avfilter_register_all(void)
 {
     static int initialized;
@@ -65,11 +69,7 @@ void avfilter_register_all(void)
     REGISTER_FILTER (ANULLSRC,    anullsrc,    asrc);
     REGISTER_FILTER (FLITE,       flite,       asrc);
 
-#if !AV_HAVE_INCOMPATIBLE_FORK_ABI
-    REGISTER_FILTER (ABUFFERSINK, abuffersink, asink);
-#endif
     REGISTER_FILTER (ANULLSINK,   anullsink,   asink);
-    REGISTER_FILTER (FFABUFFERSINK, ffabuffersink, asink);
 
     REGISTER_FILTER (ALPHAEXTRACT, alphaextract, vf);
     REGISTER_FILTER (ALPHAMERGE,  alphamerge,  vf);
@@ -145,10 +145,6 @@ void avfilter_register_all(void)
     REGISTER_FILTER (SMPTEBARS,   smptebars,   vsrc);
     REGISTER_FILTER (TESTSRC,     testsrc,     vsrc);
 
-#if !AV_HAVE_INCOMPATIBLE_FORK_ABI
-    REGISTER_FILTER (BUFFERSINK,  buffersink,  vsink);
-#endif
-    REGISTER_FILTER (FFBUFFERSINK,ffbuffersink,vsink);
     REGISTER_FILTER (NULLSINK,    nullsink,    vsink);
 
     /* multimedia filters */
@@ -160,6 +156,13 @@ void avfilter_register_all(void)
     REGISTER_FILTER (AMOVIE,      amovie,      avsrc);
     REGISTER_FILTER (MOVIE,       movie,       avsrc);
 
+    REGISTER_BUILTIN_FILTER (ffbuffersink,  vsink);
+    REGISTER_BUILTIN_FILTER (ffabuffersink, asink);
+#if !AV_HAVE_INCOMPATIBLE_FORK_ABI
+    REGISTER_BUILTIN_FILTER (buffersink,    vsink);
+    REGISTER_BUILTIN_FILTER (abuffersink,   asink);
+#endif
+
     /* those filters are part of public or internal API => registered
      * unconditionally */
     {
diff --git a/libavfilter/sink_buffer.c b/libavfilter/sink_buffer.c
index e34e8e2..8c52c5c 100644
--- a/libavfilter/sink_buffer.c
+++ b/libavfilter/sink_buffer.c
@@ -188,8 +188,6 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
     return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink);
 }
 
-#if CONFIG_BUFFERSINK_FILTER || CONFIG_FFBUFFERSINK_FILTER
-
 static av_cold int vsink_init(AVFilterContext *ctx, const char *args, void *opaque)
 {
     BufferSinkContext *buf = ctx->priv;
@@ -259,10 +257,6 @@ AVFilter avfilter_vsink_buffersink = {
     .outputs   = (const AVFilterPad[]) {{ .name = NULL }},
 };
 
-#endif /* CONFIG_BUFFERSINK_FILTER */
-
-#if CONFIG_ABUFFERSINK_FILTER || CONFIG_FFABUFFERSINK_FILTER
-
 static int filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
 {
     end_frame(link);
@@ -354,5 +348,3 @@ AVFilter avfilter_asink_abuffersink = {
                                   { .name = NULL }},
     .outputs   = (const AVFilterPad[]) {{ .name = NULL }},
 };
-
-#endif /* CONFIG_ABUFFERSINK_FILTER */
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list