aboutsummaryrefslogtreecommitdiff
path: root/libavutil/opt.c
AgeCommit message (Collapse)Author
2014-02-19AVOptions: add flags for read/read-only optionsAnton Khirnov
2013-10-27AVOptions: do not range check flag options.Anton Khirnov
It does not make sense in the vast majority of use cases, no currently defined AV_OPT_TYPE_FLAGS options in Libav set the range to anything nontrivial, and many of those get it wrong (the "correct" range is INT_MIN to INT_MAX so that the builtin constant "all" works).
2013-07-31avopt: Check whether the object actually has got an AVClassMartin Storsjö
AVIOContext has got an av_class member that only gets set if opening the context using avio_open2, but not if allocating a custom IO context. A caller that wants to read AVOptions from an AVIOContext (recursively using AV_OPT_SEARCH_CHILDREN) may not know if the AVIOContext actually has got a class set or not. Signed-off-by: Martin Storsjö <martin@martin.st>
2013-04-04opt: check the return values of av_get_token for ENOMEM.Anton Khirnov
2013-03-28AVOptions: make av_set_options_string() forward options to child objectsAnton Khirnov
2013-03-16AVOptions: fix using named constants with child contexts.Anton Khirnov
The named constant needs to be searched for in the same object on which the option is set, i.e. target_obj.
2013-03-16AVOption: remove an unused function parameter.Anton Khirnov
2012-12-31Drop unnecessary 'l' length modifier when printfing double values.Diego Biurrun
%f denotes a double argument and 'l' does nothing in this case according to the C spec.
2012-12-22opt: avoid segfault in av_opt_next() if the class does not have an option listJustin Ruggles
CC: libav-stable@libav.org
2012-12-05lavu/opt: do not filter out the initial sign character except for flagsJustin Ruggles
This allows parsing of special-case negative numbers like decibels.
2012-12-04Remove pointless #undefs of previously forbidden functions.Anton Khirnov
2012-10-23lavu: remove disabled avoptions cruftAnton Khirnov
2012-09-04avopt: Explicitly store rational option defaults in .dblMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04avopt: Store defaults for AV_OPT_TYPE_FLAGS in the i64 union memberMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union memberMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-24AVOptions: store defaults for INT64 options in int64 union member.Anton Khirnov
Double does not have enough precision to represent all int64 numbers exactly.
2012-08-15Don't include common.h from avutil.hMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-01opt/eval: Include mathematics.h for NAN/INFINITYMartin Storsjö
These files use NAN/INFINITY but didn't include mathematics.h to get the fallback definitions if the system lacks the macros. Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-28AVOptions: fix the value printed in out of range error message.Anton Khirnov
2012-05-26opt: Add av_opt_set_bin()Samuel Pitoiset
Introduce a new function to set binary data through AVOption, avoiding having to convert the binary data to a string inbetween. Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-11AVOptions: don't return an invalid option when option list is emptyAnton Khirnov
2011-10-17avoptions: Fix av_opt_flag_is_setMartin Storsjö
With the changes in 3b3ea34655db02d9cd9ea1a4122e920a7fdec602, "Remove all uses of deprecated AVOptions API", av_opt_flag_is_set was broken, since it now uses av_opt_find, which doesn't return named constants unless a unit to look for the constant in is given. This broke enabling LATM encapsulated AAC output in RTP. Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17AVOptions: don't segfault on NULL parameter in av_set_options_string()Anton Khirnov
2011-10-12AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*Anton Khirnov
2011-10-12Remove all uses of deprecated AVOptions API.Anton Khirnov
2011-10-12AVOptions: add av_opt_next, deprecate av_next_option.Anton Khirnov
Just for naming consistency, no functional changes.
2011-10-12AVOptions: add functions for evaluating option strings.Anton Khirnov
2011-10-12AVOptions: split get_number().Anton Khirnov
Split actual writing to read_number() in the same way as write_number(). Allows set_string_number() to write to a caller-provided destination.
2011-10-12AVOptions: add av_opt_get*, deprecate av_get*.Anton Khirnov
New functions can get values from child objects, properly report error codes and have consistent naming and signatures.
2011-10-12AVOptions: add av_opt_set*().Anton Khirnov
Deprecate av_set_* New functions support setting values on children, return error codes instead of options and have consistent naming and signatures.
2011-10-12AVOptions: add new API for enumerating children.Anton Khirnov
This will allow the caller to enumerate child contexts in a generic way and since the API is recursive, it also allows for deeper nesting (e.g. AVFormatContext->AVIOContext->URLContext) This will also allow the new setting/reading API to transparently apply to children contexts.
2011-10-10AVOptions: refactor set_number/write_numberAnton Khirnov
write_number() does the actual writing of the supplied number to destination. Move finding the option and choosing destination address out of it.
2011-10-10AVOptions: cosmetics, rename static av_set_number2() to write_number().Anton Khirnov
2011-10-10AVOptions: cosmetics, move and rename static av_set_number().Anton Khirnov
2011-10-10AVOptions: split av_set_string3 into opt type-specific functionsAnton Khirnov
Also stop attempting to honor the alloc parameter, as things break horribly in that case. It will be removed in upcoming successor to av_set_string3.
2011-09-07AVOptions: remove AVOption.offset <= 0 checksAnton Khirnov
They will only ever be <=0 if the option is broken, in which case this check is hiding a bug.
2011-09-07AVOptions: deprecate av_opt_set_defaults2Anton Khirnov
It's a hack which was created to allow for multiple options with different defaults to refer to same field (e.g. 'b' vs 'ab'). There is no need for it anymore.
2011-09-07AVOptions: move doxy for av_opt_set_defaults() from opt.c to opt.hAnton Khirnov
Also change it to be more readable.
2011-09-01AVOptions: drop av_ prefix from static av_get_number().Anton Khirnov
2011-07-08AVOptions: in av_opt_find() don't return named constants unless unit is ↵Anton Khirnov
specified. That is, unless the caller explicitly asks for them. Prevents conflict between e.g. the 'loop' option in img2 demuxer and 'loop' flag in AVCodecContext.
2011-07-03Do not include log.h in avutil.hMans Rullgard
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03Remove return statements following infinite loops without breakMans Rullgard
These statements cannot be reached and are thus not needed. This removes a number of compiler warnings. Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-30opt-test: Add missing braces to silence compiler warnings.Diego Biurrun
libavutil/opt.c:604:1: warning: missing braces around initializer [-Wmissing-braces]
2011-06-16AVOptions: add av_opt_find() as a replacement for av_find_opt.Anton Khirnov
2011-06-16AVOptions: add av_opt_set_dict() mapping a dictionary struct to a context.Anton Khirnov
This way the caller can pass all the options in one nice package.
2011-06-10avoptions: Add an av_opt_flag_is_set function for inspecting flag fieldsMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-06-05AVOptions: add av_opt_free convenience function.Anton Khirnov
2011-05-26AVOptions: set string default values.Anton Khirnov
2011-05-25avoptions: Return explicitly NAN or {0,0} if the option isn't foundMartin Storsjö
This actually matches what av_get_double did earlier, the 0.0/0.0 division was intentional, for producing NAN. Still keeping the check for the return value from av_get_number, for clarity. Signed-off-by: Martin Storsjö <martin@martin.st>