[FFmpeg-cvslog] avfilter: Refactor unconditional filter registration

Diego Biurrun git at videolan.org
Sat Dec 29 13:24:26 CET 2012


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sun Dec 23 19:06:35 2012 +0100| [69583bd3b1eba471366141c945030c163e073e02] | committer: Diego Biurrun

avfilter: Refactor unconditional filter registration

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69583bd3b1eba471366141c945030c163e073e02
---

 libavfilter/allfilters.c |   36 ++++++++++++------------------------
 1 file changed, 12 insertions(+), 24 deletions(-)

diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index dd05603..5ff8cea 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -27,6 +27,12 @@
           extern AVFilter avfilter_##y##_##x ; \
           if(CONFIG_##X##_FILTER )  avfilter_register(&avfilter_##y##_##x ); }
 
+#define REGISTER_FILTER_UNCONDITIONAL(x)                                \
+    {                                                                   \
+        extern AVFilter avfilter_##x;                                   \
+        avfilter_register(&avfilter_##x);                               \
+    }
+
 void avfilter_register_all(void)
 {
     static int initialized;
@@ -101,28 +107,10 @@ void avfilter_register_all(void)
 
     /* those filters are part of public or internal API => registered
      * unconditionally */
-    {
-        extern AVFilter avfilter_vsrc_buffer;
-        avfilter_register(&avfilter_vsrc_buffer);
-    }
-    {
-        extern AVFilter avfilter_asrc_abuffer;
-        avfilter_register(&avfilter_asrc_abuffer);
-    }
-    {
-        extern AVFilter avfilter_vsink_buffer;
-        avfilter_register(&avfilter_vsink_buffer);
-    }
-    {
-        extern AVFilter avfilter_asink_abuffer;
-        avfilter_register(&avfilter_asink_abuffer);
-    }
-    {
-        extern AVFilter avfilter_af_afifo;
-        avfilter_register(&avfilter_af_afifo);
-    }
-    {
-        extern AVFilter avfilter_vf_fifo;
-        avfilter_register(&avfilter_vf_fifo);
-    }
+    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);
 }



More information about the ffmpeg-cvslog mailing list