summaryrefslogtreecommitdiff
path: root/libavformat/img2dec.c
Commit message (Collapse)AuthorAge
* avformat/img2dec: Avoid duplicating buffer when adding side-dataAndreas Rheinhardt2020-05-28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: Remove unnecessary av_packet_unref()Andreas Rheinhardt2020-02-10
| | | | | | | | | Since bae8844e the packet will always be unreferenced when a demuxer returns an error, so that a lot of calls to av_packet_unref() in lots of demuxers are now redundant and can be removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2dec: add option to provide metadata fields related to input pathAlexandre Heitor Schmidt2020-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libavformat/img2.h: New field export_path_metadata to VideoDemuxData to only allow the use of the extra metadata upon explicit user request, for security reasons. libavformat/img2dec.c: Modify image2 demuxer to make available two special metadata entries called lavf.image2dec.source_path and lavf.image2dec.source_basename, which represents, respectively, the complete path to the source image for the current frame and the basename i.e. the file name related to the current frame. These can then be used by filters like drawtext and others. The metadata fields will only be available when explicitly enabled with image2 option -export_path_metadata 1. doc/demuxers.texi: Documented the new metadata fields available for image2 and how to use them. doc/filters.texi: Added an example on how to use the new metadata fields with drawtext filter, in order to plot the input file path to each output frame. Usage example: ffmpeg -f image2 -export_path_metadata 1 -pattern_type glob -framerate 18 -i '/path/to/input/files/*.jpg' -filter_complex drawtext="fontsize=40:fontcolor=white: fontfile=FreeSans.ttf:borderw=2:bordercolor=black: text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=5:y=50" output.avi Fixes #2874. Signed-off-by: Alexandre Heitor Schmidt <alexandre.schmidt@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/img2dec: Fix probe_buffer leak in ff_img_read_header()Michael Niedermayer2019-06-25
| | | | | | | | Fixes: memleak Fixes: 15171/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5683881644130304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* lavf: Constify AVInputFormat pointer.Carl Eugen Hoyos2019-03-20
|
* lavf/img2: Move "loop" into common options.Carl Eugen Hoyos2019-02-10
| | | | | While the image2pipe demuxer ignores the option - confusing users - the autodetecting demuxers that are favoured over image2 act on it.
* lavf/img2dec: Split img2 and img2pipe options.Carl Eugen Hoyos2019-02-10
|
* avformat: add gif pipe demuxerPaul B Mahol2018-12-10
|
* lavf/img2dec: Auto-detect xwd images.Carl Eugen Hoyos2018-05-25
|
* lavf/img2dec: use new iteration APIJosh de Kock2018-04-02
| | | | Signed-off-by: Josh de Kock <josh@itanimul.li>
* avformat/img2dec: fix infinite loopMichael Niedermayer2018-03-10
| | | | | | | | Fixes: kira-poc Found-by: Kira <kira_cxy@foxmail.com> Change suggested by Kira Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/img2dec: Auto-detect svg images.Carl Eugen Hoyos2017-10-07
|
* lavf/img2: Add svg and svgz to allow reading image sequences.Carl Eugen Hoyos2017-05-22
| | | | Increase the return value for svg_probe() to make it != AVPROBE_SCORE_EXTENSION.
* img2dec: use standard way to probe for svg/svgz filesRostislav Pehlivanov2017-05-16
|
* img2dec: add support for piped SVG demuxingRostislav Pehlivanov2017-05-16
| | | | | | | Only checks the extension and MIME type, since determining whether a file is SVG is difficult since they're just XML files. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* avcodec: add XPM decoder and demuxerParas Chadha2017-03-12
| | | | Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
* lavf/img2dec: Reduce the probe score for incomplete jpgs.Carl Eugen Hoyos2017-01-27
| | | | Ensures that probing doesn't finish prematurely for small files.
* lavf/img2dec: Increase detection score of jpgs without EOI.Carl Eugen Hoyos2017-01-01
| | | | | Also increases the score for large jpeg files. Fixes autodetection for the file from mpv issue 3973.
* avformat/img2dec: Remove dead code from psd_probe()Michael Niedermayer2016-12-21
| | | | | | Fixes CID1397124 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat : add Photoshop PSD demuxer.Martin Vignali2016-12-14
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/img2dec: Skip DQT segment when auto-detecting jpg.Carl Eugen Hoyos2016-09-03
| | | | DQT segments may contain 0xFFs which break auto-detection.
* lavf/img2dec: Also auto-detect (unusual) uncompressed pcx.Carl Eugen Hoyos2016-07-15
|
* lavf/img2dec: add pnm pipe demuxersClément Bœsch2016-06-22
|
* avformat: Fix max value of AV_OPT_TYPE_VIDEO_RATEMichael Niedermayer2016-06-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | lavf/img2dec: Skip COM when auto-detecting jpeg.Carl Eugen Hoyos2016-03-22
| | | | | | | | It could theoretically contain invalid data that gets ignored by decoders.
* | lavf/img2dec: Use jpeg constants in jpeg_probe().Carl Eugen Hoyos2016-03-06
| |
* | lavf: Add pcx auto-detection.Carl Eugen Hoyos2016-02-29
| |
* | lavf/img2dec: Skip SOS when auto-detecting jpeg.Carl Eugen Hoyos2016-02-29
| | | | | | | | Improves jpeg auto-detection.
* | lavf/img2dec: Skip SOF size when probing jpeg.Carl Eugen Hoyos2016-02-26
| | | | | | | | | | Fixes auto-detection for some resolutions. Reported-by: Clément Bœsch
* | img2dec: Support Progressive JPEG in jpeg_probeJustin Ruggles2016-02-24
| | | | | | | | | | | | There can be multiple SOS markers, so do not return 0 in that case. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-10
|\| | | | | | | | | | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* | avformat/img2dec: Use AVOpenCallbackMichael Niedermayer2016-01-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/img2dec: do not interpret the filename by default if a IO context ↵Michael Niedermayer2016-01-20
| | | | | | | | | | | | | | | | | | | | | | | | has been opened With this, user applications which use custom IO and have set a IO context will not have their already opened IO context ignored and glob/seq being interpreted Comments and tests from maintainers of user apps are welcome! Liked-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/img2dec: Reuse main IO context instead of reopening a single fileMichael Niedermayer2015-12-26
| | | | | | | | | | | | Fixes part of Ticket4849 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/img2dec: Skip checking the input files existence if it has already ↵Michael Niedermayer2015-12-26
| | | | | | | | | | | | | | | | | | been opened Avoids a unneeded open Fixes part of Ticket4849 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | 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`.
| * avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
| * img2dec: correctly use the parsed value from -start_numberVittorio Giovara2015-01-14
| | | | | | | | | | | | | | Previously the image sequence was always starting from the minimum number rather than the requested one. CC: libav-stable@libav.org
* | all: add _DEFAULT_SOURCE locally wherever neededGanesh Ajjanagadde2015-10-04
| | | | | | | | | | | | | | | | | | Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE and _SVID_SOURCE. The solution from man feature_test_macros is to define both _DEFAULT_SOURCE and the old macros. This solution is on the lines of the one in commit af1818276ef271af98e2e2bbabb4dc875b4fa7d8. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | lavf/img2dec: Fix memory leakPrzemysław Sobala2015-09-29
| | | | | | | | | | | | Fixes #4886 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/img2dec: Improve jpeg auto-detection.Carl Eugen Hoyos2015-09-12
| | | | | | | | Fixes ticket #4841.
* | lavf/img2dec: Improve detection of valid Quickdraw images.Carl Eugen Hoyos2015-06-29
| | | | | | | | | | Detect Quickdraw images without application header with lower score.
* | lavf/img2dec: Autodetect dds frames.Carl Eugen Hoyos2015-06-29
| |