[FFmpeg-cvslog] r21009 - trunk/libavfilter/formats.c

stefano subversion
Mon Jan 4 01:08:11 CET 2010


Author: stefano
Date: Mon Jan  4 01:08:11 2010
New Revision: 21009

Log:
Make avfilter_all_colorspaces() add to the returned list of pixel
formats only the non-HW-accelerated formats, for which there is no
sense in filtering.

Modified:
   trunk/libavfilter/formats.c

Modified: trunk/libavfilter/formats.c
==============================================================================
--- trunk/libavfilter/formats.c	Sun Jan  3 23:29:18 2010	(r21008)
+++ trunk/libavfilter/formats.c	Mon Jan  4 01:08:11 2010	(r21009)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/pixdesc.h"
 #include "avfilter.h"
 
 /**
@@ -101,14 +102,12 @@ int avfilter_add_colorspace(AVFilterForm
 AVFilterFormats *avfilter_all_colorspaces(void)
 {
     AVFilterFormats *ret;
-    int i;
+    enum PixelFormat pix_fmt;
 
     ret = av_mallocz(sizeof(AVFilterFormats));
-    ret->formats = av_malloc(sizeof(*ret->formats) * PIX_FMT_NB);
-    ret->format_count = PIX_FMT_NB;
-
-    for(i = 0; i < PIX_FMT_NB; i ++)
-        ret->formats[i] = i;
+    for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)
+        if (!(av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL))
+            avfilter_add_colorspace(ret, pix_fmt);
 
     return ret;
 }



More information about the ffmpeg-cvslog mailing list