Commit Graph

159 Commits

Author SHA1 Message Date
Michael Niedermayer
15b1b08874 avutil/opt: fix flags check on non x86
This should fix several fate failures

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-29 21:07:45 +01:00
Michael Niedermayer
162126bb17 avutil/opt: check flags validity in write_number()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 18:03:29 +01:00
Michael Niedermayer
f0e43e60cd Merge commit '0b357a8095e72b092cc5c2aacc2f806db75ecae3'
* commit '0b357a8095e72b092cc5c2aacc2f806db75ecae3':
  AVOptions: do not range check flag options.

Conflicts:
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 11:26:48 +01:00
Anton Khirnov
0b357a8095 AVOptions: do not range check flag options.
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-10-27 21:40:33 +01:00
Michael Niedermayer
2d8ccf0adc avutil/opt: initialize ret
Fixes CID1108610
Fixes use of uninitialized variable

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-20 18:38:48 +02:00
Stefano Sabatini
8696e51baf lavu/opt: add AV_OPT_TYPE_CHANNEL_LAYOUT and handler functions
The new type is compatible with AV_OPT_TYPE_INT64, but allows to specify
channel layouts using the format accepted by av_get_channel_layout().
2013-10-17 18:09:29 +02:00
Stefano Sabatini
98e7c1eed5 lavu/opt-test: use automatic set and free handlers
In particular, do not set default string value by hand and use
av_opt_free() to free context.
2013-10-17 18:02:54 +02:00
Michael Niedermayer
5fc5170c55 avutil/opt: make const tables static const
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-10 18:44:40 +02:00
Michael Niedermayer
18b1381c5f avutil/opt: fix av_log type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-10 18:44:40 +02:00
Michael Niedermayer
0b5d1b88e0 avutil/opt: fix types passed to the format string "%s"
Fixes gcc warnings
Fixes CID1061056
Fixes CID1061057

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-08 02:48:44 +02:00
Michael Niedermayer
cca229e75a Merge commit 'c7e921a54ffe7feb9f695c82f0a0764ab8d0f62b'
* commit 'c7e921a54ffe7feb9f695c82f0a0764ab8d0f62b':
  avopt: Check whether the object actually has got an AVClass

Conflicts:
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-01 12:30:30 +02:00
Martin Storsjö
c7e921a54f avopt: Check whether the object actually has got an AVClass
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-07-31 21:31:14 +03:00
Paul B Mahol
fd84b6fd33 lavu/opt: show default values for AV_OPT_TYPE_PIXEL_FMT and AV_OPT_TYPE_SAMPLE_FMT too
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-07-25 20:41:39 +00:00
Paul B Mahol
a64248d1ec lavu/opt: show default values
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-07-03 20:32:30 +00:00
Paul B Mahol
f98dbc7311 lavu/opt: check if class is NULL too
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-21 20:50:49 +00:00
Paul B Mahol
3a751eab78 lavu/opt: add AV_OPT_TYPE_COLOR
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-17 11:32:53 +00:00
Michael Niedermayer
e7389ed5d0 Merge commit 'bcc94328980e6c56546792ab08b0756abdce310b'
* commit 'bcc94328980e6c56546792ab08b0756abdce310b':
  opt: check the return values of av_get_token for ENOMEM.
  doc: Fix best_nb_channells typo
  matroska: pass the lace size to the matroska_parse_rm_audio

Conflicts:
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-04 13:00:59 +02:00
Anton Khirnov
bcc9432898 opt: check the return values of av_get_token for ENOMEM. 2013-04-04 07:51:53 +02:00
Nicolas George
983d04dd40 lavu/opt: make sure av_opt_set_bin() handles NULL/0. 2013-04-01 10:38:38 +02:00
Clément Bœsch
d00dcb8c9f opt: attempt to improve options dump output.
Add some indent and remove the '-' prefix for filters.
2013-03-31 18:22:23 +02:00
Michael Niedermayer
fd37a7dc3c Merge commit 'cf53704c55378cc0dcfc16637cdac7d58f0b3107'
* commit 'cf53704c55378cc0dcfc16637cdac7d58f0b3107':
  AVOptions: make av_set_options_string() forward options to child objects
  win32: Use 64-bit fstat/lseek variants for MSVC as well
  win32: Make ff_win32_open more robust

Conflicts:
	libavformat/os_support.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-28 12:26:36 +01:00
Anton Khirnov
cf53704c55 AVOptions: make av_set_options_string() forward options to child objects 2013-03-28 07:55:38 +01:00
Nicolas George
8d928a9d99 lavu/opt: add AV_OPT_TYPE_DURATION. 2013-03-20 21:04:28 +01:00
Michael Niedermayer
eaa5882e71 avutil: fix compilation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 13:45:30 +01:00
Paul B Mahol
7aa9af51db lavu/opt: add AV_OPT_VIDEO_RATE option
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-03-20 12:29:54 +00:00
Michael Niedermayer
7fff5781b6 Merge commit 'e4a7b2177d14678ae240edcabaacfe2b14619b7b'
* commit 'e4a7b2177d14678ae240edcabaacfe2b14619b7b':
  vf_showinfo: remove its useless init function
  AVOptions: fix using named constants with child contexts.

Conflicts:
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-16 16:38:11 +01:00
Anton Khirnov
4d67ff8e8e AVOptions: fix using named constants with child contexts.
The named constant needs to be searched for in the same object on which
the option is set, i.e. target_obj.
2013-03-16 05:35:33 +01:00
Anton Khirnov
9676b9a2cd AVOption: remove an unused function parameter. 2013-03-16 05:35:20 +01:00
Stefano Sabatini
b1a2684936 lavu/opt: fix weird align 2013-03-05 13:20:14 +01:00
Stefano Sabatini
7b9a3df5d7 lavu/opt-test: do not explicitly set default value in test_ctx
Let av_opt_set_defaults() set the value, which is simpler and more
idiomatic.
2013-03-05 13:20:14 +01:00
Diego Biurrun
bcb8d9eb8f Drop unnecessary 'l' length modifier when printfing double values.
%f denotes a double argument and 'l' does nothing in this case
according to the C spec.
2012-12-31 11:20:45 +01:00
Michael Niedermayer
2f9903f662 Merge commit '418693bdc5edad72b0d055f741931612d797eb05'
* commit '418693bdc5edad72b0d055f741931612d797eb05':
  lavc: rewrite and extend AVFrame doxy
  opt: avoid segfault in av_opt_next() if the class does not have an option list
  ttadec: fix last frame handling when seeking
  alacdec: do not be too strict about the extradata size

Conflicts:
	libavcodec/alac.c
	libavcodec/avcodec.h
	libavcodec/tta.c
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-23 13:32:40 +01:00
Justin Ruggles
d02202e08a opt: avoid segfault in av_opt_next() if the class does not have an option list
CC: libav-stable@libav.org
2012-12-22 15:43:27 -05:00
Michael Niedermayer
22e4988673 opt: fix memleak on error of range_array
Fixes CID747739
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-11 00:03:23 +01:00
Stefano Sabatini
f494647206 lavu/opt: change the way ranges are printed 2012-12-08 22:18:38 +01:00
Stefano Sabatini
129d737150 lavu/opt: make av_opt_query_ranges_default() return a meaningful error code 2012-12-08 19:53:03 +01:00
Stefano Sabatini
0ad654d4c9 lavu/opt: perform misc cosmetical fixes 2012-12-08 19:13:20 +01:00
Michael Niedermayer
e0a553d526 opt_list: fix vertical alignment of types
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-08 01:34:28 +01:00
Michael Niedermayer
f4ceca6261 opt: print ranges in opt_list()
The formating can and should be improved.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-08 01:34:28 +01:00
Michael Niedermayer
a8e0d51bb8 opt: Add support to query ranges
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-08 01:34:28 +01:00
Michael Niedermayer
15784c2bab Merge commit '9d5c62ba5b586c80af508b5914934b1c439f6652'
* commit '9d5c62ba5b586c80af508b5914934b1c439f6652':
  lavu/opt: do not filter out the initial sign character except for flags
  eval: treat dB as decibels instead of decibytes
  float_dsp: add vector_dmul_scalar() to multiply a vector of doubles

Conflicts:
	libavutil/eval.c
	tests/ref/fate/eval

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-06 14:33:38 +01:00
Justin Ruggles
9d5c62ba5b lavu/opt: do not filter out the initial sign character except for flags
This allows parsing of special-case negative numbers like decibels.
2012-12-05 11:23:36 -05:00
Michael Niedermayer
99efd59626 Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'
* commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967':
  Remove pointless #undefs of previously forbidden functions.
  fate: Add dependencies for bmp, cdxl, dfa, mp3

Conflicts:
	doc/examples/muxing.c
	libavfilter/filtfmts.c
	libavutil/des.c
	libavutil/eval.c
	libavutil/log.c
	libavutil/parseutils.c
	tests/fate/mp3.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-05 13:34:45 +01:00
Anton Khirnov
cb45553f57 Remove pointless #undefs of previously forbidden functions. 2012-12-04 21:40:22 +01:00
Stefano Sabatini
c9ff32215b lavu/opt: allow to set sample and pixel format with av_opt_set_int()
This change requires the user to specify min and max value, and makes
possible to prevent the user to set AV_{SAMPLE,PIX}_FMT_NONE if
forbidden.

Add required ifdeffery in case of mixed libraries, when libavutil is
updated but not the other libraries.

This is a followup of 08d0969c14.
2012-12-01 19:33:30 +01:00
Stefano Sabatini
08d0969c14 lavu/opt: change the way default pixel and sample format value is set
Use the i64 field rather than the string value. Using a string to set a
default sample/pixel format is weird, also the new interface is more
consistent with the rest of the API.

This is technically an API break, but hopefully there are no applications
using this feature outside of FFmpeg. In order to save backward
compatibility with mixed libraries in case libavutil is updated but not
the other libraries, some ifdeffery hacks are added.

Note that the version check is only performed when class->version != 0,
since if it is not defined then we assume that no version was defined and
the class is not affected by the change.

We will luckily get rid of the hack at the next major bump.
2012-11-30 00:01:53 +01:00
Stefano Sabatini
51e9f58e1c lavu/opt: add support for reading pixel and sample format through av_get_int()
Simplify backward compatibility, when switching from AV_OPT_TYPE_INT to
AV_OPT_TYPE_SAMPLE/PIXEL_FMT.
2012-11-25 20:31:39 +01:00
Stefano Sabatini
26c531cc22 lavu/opt: fix range shown in set_format() log message 2012-11-25 15:50:46 +01:00
Stefano Sabatini
c70ec631c9 lavu/opt: add av_opt_ accessors for pixel/format/image size options
The interface is implemented against the style of the other options
accessors. Possibly simplify programmatic setting of options.
2012-11-25 15:01:33 +01:00
Nicolas George
926481078b lavu/opt: fix av_opt_get_key_value() API.
Do not skip the end delimiter.
Reserve positive return values.
This is an API break, but the function was introduced less than
two weeks ago.
2012-11-16 10:36:45 +01:00