summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
Commit message (Collapse)AuthorAge
* avcodec/utils: fix packet duration of frames with discarded paddingsMarton Balint2016-03-28
| | | | | Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavc/utils: fix extra ASS sanity check in convert_sub_to_old_ass_form()Clément Bœsch2016-03-07
|
* avcodec/utils: Fix memleak on error in convert_sub_to_old_ass_form()Michael Niedermayer2016-03-05
| | | | | | Fixes CID1355116 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: Fix 'ISO C90 forbids mixed declarations and code'Michael Niedermayer2016-03-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Add utils testMichael Niedermayer2016-02-29
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Document and validate AVFrame plane pointers.Reimar Döffinger2016-02-28
| | | | | | | | | | Check that the required plane pointers and only those are set up. Currently does not enforce anything for the palette pointer of pseudopal formats as I am unsure about the requirements. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* avcodec/utils: Check that the video data[] arrays are NULL on the input to ↵Michael Niedermayer2016-02-27
| | | | | | | | | get_buffer_internal() This should return an error to the decoder if the struct it tried to getbuffer is dirty Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: Check all data[] pointers in video_get_buffer() not just the ↵Michael Niedermayer2016-02-27
| | | | | | first Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc: deprecate decoded ass subtitles with timingsClément Bœsch2016-02-26
|
* lavc: allow subtitle text format to be ASS without timingClément Bœsch2016-02-26
|
* avcodec/utils: Merge identical if conditionsMichael Niedermayer2016-02-26
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec:add packet level support for mastering metadataNeil Birkbeck2016-02-25
| | | | | | | | | Some containers, like webm/mkv, will contain this mastering metadata. This is analogous to the way 3D fpa data is handled (in frame and packet side data). Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '7b3214d0050613bd347a2e41c9f78ffb766da25e'Derek Buitenhuis2016-02-24
|\ | | | | | | | | | | | | * commit '7b3214d0050613bd347a2e41c9f78ffb766da25e': lavc: add a field for passing AVHWFramesContext to encoders Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavc: add a field for passing AVHWFramesContext to encodersAnton Khirnov2016-02-14
| |
* | Add GBRAP12 pixel formatKieran Kunhya2016-02-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: Fix a typo.Carl Eugen Hoyos2016-02-14
| |
* | avcodec: only warn about hwaccel with frame threadsAndreas Cadhalpun2016-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | VLC uses hwaccel with frame threads and it works fine, but returning an error here made it fail. This regression was introduced in commit 31741ae. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Warning message text by nevcairiel Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Add AV_PIX_FMT_GBRAP16?E to avcodec_align_dimensions2()Michael Niedermayer2016-02-07
| | | | | | | | | | Found-by: kierank Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Check the return code of av_image_fill_linesizes()Michael Niedermayer2016-02-03
| | | | | | | | | | | | Fixes CID1271741 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/utils: fix instanciate/instantiate typoClément Bœsch2016-01-30
| |
* | libavcodec/util: Fix timebase overflow checkDerek Buitenhuis2016-01-27
| | | | | | | | | | | | It could accidentally divide by zero if num was zero. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '7486418683bd2477772e03aab573cf846c12fb0d'Derek Buitenhuis2016-01-27
|\| | | | | | | Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavc: Make sure that the effective timebase would not overflowArttu Ylä-Outinen2016-01-19
| | | | | | | | | | | | | | In the unlikely situation the user decides to set ticks_per_frame and timebase to a value large enough to overflow. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-27
| | | | | | | | | | | | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec/utils: run ff_frame_thread_encoder_init() only for encodersMichael Niedermayer2016-01-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Print the whitelists if entities are not found on themMichael Niedermayer2016-01-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Check bits_per_raw_sample on video encoder openMichael Niedermayer2016-01-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'cea1eef25c3310a68dd327eb74aae14ad3c2ddef'Hendrik Leppkes2016-01-01
|\| | | | | | | | | | | | | * commit 'cea1eef25c3310a68dd327eb74aae14ad3c2ddef': lavc: get the profile name through the codec descriptor in avcodec_string() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: get the profile name through the codec descriptor in avcodec_string()Anton Khirnov2015-12-12
| |
* | Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'Hendrik Leppkes2016-01-01
|\| | | | | | | | | | | | | * commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: add profiles to AVCodecDescriptorAnton Khirnov2015-12-12
| | | | | | | | | | The profiles are a property of the codec, so it makes sense to export them through AVCodecDescriptors, not just the codec implementations.
| * lavc: print the name of the codec, not its implementation, in avcodec_stringAnton Khirnov2015-12-12
| |
* | avcodec: properly check pkt_timebase for validityHendrik Leppkes2015-12-28
| | | | | | | | | | | | Unset/invalid timebases have a zero numerator. This makes the checks consistent with other timebase checks and fixes an integer division by 0.
* | 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>