diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2007-05-30 14:20:55 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2007-05-30 14:20:55 +0000 |
commit | c3b95b1d3d506da97faa83b5a866ca605cb57316 (patch) | |
tree | 7d136740f20f4c2bb51001d73b5c53a82aff50c1 /libavcodec/imgconvert.c | |
parent | 808d83fd33c2c58d66f086fca689b9d6d46c5f2f (diff) | |
download | ffmpeg-streaming-c3b95b1d3d506da97faa83b5a866ca605cb57316.zip ffmpeg-streaming-c3b95b1d3d506da97faa83b5a866ca605cb57316.tar.gz |
Add support for listing the supported pixel formats using the option
-pix_fmt list
patch by Stefano Sabatini stefano sabatini minus lala chez poste it
original thread: [FFmpeg-devel] [PATCH] List supported pixel formats
date: 05/25/2007 05:46 PM
Originally committed as revision 9162 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r-- | libavcodec/imgconvert.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index b72d0ee..7fe88c8 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -378,6 +378,27 @@ enum PixelFormat avcodec_get_pix_fmt(const char* name) return i; } +void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt) +{ + PixFmtInfo info= pix_fmt_info[pix_fmt]; + + char is_alpha_char= info.is_alpha ? 'y' : 'n'; + + /* print header */ + if (pix_fmt < 0) + snprintf (buf, buf_size, + "name " " nb_channels" " depth" " is_alpha" + ); + else + snprintf (buf, buf_size, + "%-10s" " %1d " " %2d " " %c ", + info.name, + info.nb_channels, + info.depth, + is_alpha_char + ); +} + int avpicture_fill(AVPicture *picture, uint8_t *ptr, int pix_fmt, int width, int height) { |