summaryrefslogtreecommitdiff
path: root/libavutil/opt.c
Commit message (Collapse)AuthorAge
* avutil/opt: add missing case for AV_OPT_TYPE_CHLAYOUT in av_opt_free()James Almer2022-03-18
| | | | | | Fixes potential memleaks for existing options of this type. Signed-off-by: James Almer <jamrial@gmail.com>
* lavu: support AVChannelLayout AVOptionsAnton Khirnov2022-03-15
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/opt: fix mis-alignment of option and constant values for filter helpSoft Works2021-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before: overlay AVOptions: x <string> ..FV....... set the x expression (default "0") y <string> ..FV....... set the y expression (default "0") eof_action <int> ..FV....... Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat) repeat 0 ..FV....... Repeat the previous frame. endall 1 ..FV....... End both streams. pass 2 ..FV....... Pass through the main input. eval <int> ..FV....... specify when to evaluate expressions (from 0 to 1) (default frame) After: a overlay AVOptions: x <string> ..FV....... set the x expression (default "0") y <string> ..FV....... set the y expression (default "0") eof_action <int> ..FV....... Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat) repeat 0 ..FV....... Repeat the previous frame. endall 1 ..FV....... End both streams. pass 2 ..FV....... Pass through the main input. eval <int> ..FV....... specify when to evaluate expressions (from 0 to 1) (default frame) Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/opt: handle whole range of int64_t in av_opt_get_intZhao Zhili2021-11-11
| | | | | | | Make get_int/set_int symetric. The int64_t to double to int64_t conversion is unprecise for large value. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: Remove outdated version checkAndreas Rheinhardt2021-09-27
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/opt: Simplify av_opt_set_dict2()Andreas Rheinhardt2021-09-20
| | | | | | Make it clearer that the ordinary exit always returns 0. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/opt: Also warn for deprecated named constantsAndreas Rheinhardt2021-09-20
| | | | | | Intended for the "truncated" AVCodecContext flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/opt: Check directly for av_dict_copy() failureAndreas Rheinhardt2021-06-08
| | | | | | av_dict_copy() returned void when this code was written. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: remove deprecated AVClass.child_class_nextJames Almer2021-04-27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/opt: add AV_OPT_FLAG_DEPRECATED optionLimin Wang2020-12-05
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/opt: check return value of av_bprint_finalize()Limin Wang2020-07-02
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/opt: add a more general child class iteration APIAnton Khirnov2020-06-10
| | | | | | | Use opaque iteration state instead of the previous child class. This mirrors similar changes done in lavf/lavc. Deprecate the av_opt_child_class_next() API.
* avutil/opt: add AV_OPT_FLAG_CHILD_CONSTSMarton Balint2020-05-22
| | | | | | | | This will be used for AVCodecContext->profile. By specifying constants in the encoders we won't have to use the common AVCodecContext options table and different encoders can use the same profile name even with different values. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/opt: only skip evaluation for rational optionsMarton Balint2020-05-01
| | | | | | | | | | | | Fixes problems when non-rational options were set using rational expressions, causing rounding errors and the option range limits not to be enforced properly. ffmpeg -f lavfi -i "sine=r=96000/2" This caused an assertion failure with assert level 2. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/opt: Don't use NULL for %s string in a log messageAndreas Rheinhardt2020-04-01
| | | | | | | | | | | | | | | If one calls av_opt_set() with an incorrect string to set the value of an option of type AV_OPT_TYPE_VIDEO_RATE, the given string is used in a log message via %s. This also happens when the string is actually a nullpointer in which case using it for %s is forbidden. This commit changes this by erroring out early in case of a nullpointer. This also fixes a warning from GCC 9.2: "‘%s’ directive argument is null [-Wformat-overflow=]" Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavutil/opt: fix memory leak after av_dict_parse_string failJun Zhao2020-01-04
| | | | | | | | | In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/opt: add full support for AV_OPT_TYPE_DICTMarton Balint2019-12-27
| | | | | | | Now it is possible to set them from a string, to serialize them and to use a default value. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/opt: print runtime flag tooPaul B Mahol2019-10-14
|
* avutil/opt: Fix type specifierAndreas Rheinhardt2019-09-22
| | | | | | | | This bug has been introduced in 9e0a071e. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: Print out numeric values of option constantsSoft Works2019-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's often not obvious how option constants relate to numerical values. Defaults are sometimes printed as numbers and from/to are always printed as numbers. Printing the numeric values of options constants avoids this confusion. It also allows to see which constants are equivalent. Before this patch: -segment_list_type <int> E........ set the segment list type (from -1 to 4) (default -1) flat E........ flat format csv E........ csv format ext E........ extended format ffconcat E........ ffconcat format m3u8 E........ M3U8 format hls E........ Apple HTTP Live Streaming compatible Afterwards: -segment_list_type <int> E........ set the segment list type (from -1 to 4) (default -1) flat 0 E........ flat format csv 1 E........ csv format ext 3 E........ extended format ffconcat 4 E........ ffconcat format m3u8 2 E........ M3U8 format hls 2 E........ Apple HTTP Live Streaming compatible Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: Fix printing integer option defaultsSoft Works2019-09-20
| | | | | | | | | | | | | Integer values should not be printed using format specifier '%g' which leads to inexact display in case of higher values. Before this patch: -trans_color <int> .D.V..... color value [...] (default 1.67772e+07) Afterwards: -trans_color <int> .D.V..... color value [...] (default 16777215) Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: check for minimum and maximum values when setting ↵Marton Balint2018-10-07
| | | | | | AV_OPT_TYPE_DURATION fields Signed-off-by: Marton Balint <cus@passwd.hu>
* lavu/opt: add AV_OPT_FLAG_DEPRECATEDClément Bœsch2018-04-26
|
* lavu/opt: add bit stream filter option dump support.Jun Zhao2018-03-16
| | | | | | | enable dump bit stream filter and update opt fate test ref. Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/opt: Use "&&" instead of "*" in boolean expression.Carl Eugen Hoyos2017-10-08
| | | | | Fixes the following warning: libavutil/opt.c:101:47: warning: '*' in boolean context, suggest '&&' instead
* Merge commit '67351924fa91dea4339109100a4c0689f006581f'Clément Bœsch2017-03-30
|\ | | | | | | | | | | | | * commit '67351924fa91dea4339109100a4c0689f006581f': Drop unreachable break and return statements Merged-by: Clément Bœsch <cboesch@gopro.com>
| * Drop unreachable break and return statementsDiego Biurrun2016-11-03
| |
* | opt: reject denominator zero as out of rangeAndreas Cadhalpun2016-12-13
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avutil/opt: Add AV_OPT_TYPE_UINT64Michael Niedermayer2016-11-23
| | | | | | | | | | | | | | Requested-by: wm4 ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64) Requested-by: ronald ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64) Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/opt: Fix setting int64 to its maximumMichael Niedermayer2016-11-20
| | | | | | | | | | | | Found-by: Andreas Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/opt: Fix max/min checking in av_opt_set() for AV_OPT_TYPE_VIDEO_RATEMichael Niedermayer2016-06-09
| | | | | | | | | | | | Fixes Ticket5618 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-11
|\| | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * build: Split test programs off into separate filesDiego Biurrun2016-04-07
| | | | | | | | | | This avoids spurious library rebuilds when only the test program code is changed and simplifies the build system.
* | libavutil/opt: add writing AV_OPT_TYPE_VIDEO_RATE AVOptionPrzemysław Sobala2016-05-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/parsing: add '\r' as whitespaceMuhammad Faiz2016-05-06
| | | | | | | | | | | | | | for compatibility with platforms that treat it as newline Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* | Merge commit '3b08d9d932eef09403074d5af31e10d8011e840b'Derek Buitenhuis2016-04-21
|\| | | | | | | | | | | | | * commit '3b08d9d932eef09403074d5af31e10d8011e840b': testprogs: K&R formatting cosmetics Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * testprogs: K&R formatting cosmeticsDiego Biurrun2016-03-24
| |
* | Merge commit '564b4591bbe223bdc5f36a1131eaef103f23f5d0'Derek Buitenhuis2016-04-19
|\| | | | | | | | | | | | | * commit '564b4591bbe223bdc5f36a1131eaef103f23f5d0': opt: Add av_opt_copy() Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * opt: Add av_opt_copy()Michael Niedermayer2016-03-24
| | | | | | | | | | | | | | This includes documentation and other modifications by Lukasz Marek and Martin Storsjö. Signed-off-by: Martin Storsjö <martin@martin.st>
| * opt: Add const to av_opt_nextLukasz Marek2016-03-24
| | | | | | | | | | | | | | Also add const to pointers in static functions within opt.c where possible/necessary. Signed-off-by: Martin Storsjö <martin@martin.st>
| * opt-test: Merge struct declaration and initializationDiego Biurrun2016-03-23
| |
| * opt-test: Move some variable declarations to avoid block bracesDiego Biurrun2016-03-23
| |
* | avutil/opt: check for and handle errors in av_opt_set_dict2()Michael Niedermayer2016-01-26
| | | | | | | | | | | | Previously errors could result in random entries to be lost. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavu/opt: enhance printing durations.Nicolas George2015-11-07
| | | | | | | | | | | | | | Trim unneeded leading components and trailing zeros. Move the formating code in a separate function. Use the function also to format the default value, it was currently printed as plain integer, inconsistent to the way it is parsed.
* | avutil/opt: print more meaningful default flags valuesClément Bœsch2015-10-25
| | | | | | | | | | | | | | | | | | | | Example: % ./ffmpeg -h encoder=gif [...] GIF encoder AVOptions: -gifflags <flags> E..V.... set GIF flags (default offsetting+transdiff) offsetting E..V.... enable picture offsetting transdiff E..V.... enable transparency detection between frames
* | avutil/opt: display a better default value for int/int64 optionsClément Bœsch2015-10-19
| | | | | | | | | | | | | | | | | | | | | | | | Example: % ./ffmpeg -h encoder=aac -aac_coder <int> E...A... Coding algorithm (from -1 to 3) (default twoloop) faac E...A... FAAC-inspired method anmr E...A... ANMR method twoloop E...A... Two loop searching method fast E...A... Constant quantizer [...]
* | lavu/opt: add flag to return NULL when applicable in av_opt_getRodger Combs2015-10-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/opt: refactor pixel/sample fmt common caseClément Bœsch2015-09-08
| |
* | avutil/opt: add AV_OPT_TYPE_BOOLClément Bœsch2015-09-08
| |
* | lavu: Drop FF_API_GET_CHANNEL_LAYOUT_COMPAT cruftHendrik Leppkes2015-09-05
| | | | | | | | | | FATE refs changed to accomodate for the new default behavior of the function. Numbers are now interpreted as a channel layout, instead of a number of channels.