From 3f7bb426078aa9fbd8289459d0adcaea22ab18a2 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Mon, 21 Dec 2009 21:53:03 +0000 Subject: Implement a -pix_fmts option for listing all the supported pixel formats. Originally committed as revision 20909 to svn://svn.ffmpeg.org/ffmpeg/trunk --- cmdutils.c | 5 +++++ cmdutils.h | 6 ++++++ cmdutils_common_opts.h | 1 + doc/fftools-common-opts.texi | 3 +++ 4 files changed, 15 insertions(+) diff --git a/cmdutils.c b/cmdutils.c index 68ef726dd3..176a98daf0 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -582,6 +582,11 @@ void show_filters(void) #endif } +void show_pix_fmts(void) +{ + list_fmts(avcodec_pix_fmt_string, PIX_FMT_NB); +} + int read_yesno(void) { int c = getchar(); diff --git a/cmdutils.h b/cmdutils.h index 40bdea36d1..d2d722b085 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -183,6 +183,12 @@ void show_bsfs(void); */ void show_protocols(void); +/** + * Prints a listing containing all the pixel formats supported by the + * program. + */ +void show_pix_fmts(void); + /** * Returns a positive value if reads from standard input a line * starting with [yY], otherwise returns 0. diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h index 0a456bc1fe..da309977bd 100644 --- a/cmdutils_common_opts.h +++ b/cmdutils_common_opts.h @@ -9,4 +9,5 @@ { "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" }, { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" }, { "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" }, + { "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" }, { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" }, diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi index 60b05009ab..ce8a4d6240 100644 --- a/doc/fftools-common-opts.texi +++ b/doc/fftools-common-opts.texi @@ -46,6 +46,9 @@ Show available protocols. @item -filters Show available libavfilter filters. +@item -pix_fmts +Show available pixel formats. + @item -loglevel @var{loglevel} Set the logging level used by the library. @var{loglevel} is a number or a string containing one of the following values: -- cgit v1.2.3