summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/bsf: make sure the AVBSFInternal stored packet is reference countedJames Almer2018-03-23
| | | | | | | | | | | | | | | | | | Some bitstream filters may buffer said packet in their own contexts for latter use. The documentation for av_bsf_send_packet() doesn't forbid feeding it non-reference counted packets, which depending on the way said packets were internally buffered by the bsf it may result in the data described in them becoming invalid or unavailable at any time. This was the case with vp9_superframe after commit e1bc3f4396, which was then promptly fixed in 37f4a093f7 and 7a02b364b6. It is still the case even today with vp9_reorder_raw. With this change the bitstream filters will not have to worry how to store or consume the packets fed to them. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/extract_extradata: don't uninitialize the H2645Packet on every ↵James Almer2018-03-22
| | | | | | | | | | processed packet Based on hevc_parser code. This prevents repeated unnecessary allocations and frees on every packet processed by the bsf. Reviewed-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg4_unpack_bframes: make sure the packet is writable when data ↵James Almer2018-03-22
| | | | | | | | | | needs to be changed Nothing currently guarantees that the packet passed to the bsf will be writable. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/cfhd: add alpha decompanding in rgba12Gagandeep Singh2018-03-22
| | | | | Alpha decompanding curve added to post process the decoded alpha channel. Fixes ticket #6265.
* avcodec/dxva2_vc1: add missing frame_params callback to vc1_d3d11va2 hwaccelJames Almer2018-03-22
| | | | | | | Fixes ticket #7096 Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/avpacket: add av_packet_make_writable()James Almer2018-03-21
| | | | | | | Useful as well to quickly make a packet reference counted when it isn't already so. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/remove_extradata_bsf: support dump options.Jun Zhao2018-03-21
| | | | | | | support dump bit stream filter options Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/noise_bsf: support dump options.Jun Zhao2018-03-21
| | | | | | | support dump bit stream filter options. Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/dump_extradata_bsf: support dump options.Jun Zhao2018-03-21
| | | | | | | support dump bit stream filter options Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vp9_superframe_split: fix memory leak in case of output packet ↵James Almer2018-03-21
| | | | | | | | creation failure Some function calls may fail after the output packet is initialized. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mediacodecdec: propagate SAR to h/w framesAman Gupta2018-03-20
| | | | | | | | | Allows consumers who are converting hardware buffers to OpenGL textures to render the frames at the intended display resolution. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avcodec/mpeg2_metadata: unref output packet on failureJames Almer2018-03-20
| | | | | | | | Move the check and unref call to the end to be consistent with other bsfs. Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h265_metadata: fix memory leak in case of output packet creation failureJames Almer2018-03-20
| | | | | | | Some function calls may fail after the output packet is initialized. Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_metadata: fix memory leak in case of output packet creation failureJames Almer2018-03-20
| | | | | | | Some function calls may fail after the output packet is initialized. Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg4_unpack_bframes: reduce code duplicationJames Almer2018-03-20
| | | | | | | | Also fixes one potential leak of side data in out if the av_packet_from_data() call fails. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mp3_header_decompress: don't free the user provided packet on errorJames Almer2018-03-20
| | | | | | | It's owned by the caller. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vp9_superframe_split: move the reference in the bsf internal bufferJames Almer2018-03-19
| | | | | | There's no need to allocate a new packet for it. Signed-off-by: James Almer <jamrial@gmail.com>
* h264_metadata: Fix memory leak on multiple display orientation messagesMark Thompson2018-03-19
| | | | Fixes CID #1430176.
* lavc/mpeg2_metadata_bsf: support dump options.Jun Zhao2018-03-18
| | | | | Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* lavc/h265_metadata_bsf: support dump options.Jun Zhao2018-03-18
| | | | | Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* lavc/h264_metadata_bsf: support dump options.Jun Zhao2018-03-18
| | | | | Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* avcodec/aac_adtstoasc: move the reference in the bsf internal bufferJames Almer2018-03-18
| | | | | | There's no need to allocate a new packet for it. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: Add filter_units bitstream filterMark Thompson2018-03-18
| | | | | | This can remove units with types in or not in a given set from a stream. For example, it can be used to remove all non-VCL NAL units from an H.264 or H.265 stream.
* cbs: Add a table of all supported codec IDsMark Thompson2018-03-18
| | | | Use it as the set of codec IDs supported by the trace_headers BSF.
* h264_metadata: Remove unused fieldsMark Thompson2018-03-18
| | | | | The SEI NAL is unused since 69062d0f9b6aef5d9d9b8c9c9b5cfb23037caddb, while the AUD NAL is small and would more sensibly be on the stack.
* h264_metadata: Add support for display orientation SEI messagesMark Thompson2018-03-18
|
* cbs_h265: Use helper macro for maximum values of fixed-width elementsMark Thompson2018-03-18
| | | | | Apply the same logic as the previous patch to H.265. There are no cases which currently overflow here, but this is still more consistent.
* cbs_h264: Fix overflow in shiftsMark Thompson2018-03-18
| | | | | | | | | The type of the result of a shift operation is unaffected by the type of the right operand, so some existing code overflows with undefined behaviour when the element length is 32. Add a helper macro to calculate the maximum value correctly and then use it everywhere this pattern appears. Found-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
* avformat/codec2: don't include avcodec objectsJames Almer2018-03-17
| | | | | | They belong in avcodec. Signed-off-by: James Almer <jamrial@gmail.com>
* Partially revert "avcodec/hapqa_extract: remove the AVOption flagsJames Almer2018-03-17
| | | | | | | Re add AVOptions flags, using the new one meant for bsfs. This partially reverts commit f706cdda56. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/extract_extradata_bsf: support dump options.Jun Zhao2018-03-17
| | | | | | | support dump bit stream filter options Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/null_bsf: move the reference in the bsf internal bufferJames Almer2018-03-16
| | | | | | There's no need to allocate a new packet for it. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hapqa_extract: remove the AVOption flagsJames Almer2018-03-14
| | | | | | | These two are not used for bitstream filters. Reviewed-by: Martin Vignali <martin.vignali@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hapqa_extract: fix two error return valuesJames Almer2018-03-13
| | | | | | | ret is 0 by default. Reviewed-by: Martin Vignali <martin.vignali@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hapqa_extract: move the reference in the bsf internal bufferJames Almer2018-03-13
| | | | | | There's no need to allocate a new packet for it. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mediacodecdec: fix immediate EAGAIN with buffered packetAman Gupta2018-03-13
| | | | | | | | | | | | | | In cases where the mediacodec decoder consumed a partial packet, receive_frame() would start returning EAGAIN if the rest of the packet couldn't be flushed and no frames were immediately available. This fixes receive_frame() to perform its normal blocking wait for new frames before returning EAGAIN. Fixes an issue I could reproduce fairly often on a FireOS 6 device, and reported to be happening intermittently by two mpv users. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* avcodec/hapqa_extract_bsf : add new bsf filterMartin Vignali2018-03-13
| | | | | convert HapQA data to HAPQ or HAPAlphaOnly by copying the corresponding texture
* avcodec/hap : move parse_section_header to hap.c in order to be use by new ↵Martin Vignali2018-03-13
| | | | bsf filter
* vc2enc: properly promote operations to 64 bitsRostislav Pehlivanov2018-03-13
| | | | | | | | | | | On Windows machines, the UL suffix still means 32 bits. The only parts that need 64 bits are (1ULL << (m + 32)) and (t*qf + qf). Hence, use the proper ULL suffix for the former and just increase the type of the qf constant for the latter. No overflows can happen as long as these are done in 64 bits and the quantization table doesn't change. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* h264_mp4toannexb_bsf: Fix start code size of parameter sets.Yusuke Nakamura2018-03-13
| | | | | | Any parameter set shall have start code of at least 4 byte size. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mediacodecdec_common: make INFO_TRY_AGAIN trace messages more consistentMatthieu Bouron2018-03-12
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* avcodec/mediacodecdec: add debug logging around hw buffer lifecycleAman Gupta2018-03-12
| | | | | | | | | | | | | Some Android devices are very finicky about how quicky output buffers are returned back to the decoder, especially when they are associated with a Surface. This commit adds a new counter that keeps track of exactly how many hw output buffers are being retained by the user, along with DEBUG level logging that makes it easy to track the lifecycle of these buffers. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* avcodec/nuv: rtjpeg with dimensions less than 16 would result in no decoded ↵Michael Niedermayer2018-03-12
| | | | | | | | | | pixels thus reject it Fixes: Timeout Fixes: 6297/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-4882404863901696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nuv: Check for minimum input size for uncomprssed and rtjpegMichael Niedermayer2018-03-12
| | | | | | | | Fixes: Timeout Fixes: 6297/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-4882404863901696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmalosslessdec: Reset num_saved_bits on error pathMichael Niedermayer2018-03-12
| | | | | | | | Fixes: NULL pointer dereference Fixes: poc-201803.wav Found-by: GwanYeong Kim <gy741.kim@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/trace_headers: move the reference in the bsf internal bufferJames Almer2018-03-11
| | | | | | | There's no need to allocate a new packet for it. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/remove_extradata: move the reference in the bsf internal bufferJames Almer2018-03-11
| | | | | | | There's no need to allocate a new packet for it. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mov2textsub: move the reference in the bsf internal bufferJames Almer2018-03-11
| | | | | | | There's no need to allocate a new packet for it. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/extract_extradata: move the reference in the bsf internal bufferJames Almer2018-03-11
| | | | | | | There's no need to allocate a new packet for it. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dca_core: move the reference in the bsf internal bufferJames Almer2018-03-11
| | | | | | | There's no need to allocate a new packet for it. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>