summaryrefslogtreecommitdiff
path: root/libavcodec/internal.h
Commit message (Collapse)AuthorAge
* avcodec/decode: port last_pkt_props to AVFifoBufferJames Almer2021-03-03
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: shedule old encoding/decoding API for removalAnton Khirnov2021-01-26
| | | | | | | | It has been deprecated for 4 years and certain new codecs do not work with it. Also include AVCodecContext.refcounted_frames, as it has no effect with the new API.
* avcodec/utils: Remove ff_codec_open2_recursive()Andreas Rheinhardt2020-12-04
| | | | | | | | | | | | | | | This function existed to enable codecs with non-threadsafe init functions to initialize other codecs despite the fact that normally no two codecs with non-threadsafe init functions can be initialized at the same time (there is a mutex guarding this). Yet there are no users of this function any more as all users have been made thread-safe (switching away from ff_codec_open2_recursive() was required for this as said function requires the caller to hold the lock to the mutex guarding the initializations and this is only true for codecs with the FF_CODEC_CAP_INIT_THREADSAFE flag unset); so remove it. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc: un-avpriv avpriv_bprint_to_extradata()Anton Khirnov2020-10-28
| | | | | | It has not been used outside of lavc since 6f69f7a8bf6. Also, move it to the only place where it is used.
* avcodec/decode: use a packet list to store packet propertiesJames Almer2020-09-15
| | | | | | | | | Keeping only the latest packet fed to the decoder works only for decoders that return a frame immediately after every consumed packet. Decoders that consume several packets before they return a frame will fill said frame with properties taken from the last consumed packet instead of the earliest. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: move the ff_decode_frame_props() prototype to the proper headerJames Almer2020-08-20
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/utils: calculate frame number of HEVC if the framerate > 30FPSLimin Wang2020-08-16
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: move ff_alloc_a53_sei() to atsc_53James Almer2020-08-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/internal: remove unused out_frame field from DecodeSimpleContextJames Almer2020-07-01
| | | | | | It was introduced in 061a0c14bb but apparently never used Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/utils: add ff_alloc_timecode_sei() for hevc timecode seiLimin Wang2020-06-28
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/encode: restructure the old encode APIJames Almer2020-06-18
| | | | | | | Following the same logic as 061a0c14bb, this commit turns the old encode API into a wrapper for the new one. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/encode: restructure the core encoding codeJames Almer2020-06-18
| | | | | | | | | | | | | | | | This commit follows the same logic as 061a0c14bb, but for the encode API: The new public encoding API will no longer be a wrapper around the old deprecated one, and the internal API used by the encoders now consists of a single receive_packet() callback that pulls frames as required. amf encoders adapted by James Almer librav1e encoder adapted by James Almer nvidia encoders adapted by James Almer MediaFoundation encoders adapted by James Almer vaapi encoders adapted by Linjie Fu v4l2_m2m encoders adapted by Andriy Gelman Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/internal: move packet related functions to their own headerJames Almer2020-06-02
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/encode: Remove ff_alloc_packetAndreas Rheinhardt2020-06-01
| | | | | | | It is no longer used anymore. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/decode: remove unused AVCodecInternal compat_decode fieldJames Almer2020-05-09
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: use a single list bsf for codec decode bsfsMarton Balint2020-05-02
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavc: do not implicitly share the frame pool between threadsAnton Khirnov2020-04-10
| | | | | | | | | | | | | Currently the frame pool used by the default get_buffer2() implementation is a single struct, allocated when opening the decoder. A pointer to it is simply copied to each frame thread and we assume that no thread attempts to modify it at an unexpected time. This is rather fragile and potentially dangerous. With this commit, the frame pool is made refcounted, with the reference being propagated across threads along with other context variables. The frame pool is now also immutable - when the stream parameters change we drop the old reference and create a new one.
* lavc: replace AVCodecInternal.allocate_progress with an internal capAnton Khirnov2020-04-10
| | | | This is a constant codec property, so a capability flag is more appropriate.
* lavc/dvdsubdec: Move palette parsing to new functionMichael Kuron2020-02-04
| | | | | Signed-off-by: Michael Kuron <michael.kuron@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/avcodec: Add codec_tags array to AVCodecMichael Niedermayer2020-01-22
| | | | | | | | This allows the fuzzer to target meaningfull codec tags instead of hunting the 4gb space, which it seems to have problems with. Suggested-by: James Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add a Producer Reference Time AVPacketSideData typeJames Almer2020-01-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: add a flags parameter to ff_reget_buffer()James Almer2019-09-04
| | | | | | | | | | Some decoders may not need a writable buffer in some specific cases, but only a reference to the existing buffer with updated frame properties instead, for the purpose of returning duplicate frames. For this, the FF_REGET_BUFFER_FLAG_READONLY flag is added, which will prevent potential allocations and buffer copies when they are not needed. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/internal: Bump sane_nb_chanelsMichael Niedermayer2019-08-21
| | | | | | | | This allows decoding more als reference samples Suggested-by: Thilo Borgmann <thilo.borgmann@mail.de> Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add AV_CODEC_FLAG_DROPCHANGED to flagsGyan Doshi2019-04-20
| | | | Discard decoded frames which differ from first decoded frame in stream.
* avcodec/utils : add ff_int_from_list_or_default funcMartin Vignali2018-12-04
| | | | to check valid value, or return default_value
* avcodec/internal: increase FF_SANE_NB_CHANNELS to 256Marton Balint2018-07-13
| | | | | | | | | | This was reduced from 128 in libav commit 192f1984b1a93aa08af053b8f9ab4950f307bd5d, but since we support unknown channel layouts, we can increase this limit. Fixes ticket #6332. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec: remove unnecessary calls to ff_init_buffer_info()James Almer2018-02-14
| | | | | | | | And remove the function altogether while at it. It's a duplicate of another. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: remove complex debug code around avcodec init lockingwm42017-12-26
| | | | | | | | | | | | | | | | | | | | | This is just a lot of complicated and confusing code that had no purpose anymore. Also, the functions return values were checked only sometimes. Locking shouldn't fail anyway, so remove the return values. Barely any other pthread lock calls check the return value (including more important code that is more likely to fail horribly if locking fails). It could be argued that it might be helpful in some debugging situations, or when the user built FFmpeg without thread support against all good advice. But there are dummy atomics too, so the atomic check won't help with ensuring correctness absolutely. You gain very little. Also, for debugging, you can just raise the ASSERT_LEVEL, and then libavutil/thread.h will redefine the locking functions to explicitly check the return values.
* lavc, lavf: move avformat static mutex from avcodec to avformatwm42017-12-26
| | | | | | | | It's completely absurd that libavcodec would care about libavformat locking, but it was there because the lock manager was in libavcodec. This is more stright forward. Changes ABI, but we don't require ABI compatibility currently.
* avcodec: add stride alignment needed for AVX-512James Darnley2017-12-24
|
* Revert "libavcodec/utils.c: simplify avcodec locking with atomics"Hendrik Leppkes2017-12-11
| | | | | | | | | | This reverts commit 590136e78da3d091ea99ab5432543d47a559a461. Atomics are not required for this variable, because it is protected through the lock manager, and the use of atomics here is not compatible with the c11 emulation wrappersi. Fixes FATE on MSVC, among other setups which use the compat wrappers.
* lavc: Use hardware config information in ff_get_format()Mark Thompson2017-11-26
| | | | | | | | | | | | | | | This removes the dependency that hardware pixel formats previously had on AVHWAccel instances, meaning only those which actually do something need exist after this patch. Also updates avcodec_default_get_format() to be able to choose hardware formats if either a matching device has been supplied or no additional external configuration is required, and avcodec_get_hw_frames_parameters() to use the hardware config rather than searching the old hwaccel list. The FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS mechanism is deleted because it no longer does anything (the codec already contains the pointers to the matching hwaccels).
* libavcodec/utils.c: simplify avcodec locking with atomicsRostislav Pehlivanov2017-11-26
| | | | | | Also makes it more robust than using volatiles. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* Merge commit '3152058bf1dca318898550efacf0286f4836cae6'James Almer2017-11-19
|\ | | | | | | | | | | | | * commit '3152058bf1dca318898550efacf0286f4836cae6': libavcodec: Don't use dllexport, only dllimport when building DLLs Merged-by: James Almer <jamrial@gmail.com>
| * libavcodec: Don't use dllexport, only dllimport when building DLLsMartin Storsjö2017-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only purpose of dllexport (which is set while building the library that exports the symbols) is to have the linker automatically export such symbols into a DLL without using a def file - it doesn't affect the generated code. For both MSVC and mingw builds, this isn't essential since we override what symbols to export via an autogenerated def file instead. Update a comment in configure to refer to the right concept. With lld, this avoids warnings about duplicate export directives, when some symbols are requested to be exported both via dllexport attributes and via the autogenerated def file. This also reduces the number of lines of code marginally. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'accb06120c13a4ead442464d96f2fa318fa07a4e'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'accb06120c13a4ead442464d96f2fa318fa07a4e': configure: Use dllexport/dllimport for data symbols across DLLs with mingw Merged-by: James Almer <jamrial@gmail.com>
| * configure: Use dllexport/dllimport for data symbols across DLLs with mingwMartin Storsjö2017-08-31
| | | | | | | | | | | | | | | | | | | | | | This avoids having to use pseudo relocations. The version script used for exporting functions is skipped as soon as the set of object files contains symbols marked with dllexport, therefore we need to use makedef to produce the full list of symbols to be exported. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0': msvc: Properly specify dllexport for data symbols shared across dll boundaries Merged-by: James Almer <jamrial@gmail.com>
| * msvc: Properly specify dllexport for data symbols shared across dll boundariesMartin Storsjö2017-08-31
| | | | | | | | | | | | | | | | | | We currently only have exported data symbols within libavcodec, but the concept is easy to extend to other libraries if necessary. The attribute declaration needs to be in a private header though, since we can't use CONFIG_SHARED in public installed headers. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec: allow multiple hwaccels for the same codec/pixfmtwm42017-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVHWAccels are looked up using a (codec_id, pixfmt) tuple. This means it's impossible to have 2 decoders for the same codec and using the same opaque hardware pixel format. This breaks merging Libav's CUVID hwaccel. FFmpeg has its own CUVID support, but it's a full stream decoder, using NVIDIA's codec parser. The Libav one is a true hwaccel, which is based on the builtin software decoders. Fix this by introducing another field to disambiguate AVHWAccels, and use it for our CUVID decoders. FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS makes this mechanism backwards compatible and optional.
* | Merge commit '94eed68ace9f2416af8457fcbf142b175928c06b'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit '94eed68ace9f2416af8457fcbf142b175928c06b': lavc: Drop deprecated options moved to private contexts Merged-by: James Almer <jamrial@gmail.com>
| * lavc: Drop deprecated options moved to private contextsVittorio Giovara2017-03-23
| | | | | | | | Deprecated in 10/2014 and 07/2015.
* | Merge commit 'cbebc3251bc2544b469e0dcb176bc04779d8866c'James Almer2017-10-23
|\| | | | | | | | | | | | | * commit 'cbebc3251bc2544b469e0dcb176bc04779d8866c': lavc: Drop deprecated public symbols Merged-by: James Almer <jamrial@gmail.com>
* | avcodec: remove ABI portion of the side data merging APIJames Almer2017-10-22
| | | | | | | | | | | | The actual API is left in place until the deprecation period ends. Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/pthread_slice: add ff_slice_thread_execute_with_mainfunc()Ilia Valiakhmetov2017-09-08
| | | | | | | | | | Signed-off-by: Ilia Valiakhmetov <zakne0ne@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | avcodec/internal: move FF_QSCALE_TYPE defines from avcodec.hJames Almer2017-09-01
| | | | | | | | | | | | Their use in the public header is deprecated and will be removed, but they are still needed by some codecs at least as long as qscale related deprecated fields in the AVFrame struct remain in the tree.
* | Merge commit '019ab88a95cb31b698506d90e8ce56695a7f1cc5'James Almer2017-05-08
|\| | | | | | | | | | | | | * commit '019ab88a95cb31b698506d90e8ce56695a7f1cc5': lavc: add an option for exporting cropping information to the caller Merged-by: James Almer <jamrial@gmail.com>
| * lavc: add an option for exporting cropping information to the callerAnton Khirnov2017-01-12
| | | | | | | | | | Also, add generic code for handling cropping, so the decoders can export just the cropping size and not bother with the rest.
* | avcodec: Avoid splitting side data repeatedlyMichael Niedermayer2017-05-06
| | | | | | | | | | | | | | | | Fixes Timeout Fixes: 508/clusterfuzz-testcase-6245747678773248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/internal: update FF_CODEC_CAP_SETS_PKT_DTS doxyJames Almer2017-05-01
| | | | | | | | The code it refers to was moved to decode.c in 00fb745a10a151791ce2e49ba3e463bd17ea9251