Nicolas George
438978fb4b
opt: implement av_opt_set_from_string().
...
It is similar to av_set_options_string() but accepts a list
of options that can be in shorthand: if the key is omitted
on the first fields, the keys from the shorthand list are
assumed, in order.
12 years ago
Stefano Sabatini
cf5629c064
lavu/opt: reindent after last commit
12 years ago
Stefano Sabatini
5666a1b270
lavu/opt: support NULL and special "none" values for size and pixel format options
...
Allow to specify NULL values explicitly, thus overriding the default
values set in the context.
12 years ago
Martin Storsjö
21bc440384
avopt: Explicitly store rational option defaults in .dbl
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
e6153f173a
avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
d58dd4b5b5
avopt: Store defaults for AV_OPT_TYPE_FLAGS in the i64 union member
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
124134e424
avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
4d7adec8bd
AVOptions: store defaults for INT64 options in int64 union member.
...
Double does not have enough precision to represent all int64 numbers
exactly.
12 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Stefano Sabatini
a25346e65c
lavu/opt.h: add AV_OPT_FLAG_FILTERING_PARAM macro
12 years ago
Stefano Sabatini
a6d6b8a200
lavu/opt: fix crash in av_opt_next() in case the class has no options
12 years ago
Martin Storsjö
3893feeccd
opt/eval: Include mathematics.h for NAN/INFINITY
...
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>
13 years ago
Nicolas George
9148ae5b91
opt: add test for IMAGE_SIZE and PIXEL_FMT.
13 years ago
Nicolas George
61c266d72f
opt: free test_ctx.string at the end.
...
Makes valgrind happy.
13 years ago
Nicolas George
42b774ab6f
opt: init test_ctx to 0.
...
Otherwise, setting string will try to free a random address.
13 years ago
Nicolas George
d9b0d75c56
opt: add AV_OPT_TYPE_PIXEL_FMT.
13 years ago
Anton Khirnov
0426c69310
AVOptions: fix the value printed in out of range error message.
13 years ago
Samuel Pitoiset
154486f9ad
opt: Add av_opt_set_bin()
...
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>
13 years ago
Nicolas George
2ec3e5767e
opt: add AV_OPT_TYPE_IMAGE_SIZE.
13 years ago
Stefano Sabatini
d4f8d717ab
lavu/opt: clarify error message in set_key_value_pair()
13 years ago
Michael Niedermayer
2d9e2c6464
opt: Fix "libavutil/opt.c:811:20: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
dff97be808
av_opt: add av_opt_ptr() to return a pointer to a field of a object based on
...
an AVClass
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
a9011623ea
avopts: Fix random values being printed in error messages:
...
Bug introduced in:
commit 7bb1807c2d
Author: Anton Khirnov <anton@khirnov.net>
Date: Tue Aug 23 12:58:49 2011 +0200
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
Michael Niedermayer
d5e1244ca7
opt: Fix *av_opt_find2(NULL)
...
Fixes Ticket650
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
e1e22851c1
AVOptions: don't return an invalid option when option list is empty
13 years ago
Martin Storsjö
299234a0a9
avoptions: Fix av_opt_flag_is_set
...
With the changes in 3b3ea34655
,
"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>
13 years ago
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