Commit Graph
100 Commits
Author SHA1 Message Date
Anton KhirnovandJames Almer 190c78680d lvf: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:34 -03:00
Anton KhirnovandJames Almer e271d534e3 libcdio: port to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:34 -03:00
Anton KhirnovandJames Almer 368f50404d jack: port to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton KhirnovandJames Almer ef65e450d2 ircam: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton KhirnovandJames Almer 8950839aac ifv: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton KhirnovandJames Almer 8f835935b3 hcom: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton KhirnovandJames Almer 52023821b9 genh: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton KhirnovandJames Almer 2f18760840 gdv: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton KhirnovandJames Almer 972763ef45 g726: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:33 -03:00
Anton KhirnovandJames Almer 07cdec42d1 fsb: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:32 -03:00
Anton KhirnovandJames Almer 9543161800 framehash: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:32 -03:00
Anton KhirnovandJames Almer d68f938c2d epafdec: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:32 -03:00
Anton KhirnovandJames Almer 84f957e6b2 dsfdec: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:31 -03:00
Anton KhirnovandJames Almer 7e531b24de dtshddec: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:31 -03:00
Anton KhirnovandJames Almer 0e289fafa7 dhav: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:31 -03:00
Anton KhirnovandJames Almer 6a9668e17f dcstr: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:31 -03:00
Anton KhirnovandJames Almer 466a9af1f9 codec2: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:31 -03:00
Anton KhirnovandJames Almer 658102a823 brstm: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:31 -03:00
Anton KhirnovandJames Almer 8269fbcb7a boa: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:31 -03:00
Anton KhirnovandJames Almer fc5e819f65 bit: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:30 -03:00
Anton KhirnovandJames Almer 3cd1ad5c9e avr: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:30 -03:00
Anton KhirnovandJames Almer 820d73cc0e ast: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:30 -03:00
Anton KhirnovandJames Almer 521cca1333 argo: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:30 -03:00
Anton KhirnovandJames Almer 057f237ca4 aptxdec: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:30 -03:00
Anton KhirnovandJames Almer 00c5526fc8 aixdec: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:30 -03:00
Anton KhirnovandJames Almer 14bbc23b68 afc: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:30 -03:00
Anton KhirnovandJames Almer a4630dc046 ads: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer ced933a394 adp: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer 06bc48a878 act: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer f696343d13 acm: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer c72095739c aa: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer b49e80a649 3dostr: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer ac10e3c47c lavf: convert the generic layer to the new channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer c30e22c9fb lavf: add a temporary compat layer for the channel layout API change
Mediates between old-style (de)muxers and new-style callers. Will be
removed once all the (de)muxers are converted to the new API.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton KhirnovandJames Almer db6efa1815 avframe: switch to the new channel layout API
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
Anton KhirnovandJames Almer 09b5d3fb44 lavc: deprecate channel count/layout changing side data
They are incompatible with the new channel layout scheme and no decoder
uses them.

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
Anton KhirnovandJames Almer 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
Anton KhirnovandJames Almer 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
Anton Khirnov 09ca2f1950 lavu/hwcontext: clarify behavior on av_hwframe_map() failure
Clear anything that av_hwframe_map() might have done to the destination
frame, but leave caller-provided fields unchanged.
2022-02-17 11:05:44 +01:00
Anton Khirnov 6fc5e5a52c lavu/hwcontext_opencl: clear dangling pointers on map failure 2022-02-17 11:05:44 +01:00
Anton Khirnov e85958ece8 fftools/ffmpeg: fix (a)buffer src names 2022-02-15 10:16:16 +01:00
Anton Khirnov d512115267 lavu/fifo: add a test for _cb functions
Makes an auto-growing FIFO and performs a sequence of randomly-sized
writes/peeks/reads.
2022-02-15 10:16:16 +01:00
Anton Khirnov e9acff8a01 lavu/fifo: fix a corner case in av_fifo_grow2()
When the fifo is grown by exactly the current write offset, it would end
up with offset_w = nb_elems. If av_fifo_write_from_cb() is called in
such a state, the user callback would get callled with *nb_elems=0,
which will then cause the write to return without writing anything.
2022-02-15 10:16:16 +01:00
Anton Khirnov 73b01844c2 lavu/hwcontext_qsv: fix a potential infinite loop
Current code will loop forever if MFXVideoVPP_Init() fails.
Also, simplify the code.
2022-02-15 10:16:16 +01:00
Anton Khirnov b648ece34b lavc: deprecate FF_IDCT_NONE
It was only used by XvMC.
2022-02-15 10:16:16 +01:00
Anton Khirnov cefa595361 lavu/pixfmt: deprecate AV_PIX_FMT_XVMC
It is no longer used for anything.
2022-02-15 10:16:16 +01:00
Anton Khirnov 41d25efade lavc/xvmc.h: mark the header as deprecated 2022-02-15 10:16:16 +01:00
Anton Khirnov be95df12bb lavc/mpeg*: drop the XvMC hwaccel code
XvMC was last relevant over 10 years ago, if ever. There is no reason to
use it today.
2022-02-15 10:16:15 +01:00
Anton Khirnov aeaefc3728 lavfi/qsvpp: fix after 85c938fa28 2022-02-09 09:40:33 +01:00
Anton KhirnovandAndreas Rheinhardt a10f1aec1f avutil/fifo: Deprecate old FIFO API
Users should switch to the superior AVFifo API.

Unfortunately AVFifoBuffer fields cannot be marked as deprecated because
it would trigger a warning wherever fifo.h is #included, due to
inlined av_fifo_peek2().
2022-02-07 00:31:49 +01:00
Anton KhirnovandAndreas Rheinhardt e6469e68cc ffmpeg: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt bdf9ed41fe ffplay: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt c65c2ed01d lavfi/vf_deshake_opencl: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 85c938fa28 lavfi/qsvvpp: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 90eef1c3de lavu/threadmessage: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt d1bd189c63 lavu/audio_fifo: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 082136209c lavu/audio_fifo: drop an unnecessary include
Nothing in audio_fifo.h uses anything from fifo.h
2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt d46fd9640f lavd/jack: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 36117968ad lavf/async: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 70a1774f1a lavf/udp: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 5fe2c37734 lavf/swfenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt ea511196a6 lavf/mpegenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 60414afc9d lavf/dvenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 7e2be84a94 lavf/dvenc: return an error on audio/video desync 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 35e52d21dc lavc/qsvenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 08181624e0 lavc/qsvdec: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 587545c9e0 lavc/nvenc: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 9ef4b6699b lavc/libvpxenc: remove unneeded context variable
discard_hdr10_plus is 0 IFF hdr10_plus_fifo is non-NULL, so we can test
for the latter and avoid an extra variable.
2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 4b066b53b2 lavc/libvpxenc: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt a718d84e92 lavc/libvorbisenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 6eaf5cd00a lavc/cuviddec: convert to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt de40342c04 lavc/cuviddec: do not reallocate the fifo unnecessarily 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 70611d7f3b lavc/amfenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 37e70d4802 lavc/avcodec: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 93ed375574 lavu/tests/fifo: switch to the new API 2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 14429f8fec lavu/fifo: add a flag for automatically growing the FIFO as needed
This will not increase the FIFO beyond 1MB, unless the caller explicitly
specifies otherwise.
2022-02-07 00:31:23 +01:00
Anton KhirnovandAndreas Rheinhardt 7329b22c05 lavu/fifo: Add new AVFifo API based upon the notion of element size
Many AVFifoBuffer users operate on fixed-size elements (e.g. pointers),
but the current FIFO API deals exclusively in bytes, requiring extra
complexity in all these callers.

Add a new AVFifo API creating a FIFO with an element size
that may be larger than a byte. All operations on such a FIFO then
operate on complete elements.

This API does not reuse AVFifoBuffer and its API at all, but instead uses
an opaque struct called AVFifo. The AVFifoBuffer API will be deprecated
in a future commit once all of its users have been switched to the new
API.

Not reusing AVFifoBuffer also allowed to use the full range of size_t
from the beginning.
2022-02-07 00:30:22 +01:00
Anton KhirnovandAndreas Rheinhardt 5939c8d361 lavu/fifo: disallow overly large fifo sizes
The API currently allows creating FIFOs up to
- UINT_MAX: av_fifo_alloc(), av_fifo_realloc(), av_fifo_grow()
- SIZE_MAX: av_fifo_alloc_array()
However the usable limit is determined by
- rndx/wndx being uint32_t
- av_fifo_[size,space] returning int
so no FIFO should be larger than the smallest of
- INT_MAX
- UINT32_MAX
- SIZE_MAX
(which should be INT_MAX an all commonly used platforms).
Return an error on trying to allocate FIFOs larger than this limit.
2022-02-07 00:29:05 +01:00
Anton KhirnovandAndreas Rheinhardt d0f0d61392 lavc/svq3: stop including h264dec.h
The only thing that is actually used directly from there is the
PART_NOT_AVAILABLE constant, which can be moved to h264pred.h.

Otherwise it only depends on other indirectly included headers.
2022-01-26 15:30:28 +01:00
Anton KhirnovandAndreas Rheinhardt 359912f0df lavc/x86/h264_qpel: stop unnecessarily including h264dec 2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt 76b8ae2e22 lavc/vdpau: stop unnecessarily including h264dec 2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt ded77f5654 lavc/h264: move MB_TYPE defs from h264dec.h to h264_parse
Allows to stop including h264dec.h in h264data.c.
2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt 2f1716dcd6 lavc/h264_parse: stop including h264dec.h
It is unnecessary and only files that are parts of the decoder (as
opposed to standalone code called by the decoder) are allowed to include
h264dec.h
2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt e1027aba68 lavc/h264data.h: stop including h264dec.h
This header does not need anything from there.
2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt d552f2535b lavc/h264: move some shared code from h264dec to h264_parse 2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt df2ee38178 lavc/h264_parser: add missing headers 2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt b6f3334a13 lavc/h264: replace MAX_DELAYED_PIC_COUNT by H264_MAX_DPB_FRAMES 2022-01-26 15:23:30 +01:00
Anton KhirnovandAndreas Rheinhardt ef4537bd1b lavc/h264: replace MAX_DELAYED_PIC_COUNT with FF_ARRAY_ELEMS where appropriate 2022-01-26 15:23:29 +01:00
Anton KhirnovandAndreas Rheinhardt 5484c502db lavc/h264dec.h: Move MMCOOpcode to h264_parse.h
Both parser and decoder use it, so h264_parse is the proper place
for it.
2022-01-26 15:23:08 +01:00
Anton KhirnovandAndreas Rheinhardt b05cebe602 lavc/h264: replace MAX_MMCO_COUNT with H264_MAX_MMCO_COUNT
They apparently serve the same purpose; the latter is one larger and has
a comment explaining how the value is derived, so seems more
trustworthy.
2022-01-26 15:23:08 +01:00
Anton Khirnov 137c808f1a lavu/hwcontext_vulkan: clear dangling pointers on map failure 2022-01-21 09:44:01 +01:00
Anton Khirnov 2f0a214a62 configure: link to libatomic when it's present
C11 atomics in some configurations (e.g. 64bit operations on ppc64 with
GCC) require linking to libatomic.

Fixes #9275
2022-01-21 09:28:59 +01:00
Anton Khirnov 9e4693a1cb lavf/network: log ff_listen() errors to proper contexts rather than NULL 2022-01-21 09:25:05 +01:00
Anton Khirnov d2519e8625 lavf/network: log ff_socket() errors to proper contexts rather than NULL 2022-01-21 09:25:05 +01:00
Anton Khirnov 93b4cc38b0 lavf/udp: log net errors to proper contexts rather than NULL 2022-01-21 09:25:05 +01:00
Anton Khirnov 3c2b674468 lavf/udp: do not return an uninitialized value from udp_open() 2022-01-11 09:07:39 +01:00
Anton Khirnov f480c43dfa lavu/fifo: return errors on trying to read/write too much
Trying to write too much will currently overwrite previous data. Trying
to read too much will either av_assert2() in av_fifo_drain() or return
old data. Trying to peek too much will either av_assert2() in
av_fifo_generic_peek_at() or return old data.

Return an error code in all these cases, which is safer and more
consistent.
2022-01-10 16:11:34 +01:00
Anton Khirnov 53f513c60b lavu/fifo: drop useless comments
This object was never intended to be thread-safe, so these carry no
useful information.
2022-01-10 16:11:18 +01:00
Anton Khirnov 549ccea54e lavu/fifo: do not copy the whole fifo when reallocating
av_realloc() the buffer and only move the part of the ring buffer that
needs it. Also avoids allocating a temporary fifo.
2022-01-10 16:05:57 +01:00
Anton Khirnov 5010c481d1 lavu/fifo: simplify av_fifo_alloc()
Turn it into a wrapper around av_fifo_alloc_array().
2022-01-10 16:05:20 +01:00