diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-01-04 00:08:11 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-01-04 00:08:11 +0000 |
commit | 5ff84183de1addfeacfa095e88b0f5c62916d9e2 (patch) | |
tree | 83f4f613a172d1f815649254843e669a647fa908 /libavfilter/formats.c | |
parent | a2b1662741a50147b11b696e0a317633f8238bff (diff) | |
download | ffmpeg-5ff84183de1addfeacfa095e88b0f5c62916d9e2.tar.gz |
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.
Originally committed as revision 21009 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/formats.c')
-rw-r--r-- | libavfilter/formats.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 0b0311087a..a289a1233d 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -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(AVFilterFormats *avff, enum PixelFormat pix_fmt) 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; } |