diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-02-10 18:04:49 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-02-10 18:04:49 +0000 |
commit | d3a4e41c8a15fe1471951ed1a334d24072b9e0c2 (patch) | |
tree | e524304a826b6eca5f0a296b593ef069f59a2951 /libavfilter | |
parent | 243370cb4dec0b1620cf741f71e5225c21060ffd (diff) | |
download | ffmpeg-d3a4e41c8a15fe1471951ed1a334d24072b9e0c2.tar.gz |
Do not hardcode the list of pixel formats and use PIX_FMT_NB instead.
Originally committed as revision 11898 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/formats.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c index bd8ce6258f..4ce1ff70db 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -85,23 +85,17 @@ AVFilterFormats *avfilter_make_format_list(int len, ...) AVFilterFormats *avfilter_all_colorspaces(void) { - return avfilter_make_format_list(35, - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, - PIX_FMT_YUYV422, PIX_FMT_UYVY422, PIX_FMT_UYYVYY411, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, - PIX_FMT_RGB32, PIX_FMT_BGR32, - PIX_FMT_RGB32_1, PIX_FMT_BGR32_1, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565, PIX_FMT_BGR565, - PIX_FMT_RGB555, PIX_FMT_BGR555, - PIX_FMT_RGB8, PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE,PIX_FMT_BGR4_BYTE, - PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, - PIX_FMT_GRAY8, PIX_FMT_PAL8, - PIX_FMT_MONOWHITE,PIX_FMT_MONOBLACK, - PIX_FMT_NV12, PIX_FMT_NV21); + AVFilterFormats *ret; + int i; + + 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; + + return ret; } void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref) |