Anton Khirnov
85afbb1d00
AVOptions: don't segfault on NULL parameter in av_set_options_string()
13 years ago
Michael Niedermayer
da31e537c4
opt: handle AV_OPT_TYPE_CONST too
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
145f741e11
AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*
13 years ago
Anton Khirnov
3b3ea34655
Remove all uses of deprecated AVOptions API.
13 years ago
Anton Khirnov
8c5dcaad13
AVOptions: add av_opt_next, deprecate av_next_option.
...
Just for naming consistency, no functional changes.
13 years ago
Anton Khirnov
dca055be3a
AVOptions: add functions for evaluating option strings.
13 years ago
Anton Khirnov
059a037fbd
AVOptions: split get_number().
...
Split actual writing to read_number() in the same way as write_number().
Allows set_string_number() to write to a caller-provided destination.
13 years ago
Anton Khirnov
41d9d51a72
AVOptions: add av_opt_get*, deprecate av_get*.
...
New functions can get values from child objects, properly report error
codes and have consistent naming and signatures.
13 years ago
Anton Khirnov
dac66da63d
AVOptions: add av_opt_set*().
...
Deprecate av_set_*
New functions support setting values on children, return error codes
instead of options and have consistent naming and signatures.
13 years ago
Anton Khirnov
641c7afe3c
AVOptions: add new API for enumerating children.
...
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.
13 years ago
Anton Khirnov
7bb1807c2d
AVOptions: refactor set_number/write_number
...
write_number() does the actual writing of the supplied
number to destination. Move finding the option and choosing destination
address out of it.
13 years ago
Anton Khirnov
cf10095f0b
AVOptions: cosmetics, rename static av_set_number2() to write_number().
13 years ago
Anton Khirnov
b003d0be5b
AVOptions: cosmetics, move and rename static av_set_number().
13 years ago
Anton Khirnov
c8d787d2ef
AVOptions: split av_set_string3 into opt type-specific functions
...
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.
13 years ago
Michael Niedermayer
0962ad0e2f
avopt: Fix searching for constants
...
Fixes Ticket350
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
4dbcdfa86d
AVOptions: remove AVOption.offset <= 0 checks
...
They will only ever be <=0 if the option is broken, in which case this
check is hiding a bug.
13 years ago
Anton Khirnov
79eff91325
AVOptions: deprecate av_opt_set_defaults2
...
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.
13 years ago
Anton Khirnov
a7e2b2ccc9
AVOptions: move doxy for av_opt_set_defaults() from opt.c to opt.h
...
Also change it to be more readable.
13 years ago
Anton Khirnov
bea5670a4f
AVOptions: drop av_ prefix from static av_get_number().
13 years ago
Michael Niedermayer
c4fd1d34ca
av_get_string: search children too.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
bf71fb54b5
av_get_number: also search children, this is more sane than not doing so.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
a726d7fd4e
AVOptions: in av_opt_find() don't return named constants unless unit is 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.
14 years ago
Mans Rullgard
abc78a5a7c
Do not include log.h in avutil.h
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Mans Rullgard
add41decd9
Remove return statements following infinite loops without break
...
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>
14 years ago
Diego Biurrun
ce1e181b13
opt-test: Add missing braces to silence compiler warnings.
...
libavutil/opt.c:604:1: warning: missing braces around initializer [-Wmissing-braces]
14 years ago
Stefano Sabatini
141f03541b
opt: do not crash in av_set_options_string() if opts == NULL
...
Add missing NULL check, and update documentation accordingly.
14 years ago
Anton Khirnov
dc59ec5e79
AVOptions: add av_opt_find() as a replacement for av_find_opt.
14 years ago
Anton Khirnov
7e83e1c511
AVOptions: add av_opt_set_dict() mapping a dictionary struct to a context.
...
This way the caller can pass all the options in one nice package.
14 years ago
Martin Storsjö
cb7c11cc9e
avoptions: Add an av_opt_flag_is_set function for inspecting flag fields
...
Signed-off-by: Martin Storsjö <martin@martin.st>
14 years ago
Anton Khirnov
b39b06233d
AVOptions: add av_opt_free convenience function.
14 years ago
Michael Niedermayer
87ababd7c5
avopt: fix segfault
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Anton Khirnov
6c117d43c9
AVOptions: set string default values.
14 years ago
Martin Storsjö
80068da3a0
avoptions: Return explicitly NAN or {0,0} if the option isn't found
...
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>
14 years ago
Martin Storsjö
8089b7fa8c
avoptions: Check the return value from av_get_number
...
This avoids doing a division by zero if the option wasn't found,
or wasn't an option of an appropriate type.
Signed-off-by: Martin Storsjö <martin@martin.st>
14 years ago
Martin Storsjö
0eed5016a2
avoptions: Support getting flag values using av_get_int
14 years ago
Anton Khirnov
b66752790a
AVOptions: make default_val a union, as proposed in AVOption2.
...
This breaks API and ABI.
14 years ago
Michael Niedermayer
3862ebba23
AVOptions: av_set_string3() allow NULL strings
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Anton Khirnov
85770f2a26
AVOptions: make default_val a union, as proposed in AVOption2.
...
This breaks API and ABI.
14 years ago
Anton Khirnov
5a43bd5e26
options: simplify av_find_opt by using av_next_option.
14 years ago
Stefano Sabatini
58f8463947
error: add error code AVERROR_OPTION_NOT_FOUND, and use it in opt.c
...
The new error code is better than AVERROR(ENOENT), which has a
completely different semantics ("No such file or directory").
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
14 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Stefano Sabatini
d2af7205a1
Use hierarchic names convention (prefix them with av_expr) for the
...
eval API.
More grep-friendly and more consistent with the rest of the FFmpeg
API.
Originally committed as revision 25708 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
584b8edb99
Add missing case for FF_OPT_TYPE_DOUBLE in av_opt_set_defaults2().
...
Originally committed as revision 25265 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
c85eef4ed8
Move av_set_options_string() from libavfilter to libavutil.
...
Originally committed as revision 25236 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
be0e596a57
Simplify include, since opt.c is now in libavutil there is no need
...
to use the library path prefix for eval.h.
Originally committed as revision 25220 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
8f1afd3b37
Cosmetics: apply misc style fixes.
...
Originally committed as revision 25219 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Michael Niedermayer
6ed040408b
Move AVOptions from libavcodec to libavutil
...
Originally committed as revision 25210 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
e44c01563f
Deprecate av_opt_show() in favor of a new function av_opt_show2(),
...
which allows to specify only a subset of all the options to show.
Originally committed as revision 25166 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
0b99215c0e
Move eval.c and eval.h from libavcodec to libavutil, and make the eval
...
API public.
Originally committed as revision 23485 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
9ace13b416
Make ff_parse_expr() and ff_parse_and_eval_expr() return an int
...
containing an error code.
Allow these functions to convey the reason of the failure to the
calling function, failure which is not always due to a parsing error
but it may depend for example on a memory problem.
Also fix several potential memleaks.
Originally committed as revision 23402 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago