Commit Graph

41 Commits

Author SHA1 Message Date
Marton Balint a688fbfb88 avutil/channel_layout: fix some (un)initialization issues in av_channel_layout_from_string()
Also make initialization/uninitialization behaviour more explicit in the docs,
and make sure we do not leak a channel map on error.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-16 19:49:39 +01:00
Marton Balint ed6207274e avutil/channel_layout: add AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-16 19:49:39 +01: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
Marton Balint 242901f7c2 avutil/channel_layout: add FF_CHANNEL_ORDER_NB
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-02-18 10:43:12 +01:00
Marton Balint 2a12c04e35 avutil/channel_layout: change AV_CHAN_SILENCE to AV_CHAN_UNUSED in the docs
It got renamed during the API design phase.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-02-18 10:43:12 +01:00
Marton Balint 66386bf2a2 avutil/channel_layout: add av_channel_layout_retype()
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-02-12 21:03:45 +01:00
Marton Balint 4569b86132 avutil/channel_layout: add av_channel_layout_custom_init()
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-02-12 21:03:45 +01:00
James Almer 04e53927ad avutil/channel_layout: add a 9.1.4 channel layout
Mapping to ITU-R BS.2051-3 "Sound System G" and ITU-R BS.1196-8 "Channel
Configuration 20".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-08 10:09:46 -03:00
James Almer b4169760b0 avutil/channel_layout: add a 7.2.3 channel layout
Mapping to ITU-R BS.2051-3 "Sound System F" and ITU-R BS.1196-8 "Channel
Configuration 15".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-08 10:09:46 -03:00
James Almer 1ad7bd0fe5 avutil/channel_layout: simplify 22.2 layout bitmask define
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-28 12:49:48 -03:00
James Almer 35b06853d1 avutil/channel_layout: add a 3.1.2 channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
Will Wolcott e9397ae054 avutil/channel_layout: add a 7.1.4 channel layout
Mapping to ITU-R BS.2051-3 "Sound System J" and ITU-R BS.1196-8 "Channel
Configuration 19".

Signed-off-by: Will Wolcott <wwolcott@netflix.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
James Almer a41c4b923d avutil/channel_layout: add a 7.1.2 channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
James Almer 8d46cbce4f avutil/channel_layout: add a 5.1.4 channel layout
Mapping to ITU-R BS.2051-3 "Sound System D" and ITU-R BS.1196-8 "Channel
Configuration 16".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
James Almer 4b8404815d avutil/channel_layout: rename 7.1(top) channel layout to 5.1.2
This layout maps to ITU-R BS.2051-3 "Sound System C" and ITU-R BS.1196-8 "Channel
Configuration 14", and it being the first layout with top layer channels, it's
best to use a different scheme to properly convey the presence and amount of said
channels.
The new name will also be a better fit for the additions in the following commits.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-27 08:46:34 -03:00
Zhao Zhili ff094f5ebb avutil/channel_layout: make pre-defined channel layouts C++ friendly
C++ doesn't support designated initializers until C++20. We have
a bunch of pre-defined channel layouts, the gains to make them
usable in C++ exceed the losses.

Bump minor version so C++ project can check before use these defines.

Also initialize .opaque field explicitly to reduce warning in C++.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-18 08:27:24 -03:00
James Almer 6228ba141d avutil/channel_layout: add a 7.1(top) channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-03 19:39:45 -03:00
James Almer 83e918de71 avutil/channel_layout: add a cube channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-10-30 16:18:30 -03:00
Marvin Scholz 436879a203 avutil/channel_layout: Document missing arguments 2022-10-17 09:55:19 +02:00
Marvin Scholz f824388c33 avutil/channel_layout: Use inline code for Doxy
This avoids Doxygen to interpret <i> and others that look like XML tags
as those, fixing a warning about unknown tags.
2022-10-17 09:55:19 +02:00
Marvin Scholz f29dde49d2 avutil/channel_layout: Group pre-defined channel layouts 2022-10-17 09:51:47 +02:00
Marvin Scholz 6c2ae2e994 avutil/channel_layout: Group deprecated functions
Makes it a bit easier to spot the deprecated ones when
looking at the overview.
2022-10-17 09:51:47 +02:00
Marvin Scholz 57c8722a47 avutil/channel_layout: Move to its own group
Before it was cluttering the general avutil Audio group page.
2022-10-17 09:51:47 +02:00
Marvin Scholz 2b51b1829d avutil/channel_layout: Remove bogus closing group 2022-10-17 09:51:47 +02:00
Andreas Rheinhardt e4beb307ab avutil/channel_layout: Don't mention dead project
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-03 23:19:47 +02:00
James Almer 299253ae1b avutil/channel_layout: move and improve the comment about unknown orders
Don't place it as doxy specific for the order field, and generalize it both to
also cover already defined orders and to not make it seem like the user is
required to handle a layout they don't fully support or understand.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-28 12:21:18 -03:00
James Almer 05cff214b9 avutil/channel_layout: mention how the API user should treat channel orders it does not understand
In case new orders are added in the future, existing library users can still
use the layout simply by ignoring everything but the channel count in it, so
make this explicit.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-22 10:22:19 -03:00
Vittorio Giovara 886847afa0 channel_layout: add support for Ambisonic
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:47 -03:00
Anton Khirnov 086a804806 avutil/channel_layout: Add a new channel layout API
The new API is more extensible and allows for custom layouts.
More accurate information is exported, eg for decoders that do not
set a channel layout, lavc will not make one up for them.

Deprecate the old API working with just uint64_t bitmasks.

Expanded and completed by Vittorio Giovara <vittorio.giovara@gmail.com>
and James Almer <jamrial@gmail.com>.
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
Jan Ekström 34de0abbe7 avutil/channel_layout: add 22.2 layout
Requires some extraneous top side and bottom front channels to be
defined.

According to STD-B59v2, the defined channel layout is:
- FL
- FR
- FC
- LFE1
- BL
- BR
- FLc
- FRc
- BC
- LFE2
- SiL
- SiR
- TpFL
- TpFR
- TpFC
- TpC
- TpBL
- TpBR
- TpSiL
- TpSiR
- TpBC
- BtFC
- BtFL
- BtFR
2020-08-04 00:17:56 +03:00
Marton Balint c4618f842a avutil/channel_layout: add av_get_extended_channel_layout
Return a channel layout and the number of channels based on the specified name.

This function is similar to av_get_channel_layout(), but can also parse unknown
channel layout specifications.

Unknown channel layout specifications are a decimal number and a capital 'C'
suffix, in order to not break compatibility with the lowercase 'c' suffix,
which is used for a guessed channel layout with the specified number of
channels.

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-01-24 23:51:36 +01:00
Marton Balint 5049f05f27 avutil/channel_layout: fix remains of old syntax in docs and comments
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-01-24 23:51:36 +01:00
Hendrik Leppkes fd2977d85f Merge commit 'e23f84d9652474353d8bbc42787a56ec1991908f'
* commit 'e23f84d9652474353d8bbc42787a56ec1991908f':
  channel_layout: Add a 16channel default layout

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-24 10:40:24 +02:00
Luca Barbato e23f84d965 channel_layout: Add a 16channel default layout
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-23 21:44:38 +02:00
Timothy Gu beed4ac110 channel_layout: doxy: merge functions with macros
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-04 22:06:49 +02:00
Michael Niedermayer 751385fe3f Merge commit '5c437fb'
* commit '5c437fb':
  lavu: Add values for various Dolby flags to the AVMatrixEncoding enum.

Conflicts:
	doc/APIchanges
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 21:55:58 +01:00
Tim Walker 5c437fb672 lavu: Add values for various Dolby flags to the AVMatrixEncoding enum. 2014-01-05 16:41:56 +01:00
Stefano Sabatini d96e377c39 lavu/channel_layout: change av_get_channel_layout() behavior at the next bump
The new syntax is preferred since it allows backward syntax compatibility
with libswr when switching to the new option handling code with
AV_OPT_TYPE_CHANNEL_LAYOUT.

With the new parser the string:
1234

is interpreted as a channel layout mask, rather than as a number of
channels, and thus it's compatible with the current way to set a channel
layout as an integer (e.g. for the icl and ocl options) making use of
integer option values.

ff_get_channel_layout() with compat=0 will be used in the
AV_OPT_TYPE_CHANNEL handler code.

The user is encouraged to switch to the new forward compatible syntax,
which requires to put a trailing "c" when specifying a layout as a number
of channels.
2013-10-17 18:03:09 +02:00
Nicolas George 2cb227f6a2 lavu/channel_layout: document the semantic of layouts. 2012-12-02 18:51:04 +01:00
Michael Niedermayer 03b078721c Merge commit '97bf7c03b1338a867da52c159a2afecbdedcfa88'
* commit '97bf7c03b1338a867da52c159a2afecbdedcfa88':
  doc: git-howto: Leave reviewers time to react before pushing patches
  Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
  lavu: rename audioconvert.* to channel_layout.* and deprecate audioconvert.h

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/git-howto.texi
	ffmpeg_filter.c
	libavcodec/flacdec.c
	libavcodec/imc.c
	libavcodec/mpegaudiodec.c
	libavcodec/utils.c
	libavfilter/asrc_anullsrc.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/buffer.c
	libavutil/Makefile
	libavutil/audioconvert.h
	libavutil/channel_layout.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-12 11:32:11 +01:00
Justin Ruggles 5980f5dd18 lavu: rename audioconvert.* to channel_layout.* and deprecate audioconvert.h 2012-11-11 13:35:12 -05:00