summaryrefslogtreecommitdiff
path: root/fftools/cmdutils.c
Commit message (Collapse)AuthorAge
* fftools/ffmpeg: rewrite checking whether codec AVOptions have been usedAnton Khirnov14 days
| | | | | | Share the code between encoding and decoding. Instead of checking every stream's options dictionary (which is also used for other purposes), track all used options in a dedicated dictionary.
* fftools/cmdutils: Add protective () to FLAGSMichael Niedermayer2024-06-07
| | | | | | | issue found while reviewing CID1452612 Free of array-typed value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fftools: move check_avoptions and remove_avoptions to cmdutilsMarton Balint2024-05-27
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools: Fix implicit-const-int-float-conversion warningZhao Zhili2024-04-23
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-31
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: do not use a random codec's private optionsAnton Khirnov2024-03-28
| | | | | | | There is only a single caller of filter_codec_opts() that passes a NULL codec to it, which is streamcopy in ffmpeg CLI. In that case we only want generic AVCodecContext options, not private options of any specific encoder.
* fftools/ffmpeg: add loopback decodingAnton Khirnov2024-03-13
| | | | | This allows to send an encoder's output back to decoding and feed the result into a complex filtergraph.
* fftools/cmdutils: fix printing group name in split_commandline()Anton Khirnov2024-03-13
|
* fftools/cmdutils: Inline print_error()Andreas Rheinhardt2024-03-04
| | | | | | | | It is only used by ffprobe (once) and ffplay (twice); inlining it avoids including it unnecessarily into ffmpeg. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: remove harmful variable shadowingAnton Khirnov2024-02-24
| | | | It causes write_option() to return 0 when calling func_arg() fails.
* fftools/cmdutils: Don't cast const awayAndreas Rheinhardt2024-02-09
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: surround option arguments by <> in help outputAnton Khirnov2024-01-20
| | | | Makes it more clear that they are placeholders for actual values.
* fftools/cmdutils: indicate specifiers in option syntax in help outputAnton Khirnov2024-01-20
|
* fftools/cmdutils: drop alt_flags parameter from show_help_options()Anton Khirnov2024-01-20
| | | | | No user sets it to more than one flag, so it is redundant with req_flags.
* fftools/cmdutils: add option syntax for loading arbitrary arguments from a fileAnton Khirnov2024-01-20
| | | | Aligned with analogous feature for filter options in ffmpeg CLI.
* fftools/ffmpeg: improve WARN_MULTIPLE_OPT_USAGE()Anton Khirnov2023-12-22
| | | | | | | | | | | | Currently it requires every single OPT_SPEC option to be accompanied by an array of alternate names for this option. The vast majority of options have no alternate names, resulting in a large numbers of unnecessary single-element arrays that merely contain the option name. Extend the option parsing API to allow marking options as having alternate names, or as being the canonical name for some existing alternatives. Use this new information to avoid the need for abovementioned unnecessary single-element arrays.
* fftools/ffmpeg: change the MATCH_PER_TYPE_OPT macro into a functionAnton Khirnov2023-12-22
| | | | | There is no reason for it to be a macro anymore, this makes the code using it cleaner and simpler.
* fftools/cmdutils: add a struct for a list of SpecifierOptAnton Khirnov2023-12-22
| | | | Significantly simplifies the code dealing with OPT_SPEC.
* fftools/cmdutils: check valid flags for OPT_TYPE_FUNCAnton Khirnov2023-12-22
| | | | SPEC and OFFSET do not make sense for functions.
* fftools/cmdutils: include OPT_PERFILE in OPT_OFFSETAnton Khirnov2023-12-22
| | | | | And analogously OPT_OFFSET in OPT_SPEC. Previously the inclusion would be implicit and required all code to remember this.
* fftools/cmdutils: rename HAS_ARG to OPT_FUNC_ARGAnton Khirnov2023-12-22
| | | | | For consistent namespacing with other option flags. Also, document and enforce that it can only be set for func-type options.
* fftools: split off option types from other flagsAnton Khirnov2023-12-22
| | | | | These values are not actually flags, as only one of them can be meaningfully set.
* fftools/cmdutils: simplify handling of the HAS_ARG option flagAnton Khirnov2023-12-22
| | | | | | | | | | This option flag only carries nontrivial information for options that call a function, in all other cases its presence can be inferred from the option type (bool options do not have arguments, all other types do) and is thus nothing but useless clutter. Change the option parsing code to infer its value when it can, and drop the flag from options where it's not needed.
* fftools/cmdutils: only set array size after allocation succeededAnton Khirnov2023-11-09
|
* fftools/ffmpeg: stop calling exit_program()Anton Khirnov2023-07-20
| | | | Remove exit_program() and register_exit(), as they are no longer used.
* fftools/opt_common: replace report_and_exit() with returning an error codeAnton Khirnov2023-07-20
| | | | Remove report_and_exit(), as it has no more users.
* fftools/cmdutils: return AVERROR_EXIT for OPT_EXIT options instead of aborting()Anton Khirnov2023-07-20
|
* fftools/cmdutils: add error handling to filter_codec_opts()Anton Khirnov2023-07-20
|
* fftools/cmdutils: constify the first parameter of filter_codec_opts()Anton Khirnov2023-07-20
|
* fftools: handle errors in parse_options()Anton Khirnov2023-07-20
|
* fftools: remove parse_time_or_die()Anton Khirnov2023-07-20
| | | | | Replace it with calling av_parse_time() directly, which provides graceful error handling and more accurate error messages.
* fftools: return errors from parse_number_or_die() instead of abortingAnton Khirnov2023-07-20
| | | | Rename the function to just parse_number().
* fftools/cmdutils: add error handling to GROW_ARRAY()Anton Khirnov2023-07-20
|
* fftools/cmdutils: add error handling to grow_array()Anton Khirnov2023-07-20
|
* fftools/cmdutils: add error handling to allocate_array_elem()Anton Khirnov2023-07-20
|
* fftools/cmdutils: return error codes from setup_find_stream_info_opts() ↵Anton Khirnov2023-07-20
| | | | instead of aborting
* fftools/cmdutils: constify the argument of get_rotation()Anton Khirnov2023-05-22
|
* fftools: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: Use av_err2strMarvin Scholz2022-10-14
| | | | | | | | | av_err2str which is a wrapper for av_strerror already calls strerror_r if available and if not has a fallback for the other error codes that would be handled by that, so manually calling strerror again if it fails is not necessary. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* fftools: Use report_error_then_exit_program() for allocation failuresAndreas Rheinhardt2022-09-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: Add function to report error before exitAndreas Rheinhardt2022-09-01
| | | | | | | | | | | | This is designed to improve and unify error handling for allocation failures for the many (often small) allocations that we have in the fftools. These typically either don't return an error message or an error message that is not really helpful to the user and can be replaced by a generic error message without loss of information. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools: Fix preset search pathesNicolas Gaullier2022-07-08
| | | | | | | | | regression since 13350e81fd Fix looking for .ffmpeg subfolder in FFMPEG_DATADIR and inversely not in HOME. Fix search order (documentation). Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* fftools: Remove MAX_PATH limit and switch to UTF-8 versions of fopen() and ↵Nil Admirari2022-06-21
| | | | | | getenv() Signed-off-by: Martin Storsjö <martin@martin.st>
* fftools/cmdutils: drop redundant codeAnton Khirnov2022-03-22
| | | | | | | It allocates a dummy sws/swr context and tries setting options on it, apparently to check if they are valid. This is redundant, since the options will be checked if/when they are later applied on a context that is actually used for conversion.
* fftools: drop the fake "default" option from ffplay/ffprobeAnton Khirnov2022-03-22
| | | | | | It tries to process any unhandled options as AVOptions. Handle this directly in cmdutils.c, without resorting to a confusing fake option definition (which is currently visible to the users in -help output).
* fftools: move opt_timelimit from cmdutils to ffmpegAnton Khirnov2022-03-22
| | | | This option is only supported by ffmpeg.
* fftools/cmdutils: split common option handlers into their own fileAnton Khirnov2022-03-22
|
* fftools: drop useless indirectionAnton Khirnov2022-03-22
|
* libavfilter: Split version.hMartin Storsjö2022-03-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* libswscale: Split version.hMartin Storsjö2022-03-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>