Factorize common commandline options definition.

Originally committed as revision 20664 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Stefano Sabatini 2009-11-29 23:12:19 +00:00
parent 587edd6af8
commit 992f8eaee7
4 changed files with 12 additions and 25 deletions

8
cmdutils_common_opts.h Normal file
View File

@ -0,0 +1,8 @@
{ "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" , 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" },

View File

@ -3821,13 +3821,7 @@ static int opt_preset(const char *opt, const char *arg)
static const OptionDef options[] = {
/* main 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" , 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" },
#include "cmdutils_common_opts.h"
{ "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" },
@ -3851,7 +3845,6 @@ static const OptionDef options[] = {
{ "loop_input", OPT_BOOL | OPT_EXPERT, {(void*)&loop_input}, "loop (current only works with images)" },
{ "loop_output", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&loop_output}, "number of times to loop output in formats that support looping (0 loops forever)", "" },
{ "v", HAS_ARG | OPT_FUNC2, {(void*)opt_verbose}, "set ffmpeg verbosity level", "number" },
{ "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ "target", HAS_ARG, {(void*)opt_target}, "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" },
{ "threads", OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
{ "vsync", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&video_sync_method}, "video sync method", "" },

View File

@ -2453,13 +2453,7 @@ static int opt_thread_count(const char *opt, const char *arg)
}
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" , 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" },
#include "cmdutils_common_opts.h"
{ "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" },
@ -2491,7 +2485,6 @@ static const OptionDef options[] = {
{ "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
{ "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
{ "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ NULL, },
};

View File

@ -4463,7 +4463,7 @@ static void opt_debug(void)
logfilename[0] = '-';
}
static void opt_show_help(void)
static void show_help(void)
{
printf("usage: ffserver [options]\n"
"Hyper fast multi format Audio/Video streaming server\n");
@ -4472,14 +4472,7 @@ static void opt_show_help(void)
}
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" , 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" },
#include "cmdutils_common_opts.h"
{ "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
{ "d", 0, {(void*)opt_debug}, "enable debug mode" },
{ "f", HAS_ARG | OPT_STRING, {(void*)&config_filename }, "use configfile instead of /etc/ffserver.conf", "configfile" },