From 8447f0bd74e979da5a0ba02e3c2d1abf02f9e6ec Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 19 Nov 2009 16:35:55 +0000 Subject: Split show_formats(). Originally committed as revision 20553 to svn://svn.ffmpeg.org/ffmpeg/trunk --- cmdutils.c | 32 +++++++++++++++++++++----------- cmdutils.h | 18 ++++++++++++++++++ ffmpeg.c | 5 ++++- ffplay.c | 5 ++++- ffserver.c | 5 ++++- 5 files changed, 51 insertions(+), 14 deletions(-) diff --git a/cmdutils.c b/cmdutils.c index 37b8e6e..5ed8919 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -417,9 +417,6 @@ void show_formats(void) { AVInputFormat *ifmt=NULL; AVOutputFormat *ofmt=NULL; - URLProtocol *up=NULL; - AVCodec *p=NULL, *p2; - AVBitStreamFilter *bsf=NULL; const char *last_name; printf( @@ -463,8 +460,12 @@ void show_formats(void) name, long_name ? long_name:" "); } - printf("\n"); +} +void show_codecs(void) +{ + AVCodec *p=NULL, *p2; + const char *last_name; printf( "Codecs:\n" " D..... = Decoding supported\n" @@ -529,11 +530,27 @@ void show_formats(void) printf("\n"); } printf("\n"); + printf( +"Note, the names of encoders and decoders do not always match, so there are\n" +"several cases where the above table shows encoder only or decoder only entries\n" +"even though both encoding and decoding are supported. For example, the h263\n" +"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n" +"worse.\n"); +} + +void show_bsfs(void) +{ + AVBitStreamFilter *bsf=NULL; printf("Bitstream filters:\n"); while((bsf = av_bitstream_filter_next(bsf))) printf("%s\n", bsf->name); printf("\n"); +} + +void show_protocols(void) +{ + URLProtocol *up=NULL; printf("Supported file protocols:\n"); while((up = av_protocol_next(up))) @@ -541,13 +558,6 @@ void show_formats(void) printf("\n"); printf("Frame size, frame rate abbreviations:\n ntsc pal qntsc qpal sntsc spal film ntsc-film sqcif qcif cif 4cif\n"); - printf("\n"); - printf( -"Note, the names of encoders and decoders do not always match, so there are\n" -"several cases where the above table shows encoder only or decoder only entries\n" -"even though both encoding and decoding are supported. For example, the h263\n" -"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n" -"worse.\n"); } int read_yesno(void) diff --git a/cmdutils.h b/cmdutils.h index 826f000..efc8d02 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -158,6 +158,24 @@ void show_license(void); void show_formats(void); /** + * Prints a listing containing all the codecs supported by the + * program. + */ +void show_codecs(void); + +/** + * Prints a listing containing all the bit stream filters supported by the + * program. + */ +void show_bsfs(void); + +/** + * Prints a listing containing all the protocols supported by the + * program. + */ +void show_protocols(void); + +/** * Returns a positive value if reads from standard input a line * starting with [yY], otherwise returns 0. */ diff --git a/ffmpeg.c b/ffmpeg.c index 4d50768..5d6d994 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3828,7 +3828,10 @@ static const OptionDef options[] = { { "L", OPT_EXIT, {(void*)show_license}, "show license" }, { "h", OPT_EXIT, {(void*)show_help}, "show help" }, { "version", OPT_EXIT, {(void*)show_version}, "show version" }, - { "formats", OPT_EXIT, {(void*)show_formats}, "show available formats, codecs, protocols, ..." }, + { "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" }, + { "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" }, + { "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" }, + { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" }, { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" }, { "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" }, { "y", OPT_BOOL, {(void*)&file_overwrite}, "overwrite output files" }, diff --git a/ffplay.c b/ffplay.c index 45d7586..b8912e1 100644 --- a/ffplay.c +++ b/ffplay.c @@ -2456,7 +2456,10 @@ static const OptionDef options[] = { { "h", OPT_EXIT, {(void*)show_help}, "show help" }, { "version", OPT_EXIT, {(void*)show_version}, "show version" }, { "L", OPT_EXIT, {(void*)show_license}, "show license" }, - { "formats", OPT_EXIT, {(void*)show_formats}, "show available formats, codecs, protocols, ..." }, + { "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" }, + { "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" }, + { "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" }, + { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" }, { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", "width" }, { "y", HAS_ARG | OPT_FUNC2, {(void*)opt_height}, "force displayed height", "height" }, { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" }, diff --git a/ffserver.c b/ffserver.c index da45cfa..7abaed8 100644 --- a/ffserver.c +++ b/ffserver.c @@ -4475,7 +4475,10 @@ static const OptionDef options[] = { { "h", OPT_EXIT, {(void*)opt_show_help}, "show help" }, { "version", OPT_EXIT, {(void*)show_version}, "show version" }, { "L", OPT_EXIT, {(void*)show_license}, "show license" }, - { "formats", OPT_EXIT, {(void*)show_formats}, "show available formats, codecs, protocols, ..." }, + { "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" }, + { "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" }, + { "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" }, + { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" }, { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" }, { "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" }, { "d", 0, {(void*)opt_debug}, "enable debug mode" }, -- cgit v1.1