Commit Graph

128 Commits

Author SHA1 Message Date
Andrew Sayers 99e43a6dfe
lavu/opt: Clarify the scope of AVOptions
See discussion on the mailing list:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-April/326054.html

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-01 02:57:13 +02:00
James Almer 8616cfe089 avutil/opt: add support for children objects in av_opt_serialize
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-23 23:54:46 -03:00
Anton Khirnov efe4478778 lavu/opt: add array options 2024-03-08 07:36:15 +01:00
Anton Khirnov fc706276c0 lavu/opt: distinguish between native and foreign access for AVOption fields
Native access is from the code that declared the options, foreign access
is from code that is using the options. Forbid foreign access to
AVOption.offset/default_val, for which there is no good reason, and
which should allow us more freedom in extending their semantics in a
compatible way.
2024-03-08 07:24:50 +01:00
Andreas Rheinhardt be54923abc avutil/opt: Don't use AV_OPT_TYPE_FLAGS for sentinels
Make AVOptionType start with 1 instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-07 08:53:31 -03:00
James Almer 65ddc74988 avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-07 08:53:30 -03:00
Anton Khirnov 6456dd50a6 lavu/opt: cosmetics, group option reading function together 2024-03-01 16:57:24 +01:00
Anton Khirnov 2a3a33d04b lavu/opt: cosmetics, group option setting function together 2024-03-01 16:57:24 +01:00
Anton Khirnov cc0bd9da70 lavu/opt: cosmetics, group (un)init and management functions together 2024-03-01 16:57:24 +01:00
Anton Khirnov 067fde4966 lavu/opt: document AVOption.flags 2024-03-01 16:57:24 +01:00
Anton Khirnov 39a3a1c69b lavu/opt: cosmetics, move AV_OPT_FLAG_* out of AVOption
Also drop an obsolete FIXME.
2024-03-01 16:57:24 +01:00
Anton Khirnov 105a1bc150 lavu/opt: cosmetics, change option flags to (1 << N) style
It is easier to read. Also, change their doxy comments to use the same
style.
2024-03-01 16:57:24 +01:00
Anton Khirnov 08bebeb1be Revert "all: Don't set AVClass.item_name to its default value"
Some callers assume that item_name is always set, so this may be
considered an API break.

This reverts commit 0c6203c97a.
2024-01-20 10:34:48 +01:00
Andreas Rheinhardt 0c6203c97a all: Don't set AVClass.item_name to its default value
Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-12-22 15:12:33 +01:00
Anton Khirnov f423497b45 lavu: support AVChannelLayout AVOptions
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Andreas Rheinhardt 8c53b14599 avutil/opt: Document actual behaviour of av_opt_copy a bit more
In particular, document that av_opt_copy() always disentangles
allocated options even on error; this guarantee is needed to e.g.
properly free duplicated thread contexts in libavcodec on error.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-17 19:11:57 +02:00
Andreas Rheinhardt e7bd47e657 Remove obsolete version.h inclusions
These have mostly been added because of FF_API_*; yet when these were
removed, removing the header has been forgotten.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:34:31 +02:00
James Almer 0bf3a7361d avutil: remove deprecated AVClass.child_class_next
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:04 -03:00
Anton Khirnov 1b4a98b029 lavu/opt: add a more general child class iteration API
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.
2020-06-10 12:36:42 +02:00
Marton Balint af9e622776 avutil/opt: add AV_OPT_FLAG_CHILD_CONSTS
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>
2020-05-22 22:16:52 +02:00
Marton Balint 5edacc4609 avutil/opt: add full support for AV_OPT_TYPE_DICT
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>
2019-12-27 21:52:21 +01:00
Paul B Mahol f3746d31f9 avutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flag 2019-10-14 11:28:54 +02:00
Clément Bœsch 5be0410cb3 lavu/opt: add AV_OPT_FLAG_DEPRECATED 2018-04-26 19:50:29 +02:00
Jun Zhao e0e72539cf lavu/opt: add AV_OPT_FLAG_BSF_PARAM
add AV_OPT_FLAG_BSF_PARAM for bit stream filter options.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-16 02:09:59 +01:00
wm4 474194a8d0 avutil/opt: remove ABI hacks
These were needed for ABI compatibility with Libav. We don't need them
anymore.
2018-02-13 04:46:04 +01:00
James Almer c0cfc0ce11 Merge commit '619a433eca2c5655c41b799e0b06380020fb1498'
* commit '619a433eca2c5655c41b799e0b06380020fb1498':
  lavu: Drop deprecated option type

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:18:00 -03:00
Vittorio Giovara 619a433eca lavu: Drop deprecated option type
Deprecated in 02/2014.
2017-03-23 10:09:17 +01:00
Michael Niedermayer 2f935baa7d avutil/opt: Add AV_OPT_TYPE_UINT64
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>
2016-11-23 02:01:05 +01:00
Kacper Michajłow 69630f4d30 libavutil/opt: Small bugfix in example.
Fix const corectness and zero init the struct. This example code would actually crash when initializing string.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-24 00:41:15 +02:00
Clément Bœsch 8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Vittorio Giovara 41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Michael Niedermayer 564b4591bb opt: Add av_opt_copy()
This includes documentation and other modifications by
Lukasz Marek and Martin Storsjö.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-03-24 10:34:15 +02:00
Lukasz Marek 8833f1508b opt: Add const to av_opt_next
Also add const to pointers in static functions within opt.c where
possible/necessary.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-03-24 10:34:09 +02:00
Rodger Combs 0562f95902 lavu/opt: add flag to return NULL when applicable in av_opt_get
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-09 04:12:57 -05:00
Rodger Combs f36baeebc5 lavu/opt: switch AV_OPT flags to shift-based formatting 2015-10-09 04:12:57 -05:00
Clément Bœsch 9117748cff avutil/opt: add AV_OPT_TYPE_BOOL 2015-09-08 22:39:20 +02:00
Hendrik Leppkes 237cf3786e lavu: Drop old deprecated AVOption API
Deprecated in 2011/10
2015-09-05 18:30:35 +02:00
Hendrik Leppkes 545559e43d Remove FF_CONST_AVUTIL55 cruft 2015-09-05 17:56:28 +02:00
Ronald S. Bultje 3285005347 Undeprecate av_opt_set_defaults2(). 2015-08-18 13:09:06 -04:00
Ronald S. Bultje ad45121d56 options: mark av_get_{int,double,q} as deprecated.
Convert last users to av_opt_get_*() counterparts.
2015-08-18 12:05:17 -04:00
Andreas Cadhalpun 28efeb6502 doc: avoid incorrect phrase 'allows to'
Also fix typo found by Lou Logan:
Sacrifying -> Sacrificing

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-06-16 21:48:51 +02:00
Lukasz Marek 0cb994dfe3 lavu/opt: add escaping to av_opt_serialize
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-29 00:58:42 +01:00
Lukasz Marek f00e9c4b10 lavu/opt: add consts where possible 2014-11-27 23:27:14 +01:00
Lukasz Marek bee5844ddd lavu/opt: introduce av_opt_serialize()
Function allows to create string containing object's serialized options.
Such string may be passed back to av_set_options_string() in order to restore options.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-16 01:13:38 +01:00
Lukasz Marek eec693328a lavu/opt: introduce av_opt_is_set_to_default()
New function allows to check if option is set to its default value

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-16 01:13:38 +01:00
Michael Niedermayer 1e16492b98 Merge commit 'c6074a30ba3b5fb4319ee6ee599656d58548cdc8'
* commit 'c6074a30ba3b5fb4319ee6ee599656d58548cdc8':
  opt: Fix the documentation mentioning av_set_string3

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-11 23:54:52 +01:00
Luca Barbato c6074a30ba opt: Fix the documentation mentioning av_set_string3
It is av_opt_set now.
2014-11-11 11:49:55 +01:00
Lukasz Marek 457204ee15 lavu/opt: document av_opt_copy function 2014-11-09 17:56:08 +01:00
James Almer 71718de814 avutil: remove obsolete FF_API_FIND_OPT cruft
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:09:53 -03:00
Michael Niedermayer 2ba4577809 Merge commit 'a8c104a511f97e4ea617df73b31737e28a8a5126'
* commit 'a8c104a511f97e4ea617df73b31737e28a8a5126':
  AVOption: add support for dictionary types.

Conflicts:
	libavutil/opt.c
	libavutil/opt.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 22:39:54 +02:00