summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
Commit message (Collapse)AuthorAge
* avformat/avio: add a crc callback function for CRC-32 IEEE-LEJames Almer2016-08-04
| | | | | | Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* cosmetics: fix some misspelled wordsJames Almer2016-07-17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit 'db7968bff4851c2be79b15b2cb2ae747424d2fca'Matthieu Bouron2016-06-23
|\ | | | | | | | | | | | | * commit 'db7968bff4851c2be79b15b2cb2ae747424d2fca': avio: Allow custom IO users to get labels for the output bytestream Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
| * avio: Allow custom IO users to get labels for the output bytestreamMartin Storsjö2016-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows callers with avio write callbacks to get the bytestream positions that correspond to keyframes, suitable for live streaming. In the simplest form, a caller could expect that a header is written to the bytestream during the avformat_write_header, and the data output to the avio context during e.g. av_write_frame corresponds exactly to the current packet passed in. When combined with av_interleaved_write_frame, and with muxers that do buffering (most muxers that do some sort of fragmenting or clustering), the mapping from input data to bytestream positions is nontrivial. This allows callers to get directly information about what part of the bytestream is what, without having to resort to assumptions about the muxer behaviour. One keyframe/fragment/block can still be split into multiple (if they are larger than the aviocontext buffer), which would call the callback with e.g. AVIO_DATA_MARKER_SYNC_POINT, followed by AVIO_DATA_MARKER_UNKNOWN for the second time it is called with the following data. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'fab8156b2f30666adabe227b3d7712fd193873b1'Derek Buitenhuis2016-04-21
|\| | | | | | | | | | | | | * commit 'fab8156b2f30666adabe227b3d7712fd193873b1': avio: Copy URLContext generic options into child URLContexts Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * avio: Copy URLContext generic options into child URLContextsMartin Storsjö2016-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since all URLContexts have the same AVOptions, such AVOptions will be applied on the outermost context only and removed from the dict, while they probably make sense on all contexts. This makes sure that rw_timeout gets propagated to the innermost URLContext (to make sure it gets passed to the tcp protocol, when opening a http connection for instance). Alternatively, such matching options would be kept in the dict and only removed after the ffurl_connect call. Signed-off-by: Martin Storsjö <martin@martin.st>
| * lavf: add a protocol whitelist/blacklist for file opened internallyAnton Khirnov2016-02-22
| | | | | | | | | | | | | | | | Should make the default behaviour safer for careless callers that open random untrusted files. Bug-Id: CVE-2016-1897 Bug-Id: CVE-2016-1898
| * urlprotocol: receive a list of protocols from the callerAnton Khirnov2016-02-22
| | | | | | | | | | This way, the decisions about which protocols are available for use in any given situations can be delegated to the caller.
* | hls: read protocol options through the AVIOContextHendrik Leppkes2016-03-16
| | | | | | | | | | | | | | | | | | | | This reverts commit 9f9ed79d4cb40e5d9093899f8a79086ff23da844. The hlsopts member was never set anywhere and always NULL, furthermore the HLS demuxer needs to retrieve the proper options from the underlying http protocol (cookies, user-agent, etc), so a dummy context won't help. Instead, use the AVIOContext directly to access the options.
* | avformat: Add a protocol blacklisting APIDerek Buitenhuis2016-03-04
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | hls: Add and use a memebr of AVIOInternal rather than abuse opaqueDerek Buitenhuis2016-02-29
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit 'cae448cfbf31d492cba782bc64fc4eed556ed83d'Derek Buitenhuis2016-02-29
|\| | | | | | | | | | | | | * commit 'cae448cfbf31d492cba782bc64fc4eed556ed83d': aviobuf: add a private data struct for avio_open()ed contexts Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * aviobuf: add a private data struct for avio_open()ed contextsAnton Khirnov2016-02-22
| | | | | | | | It will be useful in the following commits.
* | avformat: add protocol_whitelistMichael Niedermayer2016-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | Note to maintainers: update tools Note to maintainers: set a default whitelist for your protocol If that makes no sense then consider to set "none" and thus require the user to specify a white-list for sub-protocols to be opened Note, testing and checking for missing changes is needed Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/avio: free url/avio optionsMichael Niedermayer2016-01-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/aviobuf: Fix end check in put_str16()Michael Niedermayer2016-01-13
| | | | | | | | | | | | | | | | Fixes out of array read Fixes: 03c406ec9530e594a074ce2979f8a1f0/asan_heap-oob_7dec26_4664_37c52495b2870a2eaac65f53958e76c1.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avio: add detail to avio_printf() size warningReynaldo H. Verdejo Pinochet2015-12-27
| | | | | | | | | | | | | | Previous "currently size is limited" didn't give away much in terms of useful info. Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | avformat/aviobuf: Simplify avio_read() and avio_seek()Bryan Huh2015-11-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/aviobuf: Improve readability of aviobuf (Add comments and docs)Bryan Huh2015-11-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/avio: add avio_accept and avio_handshakeStephan Holljes2015-08-01
| | | | | | | | Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * avio: Add avio_put_str16beLuca Barbato2015-06-07
| |
* | avio: fix potential crashes when combining ffio_ensure_seekback + crcwm42015-06-17
| | | | | | | | | | | | | | | | | | | | | | | | Calling ffio_ensure_seekback() if ffio_init_checksum() has been called on the same context can lead to out of bounds memory accesses and crashes. The reason is that ffio_ensure_seekback() does not update checksum_ptr after reallocating the buffer, resulting in a dangling pointer. This effectively fixes potential crashes when opening mp3 files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/avio: move short seek threshold to the contextMichael Niedermayer2015-06-11
| | | | | | | | | | | | This allows us to adjust it internally. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aviobuf: Check for ffio_set_buf_size() failureMichael Niedermayer2015-06-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'bff0349d9da527084e1433167466d8afc9e25c7f'Michael Niedermayer2015-06-01
|\| | | | | | | | | | | | | * commit 'bff0349d9da527084e1433167466d8afc9e25c7f': avio: Add avio_read wrapper to simplify error checking Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avio: Add avio_read wrapper to simplify error checkingVittorio Giovara2015-05-31
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avformat: add callback for opening further filesMichael Niedermayer2015-05-11
| | | | | | | | | | Previous version reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aviobuf: Do not resize the buffer in ffio_ensure_seekback() if ↵Michael Niedermayer2015-04-27
| | | | | | | | | | | | | | | | | | there is no read function Without a read function there can never be more data read than the buffer could hold Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b97f427fb56bdbf7de8e2d4b72d01114aa6eceda'Michael Niedermayer2015-03-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b97f427fb56bdbf7de8e2d4b72d01114aa6eceda': lavf: Explicitly convert types at function pointer assignment Conflicts: libavformat/avio.c libavformat/aviobuf.c libavformat/swfenc.c See: a76a2ffe9d7773d59bb1bc228a6660e23672c490 and others Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: Explicitly convert types at function pointer assignmentDiego Biurrun2015-03-11
| | | | | | | | This fixes a number of "assignment from incompatible pointer type" warnings.
* | libavformat/avio: added avio_put_str16beMark Reid2015-03-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'c86d8aed748adc3ba8df96fb1fe14aa45da77a31'Michael Niedermayer2015-02-28
|\| | | | | | | | | | | | | * commit 'c86d8aed748adc3ba8df96fb1fe14aa45da77a31': avio: Rename avclass symbols relating to avio Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avio: Rename avclass symbols relating to avioMartin Storsjö2015-02-28
| | | | | | | | | | | | | | Don't prefix them ffio_url, which is misleading, sounding too much like the urlprotocol layer (like ffurl_*). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '8a273a746061a112e5e35066a8fd8e146d821a62'Michael Niedermayer2015-02-25
|\| | | | | | | | | | | | | * commit '8a273a746061a112e5e35066a8fd8e146d821a62': avio: Add an internal utility function for freeing dynamic buffers Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avio: Add an internal utility function for freeing dynamic buffersMartin Storsjö2015-02-24
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/aviobuf: Allow seeking to the end of the buffer for read only buffersMichael Niedermayer2015-01-28
| | | | | | | | | | | | This undoes the effect of 3c18a7b18807de81566381a1bcbe9f6103c0296b for reading Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3c18a7b18807de81566381a1bcbe9f6103c0296b'Michael Niedermayer2015-01-28
|\| | | | | | | | | | | | | | | | | | | * commit '3c18a7b18807de81566381a1bcbe9f6103c0296b': avio: Do not consider the end-of-buffer position valid Conflicts: libavformat/aviobuf.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avio: Do not consider the end-of-buffer position validLuca Barbato2015-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Trigger a refill if the seek action moves the pointer at the end of the buffer. Before this patch the read action following the seek would trigger the refill, while write action would write outside the buffer. In the Libav codebase few muxers seek forward outside of what already has been written so it is quite unlikely to experience the problem with the default buffer size. CC: libav-stable@libav.org
* | avformat/aviobuf: Check that avio_seek() target is non negativeMichael Niedermayer2014-12-14
| | | | | | | | | | | | | | Fixes out of array access Suggested-by: Andrew Scherkus <scherkus@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aviobuf: Fix infinite loop in ff_get_line()Michael Niedermayer2014-12-03
| | | | | | | | | | | | Fixes ticket4152 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd7f530b0d67fe3996dbfa990a47c865e0d1400a2'Michael Niedermayer2014-10-20
|\| | | | | | | | | | | | | | | * commit 'd7f530b0d67fe3996dbfa990a47c865e0d1400a2': aviobuf: check context before using it See: 7441d1ec330da810a0ffd44a02b2fc60add5b719 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aviobuf: check context before using itVittorio Giovara2014-10-20
| | | | | | | | | | | | | | Avoid a possible null pointer dereference. CC: libav-stable@libav.org Bug-Id: CID 1135769
* | avformat/aviobuf: fix avio_flush() for read streamswm42014-09-30
| | | | | | | | | | | | | | avio_flush() did nothing useful for read streams. Fix it to behave as expected, and discard the currently read buffer properly. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aviobuf: remove uses of deprecated url_feof()Michael Niedermayer2014-08-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/avio: rename url_feof() to avio_feof()James Almer2014-08-08
| | | | | | | | | | | | | | It's a public function and should use the avio_ namespace Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Add int64_t probesize2 instead of int probesize to AVFormatContext.Carl Eugen Hoyos2014-07-30
| | | | | | | | | | Allows to set a probesize >2G. Tested-by: Oliver Fromme
* | lavf/avio: do not include bprint.h.Nicolas George2014-07-25
| | | | | | | | | | | | | | | | | | C++ chokes on the definition of AVBPrint. Including avio.h from c++ code used to work. Fix trac ticket #3800. Signed-off-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avio: Introduce avio_read_to_bprint(avioctx, bp, max_size)Andrey Utkin2014-07-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>