summaryrefslogtreecommitdiff
path: root/fftools/ffprobe.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-12-15 08:50:26 +0100
committerAnton Khirnov <anton@khirnov.net>2023-12-22 11:39:57 +0100
commitd2e479a4296b1b3009a1e127ecddac5d550095e1 (patch)
tree62dcd815e91c221a9b88cfa414bea52e1d42e0b2 /fftools/ffprobe.c
parent074abeb57e210d7a13ac89026af2a3f0636c2907 (diff)
fftools: split off option types from other flags
These values are not actually flags, as only one of them can be meaningfully set.
Diffstat (limited to 'fftools/ffprobe.c')
-rw-r--r--fftools/ffprobe.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 9968603e76..57e55e8a0b 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3716,7 +3716,7 @@ static int opt_show_optional_fields(void *optctx, const char *opt, const char *a
if (show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO && av_strcasecmp(arg, "auto")) {
double num;
- int ret = parse_number("show_optional_fields", arg, OPT_INT,
+ int ret = parse_number("show_optional_fields", arg, OPT_TYPE_INT,
SHOW_OPTIONAL_FIELDS_AUTO, SHOW_OPTIONAL_FIELDS_ALWAYS, &num);
if (ret < 0)
return ret;
@@ -4078,50 +4078,50 @@ DEFINE_OPT_SHOW_SECTION(programs, PROGRAMS)
static const OptionDef real_options[] = {
CMDUTILS_COMMON_OPTIONS
- { "f", HAS_ARG, {.func_arg = opt_format}, "force format", "format" },
- { "unit", OPT_BOOL, {&show_value_unit}, "show unit of the displayed values" },
- { "prefix", OPT_BOOL, {&use_value_prefix}, "use SI prefixes for the displayed values" },
- { "byte_binary_prefix", OPT_BOOL, {&use_byte_value_binary_prefix},
+ { "f", OPT_TYPE_FUNC, HAS_ARG, {.func_arg = opt_format}, "force format", "format" },
+ { "unit", OPT_TYPE_BOOL, 0, {&show_value_unit}, "show unit of the displayed values" },
+ { "prefix", OPT_TYPE_BOOL, 0, {&use_value_prefix}, "use SI prefixes for the displayed values" },
+ { "byte_binary_prefix", OPT_TYPE_BOOL, 0, {&use_byte_value_binary_prefix},
"use binary prefixes for byte units" },
- { "sexagesimal", OPT_BOOL, {&use_value_sexagesimal_format},
+ { "sexagesimal", OPT_TYPE_BOOL, 0, {&use_value_sexagesimal_format},
"use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
- { "pretty", 0, {.func_arg = opt_pretty},
+ { "pretty", OPT_TYPE_FUNC, 0, {.func_arg = opt_pretty},
"prettify the format of displayed values, make it more human readable" },
- { "output_format", OPT_STRING, { &output_format },
+ { "output_format", OPT_TYPE_STRING, 0, { &output_format },
"set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)", "format" },
- { "print_format", OPT_STRING, { &output_format }, "alias for -output_format (deprecated)" },
- { "of", OPT_STRING, { &output_format }, "alias for -output_format", "format" },
- { "select_streams", OPT_STRING, { &stream_specifier }, "select the specified streams", "stream_specifier" },
- { "sections", OPT_EXIT, {.func_arg = opt_sections}, "print sections structure and section information, and exit" },
- { "show_data", OPT_BOOL, { &do_show_data }, "show packets data" },
- { "show_data_hash", OPT_STRING, { &show_data_hash }, "show packets data hash" },
- { "show_error", 0, { .func_arg = &opt_show_error }, "show probing error" },
- { "show_format", 0, { .func_arg = &opt_show_format }, "show format/container info" },
- { "show_frames", 0, { .func_arg = &opt_show_frames }, "show frames info" },
- { "show_entries", HAS_ARG, {.func_arg = opt_show_entries},
+ { "print_format", OPT_TYPE_STRING, 0, { &output_format }, "alias for -output_format (deprecated)" },
+ { "of", OPT_TYPE_STRING, 0, { &output_format }, "alias for -output_format", "format" },
+ { "select_streams", OPT_TYPE_STRING, 0, { &stream_specifier }, "select the specified streams", "stream_specifier" },
+ { "sections", OPT_TYPE_FUNC, OPT_EXIT, {.func_arg = opt_sections}, "print sections structure and section information, and exit" },
+ { "show_data", OPT_TYPE_BOOL, 0, { &do_show_data }, "show packets data" },
+ { "show_data_hash", OPT_TYPE_STRING, 0, { &show_data_hash }, "show packets data hash" },
+ { "show_error", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_error }, "show probing error" },
+ { "show_format", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_format }, "show format/container info" },
+ { "show_frames", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_frames }, "show frames info" },
+ { "show_entries", OPT_TYPE_FUNC, HAS_ARG, {.func_arg = opt_show_entries},
"show a set of specified entries", "entry_list" },
#if HAVE_THREADS
- { "show_log", OPT_INT, { &do_show_log }, "show log" },
+ { "show_log", OPT_TYPE_INT, 0, { &do_show_log }, "show log" },
#endif
- { "show_packets", 0, { .func_arg = &opt_show_packets }, "show packets info" },
- { "show_programs", 0, { .func_arg = &opt_show_programs }, "show programs info" },
- { "show_streams", 0, { .func_arg = &opt_show_streams }, "show streams info" },
- { "show_chapters", 0, { .func_arg = &opt_show_chapters }, "show chapters info" },
- { "count_frames", OPT_BOOL, { &do_count_frames }, "count the number of frames per stream" },
- { "count_packets", OPT_BOOL, { &do_count_packets }, "count the number of packets per stream" },
- { "show_program_version", 0, { .func_arg = &opt_show_program_version }, "show ffprobe version" },
- { "show_library_versions", 0, { .func_arg = &opt_show_library_versions }, "show library versions" },
- { "show_versions", 0, { .func_arg = &opt_show_versions }, "show program and library versions" },
- { "show_pixel_formats", 0, { .func_arg = &opt_show_pixel_formats }, "show pixel format descriptions" },
- { "show_optional_fields", HAS_ARG, { .func_arg = &opt_show_optional_fields }, "show optional fields" },
- { "show_private_data", OPT_BOOL, { &show_private_data }, "show private data" },
- { "private", OPT_BOOL, { &show_private_data }, "same as show_private_data" },
- { "bitexact", OPT_BOOL, {&do_bitexact}, "force bitexact output" },
- { "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" },
- { "i", HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"},
- { "o", HAS_ARG, {.func_arg = opt_output_file_o}, "write to specified output", "output_file"},
- { "print_filename", HAS_ARG, {.func_arg = opt_print_filename}, "override the printed input filename", "print_file"},
- { "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info },
+ { "show_packets", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_packets }, "show packets info" },
+ { "show_programs", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_programs }, "show programs info" },
+ { "show_streams", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_streams }, "show streams info" },
+ { "show_chapters", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_chapters }, "show chapters info" },
+ { "count_frames", OPT_TYPE_BOOL, 0, { &do_count_frames }, "count the number of frames per stream" },
+ { "count_packets", OPT_TYPE_BOOL, 0, { &do_count_packets }, "count the number of packets per stream" },
+ { "show_program_version", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_program_version }, "show ffprobe version" },
+ { "show_library_versions", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_library_versions }, "show library versions" },
+ { "show_versions", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_versions }, "show program and library versions" },
+ { "show_pixel_formats", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_pixel_formats }, "show pixel format descriptions" },
+ { "show_optional_fields", OPT_TYPE_FUNC, HAS_ARG, { .func_arg = &opt_show_optional_fields }, "show optional fields" },
+ { "show_private_data", OPT_TYPE_BOOL, 0, { &show_private_data }, "show private data" },
+ { "private", OPT_TYPE_BOOL, 0, { &show_private_data }, "same as show_private_data" },
+ { "bitexact", OPT_TYPE_BOOL, 0, {&do_bitexact}, "force bitexact output" },
+ { "read_intervals", OPT_TYPE_FUNC, HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" },
+ { "i", OPT_TYPE_FUNC, HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"},
+ { "o", OPT_TYPE_FUNC, HAS_ARG, {.func_arg = opt_output_file_o}, "write to specified output", "output_file"},
+ { "print_filename", OPT_TYPE_FUNC, HAS_ARG, {.func_arg = opt_print_filename}, "override the printed input filename", "print_file"},
+ { "find_stream_info", OPT_TYPE_BOOL, OPT_INPUT | OPT_EXPERT, { &find_stream_info },
"read and decode the streams to fill missing information with heuristics" },
{ NULL, },
};