summaryrefslogtreecommitdiff
path: root/libavformat/avc.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/avc: Add functions to split access unit into list of NALUsAndreas Rheinhardt2022-01-191-3/+37
| | | | | | | | This will allow to avoid the temporary buffer and memcpys when repacketing annex B to mp4-style H.264/H.265 without searching twice for start codes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avc, mxfenc: Avoid allocation of H264 SPS structure, fix memleakAndreas Rheinhardt2020-06-261-15/+12
| | | | | | | | | | | | | | | | | | | | | | Up until now, ff_avc_decode_sps would parse a SPS and return some properties from it in a freshly allocated structure. Yet said structure is very small and completely internal to libavformat, so there is no reason to use the heap for it. This commit therefore changes the function to return an int and to modify a caller-provided structure. This will also allow ff_avc_decode_sps to return better error codes in the future. It also fixes a memleak in mxfenc: If a packet contained multiple SPS, only the SPS structure belonging to the last SPS would be freed, the other ones would leak when the pointer is overwritten to point to the new SPS structure. Of course, without allocations there are no leaks. This is Coverity issue #1445194. Furthermore, the SPS structure has been renamed from H264SequenceParameterSet to H264SPS in order to avoid overlong lines. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/avc: Don't use ff_ prefix for static functionAndreas Rheinhardt2020-06-261-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/av1, avc, hevc: Remove av_freep()Andreas Rheinhardt2020-01-261-2/+1
| | | | | | | | | | | | | | | ff_av1_filter_obus_buf() and ff_avc_parse_nal_units_buf() both have a pointer-to-pointer parameter which they use to pass a newly allocated buffer to the caller. And both functions freed what this pointer points to before overwriting it. But no caller of these functions used this feature, but some had to initialize the pointer just because of this. So remove it and update the documentation of ff_av1_filter_obus_buf() wrt this fact. ff_hevc_annexb2mp4_buf in contrast did not free the pointer. This has been documented, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: add missing return error valueJames Almer2019-11-301-1/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: fix sps buffer offset when calling ff_avc_decode_sps()James Almer2019-11-291-1/+1
| | | | | | Skip the avcC specific size bytes and the NAL header bits. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: write the missing bits in the AVC Decoder Configuration BoxJames Almer2019-11-281-5/+32
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: Avoid allocation for small SPS/PPS arraysAndreas Rheinhardt2019-11-281-9/+6
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small extradata. Furthermore, it simplifies freeing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfenc: support XAVC long gopBaptiste Coudurier2019-05-201-0/+186
|
* avformat/avc: support writting more than one sps/pps in ff_isom_write_avccJames Almer2017-11-301-13/+38
| | | | | | | Addresses ticket #6864 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: free buffer in ff_isom_write_avcc on failureJames Almer2017-11-301-3/+7
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: reindent after the last commitJames Almer2017-11-301-45/+46
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: refactor ff_isom_write_avccJames Almer2017-11-301-9/+11
| | | | | | This lets us remove one indentation level. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avc: return an error in ff_isom_write_avcc if the buffer lenght is ↵James Almer2017-11-301-2/+3
| | | | | | too small Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-1/+1
|\ | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/avc: add buffer padding to extradata allocationLukasz Marek2015-02-051-1/+1
| | | | | | | | | | | | | | ff_avc_write_annexb_extradata() allocates extradata, but don't add FF_INPUT_BUFFER_PADDING_SIZE value Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | Merge commit 'a2efbecc4ed12d287cf29856418c4da4a7648d95'Michael Niedermayer2014-09-251-0/+17
|\ \ | |/ | | | | | | | | | | * commit 'a2efbecc4ed12d287cf29856418c4da4a7648d95': libavformat: Move avc mp4 startcode parsing to a shared file Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Move avc mp4 startcode parsing to a shared fileMartin Storsjö2014-09-241-0/+17
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-251-0/+31
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avc: Add a function for converting mp4 style extradata to annex b pthread: free progress if buffer allocation failed. lavc/avconv: support changing frame sizes in codecs with frame mt. libavformat: Document who sets the AVStream.id field utvideo: mark output picture as keyframe. sunrast: Add support for negative linesize. vp8: fix update_lf_deltas in libavcodec/vp8.c ralf: read Huffman code lengths without GetBitContext Conflicts: ffmpeg.c libavcodec/sunrastenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avc: Add a function for converting mp4 style extradata to annex bMartin Storsjö2012-03-241-0/+31
| | | | | | | | | | | | | | Make movenc use this function instead of the current custom conversion function. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-111-11/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (29 commits) doc: update libavfilter documentation tls: Use the URLContext as logging context aes: Avoid illegal read and don't generate more key than we use. mpc7: Fix memset call in mpc7_decode_frame function atrac1: use correct context for av_log() apedec: consume the whole packet when copying to the decoder buffer. apedec: do not needlessly copy s->samples to nblocks. apedec: check output buffer size after calculating actual output size apedec: remove unneeded entropy decoder normalization. truespeech: use memmove() in truespeech_update_filters() vorbisdec: remove AVCODEC_MAX_AUDIO_FRAME_SIZE check vorbisdec: remove unneeded buf_size==0 check vorbisdec: return proper error codes instead of made-up ones http: Don't add a Range: bytes=0- header for POST sunrast: Check for invalid/corrupted bitstream http: Change the chunksize AVOption into chunked_post http: Add encoding/decoding flags to the AVOptions avconv: remove some codec-specific hacks crypto: add decoding flag to options. tls: use AVIO_FLAG_NONBLOCK instead of deprecated URL_FLAG_NONBLOCK ... Conflicts: doc/libavfilter.texi libavcodec/atrac1.c libavcodec/sunrast.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avc: fix memory errors when encoding invalid h264 codecdataJohn Brooks2011-11-091-11/+18
| | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-04-041-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: fate: fix partial run when no samples path is specified ARM: NEON fixed-point forward MDCT ARM: NEON fixed-point FFT lavf: bump minor version and add an APIChanges entry for avio changes avio: simplify url_open_dyn_buf_internal by using avio_alloc_context() avio: make url_fdopen internal. avio: make url_open_dyn_packet_buf internal. avio: avio_ prefix for url_close_dyn_buf avio: avio_ prefix for url_open_dyn_buf avio: introduce an AVIOContext.seekable field ac3enc: use generic fixed-point mdct lavfi: add fade filter Change yadif to not use out of picture lines. lavc: deprecate AVCodecContext.antialias_algo lavc: mark mb_qmin/mb_qmax for removal on next major bump. Conflicts: doc/filters.texi libavcodec/ac3enc_fixed.h libavcodec/ac3enc_float.h libavfilter/Makefile libavfilter/allfilters.c libavfilter/vf_fade.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avio: avio_ prefix for url_close_dyn_bufAnton Khirnov2011-04-031-1/+1
| |
| * avio: avio_ prefix for url_open_dyn_bufAnton Khirnov2011-04-031-1/+1
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * avio: avio: avio_ prefixes for put_* functionsAnton Khirnov2011-02-211-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | In the name of consistency: put_byte -> avio_w8 put_<type> -> avio_w<type> put_buffer -> avio_write put_nbyte will be made private put_tag will be merged with avio_put_str Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
| * avio: rename ByteIOContext to AVIOContext.Anton Khirnov2011-02-201-3/+3
| | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | avio: avio: avio_ prefixes for put_* functionsAnton Khirnov2011-02-221-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | In the name of consistency: put_byte -> avio_w8 put_<type> -> avio_w<type> put_buffer -> avio_write put_nbyte will be made private put_tag will be merged with avio_put_str Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit 77eb5504d3b3e1047900382350e0bc5e0bfb16b5)
* | avio: rename ByteIOContext to AVIOContext.Anton Khirnov2011-02-201-3/+3
|/ | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit ae628ec1fd7f54c102bf9e667a3edd404b9b9128)
* Include avc.h from avc.c: It contains several prototypes.Carl Eugen Hoyos2010-02-281-0/+1
| | | | Originally committed as revision 22098 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Attempt to fix the completely random values returned by ff_avc_find_startcode().Michael Niedermayer2010-02-221-5/+11
| | | | Originally committed as revision 21955 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics, remove spaces after '(' and before ')'Baptiste Coudurier2009-07-301-14/+14
| | | | Originally committed as revision 19547 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use intptr_t when casting pointers to int.Ramiro Polla2009-03-261-1/+1
| | | | Originally committed as revision 18192 to svn://svn.ffmpeg.org/ffmpeg/trunk
* support h264 extradata with 0x000001 startcodeBaptiste Coudurier2009-01-161-1/+2
| | | | Originally committed as revision 16627 to svn://svn.ffmpeg.org/ffmpeg/trunk
* export ff_avc_parse_nal_units_bufBaptiste Coudurier2009-01-161-1/+1
| | | | Originally committed as revision 16624 to svn://svn.ffmpeg.org/ffmpeg/trunk
* return size written in ff_avc_parse_nal_unitsBaptiste Coudurier2009-01-161-1/+4
| | | | Originally committed as revision 16622 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Do not reallocate AVPacket's data when muxing a packetLuca Abeni2009-01-151-7/+14
| | | | Originally committed as revision 16616 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix build: Add intreadwrite.h and bswap.h #includes where necessary.Diego Biurrun2009-01-111-0/+2
| | | | Originally committed as revision 16556 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix misplaced const, avoids a cast-discards-qualifiers warningReimar Döffinger2008-02-191-1/+1
| | | | Originally committed as revision 12146 to svn://svn.ffmpeg.org/ffmpeg/trunk
* constMichael Niedermayer2008-02-191-11/+11
| | | | Originally committed as revision 12145 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make avc_find_startcode non-static, so that it can be used from otherLuca Abeni2008-01-151-3/+3
| | | | | | files (and add the ff_ prefix, to avoid polluting the namespace) Originally committed as revision 11532 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add a ff_ prefix to newly exported functions from avc.cAurelien Jacobs2008-01-111-3/+3
| | | | Originally committed as revision 11511 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move isom_write_avcc() and related functions into a separate file.Aurelien Jacobs2008-01-111-0/+135
Originally committed as revision 11498 to svn://svn.ffmpeg.org/ffmpeg/trunk