lavfi: enable buffersinks unconditionally.
authorNicolas George <nicolas.george@normalesup.org>
Wed, 26 Sep 2012 09:59:56 +0000 (11:59 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Thu, 27 Sep 2012 13:57:30 +0000 (15:57 +0200)
They are part of the public API. Their libav compatibility
counterpart are already enabled unconditionally.

libavfilter/Makefile
libavfilter/allfilters.c
libavfilter/sink_buffer.c

index 3477eca..ed1b9b5 100644 (file)
@@ -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
index b28c024..49f166d 100644 (file)
           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 */
     {
index e34e8e2..8c52c5c 100644 (file)
@@ -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 */