summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
Commit message (Collapse)AuthorAge
* Merge commit '11c9bd633f635f07a762be1ecd672de55daf4edc'Hendrik Leppkes2015-12-17
|\ | | | | | | | | | | | | * commit '11c9bd633f635f07a762be1ecd672de55daf4edc': libopenh264enc: export CPB props side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * libopenh264enc: export CPB props side dataAnton Khirnov2015-12-06
| |
* | Merge commit 'f0b769c16daafa64720dcba7fa81a9f5255e1d29'Hendrik Leppkes2015-12-17
|\| | | | | | | | | | | | | * commit 'f0b769c16daafa64720dcba7fa81a9f5255e1d29': lavc: add a packet side data type for VBV-like parameters Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add a packet side data type for VBV-like parametersAnton Khirnov2015-12-06
| |
* | Merge commit '84adab333cddeefc3cfd843089dee23f58bd372c'Hendrik Leppkes2015-12-17
|\| | | | | | | | | | | | | * commit '84adab333cddeefc3cfd843089dee23f58bd372c': lavc: add stream-global packet side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add stream-global packet side dataAnton Khirnov2015-12-06
| | | | | | | | This is similar to what is done for AVStream.
* | lavc/utils: use AVPixFmtDescriptor to probe palette formatsMatthieu Bouron2015-12-15
| | | | | | | | | | Also use the input frame format instead of the AVCodecContext one according to the documentation of AVCodecContext.get_buffer2().
* | lavc, lavu: use avutil/thread.h instead of redundant conditional includesClément Bœsch2015-12-07
| |
* | avcodec/utils: Fix overflow in get_bit_rates computationsMichael Niedermayer2015-12-05
| | | | | | | | | | | | | | Fixes: 129ca3e28d73af7b1e24a9d4118e7a2d/signal_sigabrt_7ffff6ae7cc9_836_762b310fc3ef6087bd7771e5d8e90b9b.asf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Clear dimensions in ff_get_buffer() on failureMichael Niedermayer2015-11-28
| | | | | | | | | | | | | | | | Fixes out of array access Fixes: 482d8f2fd17c9f532b586458a33f267c/asan_heap-oob_4a52b6_7417_1d08d477736d66cdadd833d146bb8bae.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()Michael Niedermayer2015-11-28
| | | | | | | | | | | | | | | | Fixes integer overflow Fixes: 3a45b2ae02f2cf12b7bd99543cdcdae5/asan_heap-oob_1dff502_8022_899f75e1e81046ebd7b6c2394a1419f4.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Better check for channels in av_get_audio_frame_duration()Michael Niedermayer2015-11-14
| | | | | | | | | | | | | | | | Fixes integer overflow Fixes: 0c2625f236ced104d402b4a03c0d65c7/asan_generic_274e1ce_5990_9314e7a67c26aecf011b178ade9f217c.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: add ADPCM AICA decoderPaul B Mahol2015-10-29
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
| |
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-27
|\| | | | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | | | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* | avcodec: disallow hwaccel with frame threadsHendrik Leppkes2015-10-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HWAccels with frame threads are fundamentally flawed in avcodecs current design, and there are several known problems ranging from image corruption to driver crashes. These problems come down to two design problems in the interaction of threads and HWAccel decoding: (1) While avcodec prevents parallel decoding and as such simultaneous access to the hardware accelerator from the decoding threads, it cannot account for the user code and its access to the hardware surfaces and the hardware itself. This can result in image corruption or even driver crashes if the user code locks image surfaces while they are being used by the decoder threads as reference frames. The current HWAccel API does not offer any way to ensure exclusive access to the hardware or the surfaces if frame threading is used. (2) Initialization of the HWAccel with frame threads is non-trivial, and many decoders had and still have issues that cause excess calls to the get_format callback. This will potentially cause duplicate HWAccel initialization, which in extreme cases can even lead to driver crashes if the HWAccel is re-initialized while the user code is actively accessing the hardware surfaces associated with it, or lead to image corruption due to lost reference frames. While both of these issues are solvable, fixing (1) would at least require a huge API redesign which would move a lot of complexity into the user code. The only reason the combination of frame threads and HWAccel was considered useful is to allow a seamless fallback to multi-threaded software decoding if the HWAccel is not available, however the issues outlined above far outweigh this. The proper solution for a fallback is to re-open the AVCodecContext with threading enabled if the HWAccel failed, which is a practice commonly used by various user applications using avcodec today already. Reviewed-by: Gwenole Beauchesne <gb.devel@gmail.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | avcodec: add SDX2 DPCM decoderPaul B Mahol2015-10-26
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '3ee2c60cc296eee3f63d7b5fee9b4332eeeac9fa'Hendrik Leppkes2015-10-22
|\| | | | | | | | | | | | | * commit '3ee2c60cc296eee3f63d7b5fee9b4332eeeac9fa': utils: Use data buffers directly instead of an AVPicture Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * utils: Use data buffers directly instead of an AVPictureVittorio Giovara2015-10-22
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'a17a7661906ba295d67afd80ac0770422e1b02b3'Hendrik Leppkes2015-10-22
|\| | | | | | | | | | | | | * commit 'a17a7661906ba295d67afd80ac0770422e1b02b3': lavc: Add data and linesize to AVSubtitleRect Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Add data and linesize to AVSubtitleRectVittorio Giovara2015-10-21
| | | | | | | | | | | | | | | | | | | | | | | | Use the new fields directly instead of the ones from AVPicture. This removes a layer of indirection which serves no pratical purpose whatsoever, and will help in removing AVPicture structure completely later. Every subtitle encoder/decoder seamlessly points to the new arrays, so it is possible to deprecate AVSubtitleRect.pict. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * avcodec: Do not lock during init if there is no init functionDerek Buitenhuis2015-10-13
| | | | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * avcodec: Do not lock during open for codecs marked as having threadsafe initDerek Buitenhuis2015-10-04
| | | | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec: rename avpriv_color_frame to ff_color_frameAndreas Cadhalpun2015-10-22
| | | | | | | | | | | | | | It is only used inside libavcodec. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec: add ADPCM PSX decoderPaul B Mahol2015-10-16
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec: Don't lock on init for codecs without an init functionDerek Buitenhuis2015-10-12
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec: remove leftover iff_byterun1 decoderAndreas Cadhalpun2015-10-12
| | | | | | | | | | | | | | | | | | | | | | It was merged with the iff_ilbm decoder in commit 929a24efff9a208a52748605eb412ffb915c1403. Define AV_CODEC_ID_IFF_BYTERUN1 as AV_CODEC_ID_IFF_ILBM for API compatibility. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec: Don't lock during open if the codec has threadsafe initDerek Buitenhuis2015-10-02
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit 'a5d58fea68b9212e0065a71939e921505504a9bb'Hendrik Leppkes2015-09-29
|\| | | | | | | | | | | | | * commit 'a5d58fea68b9212e0065a71939e921505504a9bb': lavc: reimplement avcodec_get_type() using codec descriptors Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: reimplement avcodec_get_type() using codec descriptorswm42015-09-28
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | lavc/utils: Correctly show bit_rate >INT_MAX.Carl Eugen Hoyos2015-09-15
| | | | | | | | Fixes ticket #2089.
* | lavc: Switch bitrate to 64bit unless compatibility with avconv was requested.Michael Niedermayer2015-09-15
| |
* | Merge commit '87a051f97633010f71dfc1d23d806856499bf231'Hendrik Leppkes2015-09-12
|\| | | | | | | | | | | | | * commit '87a051f97633010f71dfc1d23d806856499bf231': lavc: allow asynchronous decoders to return correct pkt_dts values Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: allow asynchronous decoders to return correct pkt_dts valueswm42015-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generic code in utils.c sets the AVFrame.pkt_dts field from the packet it was supposedly decoded. This does not have to be true for a fully asynchronous decoder like mmaldec. It could be overwritten with an incorrect value. Even if the decoder doesn't determine the DTS (but sets it to AV_NOPTS_VALUE), it's impossible to determine a correct value in utils.c. Decoders can now be marked with FF_CODEC_CAP_SETS_PKT_DTS, in which case utils.c won't overwrite the field. The decoders are expected to set this field (even if they only set it to AV_NOPTS_VALUE). Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-08
| |
* | avcodec: remove duplicate AVCodecIDsJames Almer2015-09-07
| | | | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit 'c45fcf30cfab687004ed1cdc06ebaa21f4262a0b'Hendrik Leppkes2015-09-07
|\| | | | | | | | | | | | | * commit 'c45fcf30cfab687004ed1cdc06ebaa21f4262a0b': DXV decoder Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | avcodec: remove deprecated codec id aliasesHendrik Leppkes2015-09-05
| |
* | avcodec: remove deprecated old video encode APIHendrik Leppkes2015-09-05
| |
* | avcodec: remove deprecated old audio encode APIHendrik Leppkes2015-09-05
| |
* | avcodec: remove deprecated old audio decode APIHendrik Leppkes2015-09-05
| |
* | Merge commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79': lavu: Drop deprecated duplicated AVFrame/AVCodecContext parameters Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Drop deprecated duplicated AVFrame/AVCodecContext parametersVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 10/2012.
* | Merge commit '9f90b24877016e7140b9b14e4b1acee663bb6d8a'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit '9f90b24877016e7140b9b14e4b1acee663bb6d8a': lavc: Drop deprecated get_buffer related functions Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Drop deprecated get_buffer related functionsVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 11/2012.
* | Remove left-over FF_API_DESTRUCT_PACKET cruftHendrik Leppkes2015-09-05
| |
* | Merge commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8': lavc: Drop deprecated destruct_packet related functions Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Drop deprecated destruct_packet related functionsVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 10/2012.
* | avcodec: Assert on codec->encode2 in encode_audio2lummax2015-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Assert on `avctx->codec->encode2` to avoid a SEGFAULT on the subsequent function call. avcodec_encode_video2() uses a similar assertion. Calling the wrong function on a stream is a serious inconsistency which could at other places be potentially dangerous and exploitable, it is thus safer to stop execution and not continue with such inconsistency after returning an error. Commit-message-extended-by commiter Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>