summaryrefslogtreecommitdiff
path: root/libavformat/mpjpegdec.c
Commit message (Collapse)AuthorAge
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpjpegdec: make sure we seek back to the ensured bufferMarton Balint2020-10-09
| | | | | | | | It was possible for the old code to seek back before the most recently read data if start of a new multipart was across read boundaries. Now we read some small sections multiple times to avoid this, but that is OK. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpjpegdec: Remove redundant initializationsAndreas Rheinhardt2020-02-11
| | | | | | | | The AVPacket destined for a demuxer's output has already been initialized before it reaches the demuxer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* 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/mpjpegdec: ensure seekback for latest chunkMoritz Barsnick2019-10-12
| | | | | | | | | | | Not only the first, but each latest chunk must be cached to allow seekback after finding the mime boundary. Fixes trac #5023 and #5921. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpjpegdec: fix strict boundary search stringMoritz Barsnick2019-10-12
| | | | | | | | | | | | | | | | | | According to RFC1341, the multipart boundary indicated by the Content-Type header must be prepended by CRLF + "--", and followed by CRLF. In the case of strict MIME header boundary handling, the "--" was forgotten to add. Fixes trac #7921. A side effect is that this coincidentally breaks enforcement of strict MIME headers against servers running motion < 3.4.1, where the boundary announcement in the HTTP headers incorrectly used the prefix "--", which exactly matched this bug's behavior. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpjpegdec: fix finding multipart boundary parameterMoritz Barsnick2019-10-12
| | | | | | | | | | The string matching function's return value was evaluated incorrectly. Fixes trac #7920. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpjpegdec: Avoid allocation of AVIOContextAndreas Rheinhardt2019-10-06
| | | | | | | | Put an AVIOContext whose lifetime doesn't extend beyond the function where it is allocated on the stack instead of allocating and freeing it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> 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/mpjpegdec: Mark local variable staticMark Thompson2018-06-25
|
* Use the new AVIOContext destructor.Anton Khirnov2017-09-01
| | | | | (cherry picked from commit 6f554521afdf7ab4edbfaa9536660a1dca946b19) Signed-off-by: James Almer <jamrial@gmail.com>
* 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.
* | Use correct msvc type specifiers for ptrdiff_t and size_t.Carl Eugen Hoyos2016-03-09
| |
* | avformat/mpjpegdec: add AVFMT_NOTIMESTAMPSMichael Niedermayer2016-02-21
| | | | | | | | | | | | there are no timestamps being set, thus do not attempt to collect any Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mpjpeg: probe should not depend on Content-Length MIME header being presentAlex Agranovsky2016-02-21
| | | | | | | | | | Signed-off-by: Alex Agranovsky <alex@sighthound.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mpjpeg: do not include CRLF preceding boundary as part of the returned ↵Alex Agranovsky2016-02-14
| | | | | | | | | | | | | | frame Signed-off-by: Alex Agranovsky <alex@sighthound.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mpjpeg: Trim quotes on MIME boundary, if present.Alex Agranovsky2016-02-14
| | | | | | | | | | | | | | Fixes 5023 Signed-off-by: Alex Agranovsky <alex@sighthound.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mpjpegdec: Do not call av_log() while probing.Carl Eugen Hoyos2016-01-12
| |
* | lavf/mpjpegdec: Fixed dereference after null checkAlex Agranovsky2015-12-09
| | | | | | | | | | | | Fixes Coverity CID 1341576 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | avformat/mpjpegdec: Fix "libavformat/mpjpegdec.c:269:9: warning: passing ↵Michael Niedermayer2015-12-04
| | | | | | | | | | | | argument 3 of av_stristart from incompatible pointer type" Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mpjpegdec: fix mixed declarations and codeJames Almer2015-12-03
| |
* | avformat/mpjpeg: utilize MIME boundary value to detect start of new frameAlex Agranovsky2015-12-02
| | | | | | | | | | | | This code is disabled by default so not to regress endpoints sending invalid MIME, but can be enabled via AVOption 'strict_mime_boundary' Signed-off-by: Alex Agranovsky <alex@sighthound.com>
* | avformat/mpjpeg: allow processing of MIME parts without Content-Length headerAlex Agranovsky2015-12-02
| | | | | | | | | | | | Fixes ticket 5023 Signed-off-by: Alex Agranovsky <alex@sighthound.com>
* | Merge commit '18f9308e6a96bbeb034ee5213a6d41e0b6c2ae74'Hendrik Leppkes2015-10-27
|\| | | | | | | | | | | | | * commit '18f9308e6a96bbeb034ee5213a6d41e0b6c2ae74': mpjpeg: Cope with multipart lacking the initial CRLF Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mpjpeg: Cope with multipart lacking the initial CRLFLuca Barbato2015-10-23
| | | | | | | | | | | | | | | | | | Some server in the wild do not put the boundary at a newline as rfc1347 7.2.1 states. Cope with that by reading a line and if it is not empty reading a second one. Reported-By: bitingsock
* | lavf/mpjpegdec: Return 0 if an allocation inside the probe function fails.Carl Eugen Hoyos2015-10-22
| |
* | mpjpeg: CRLF terminating a sequence of MIME headers should not cause an errorAlex Agranovsky2015-09-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mpjpegdec: silence unused variable/function warningsGanesh Ajjanagadde2015-09-16
| | | | | | | | | | | | Silences a -Wunused-variable and -Wunused-function observed under GCC 5.2. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avformat: fix style after recent commitsClément Bœsch2015-09-14
| |
* | mpjpegde: trim header name/value of MIME headersAlex Agranovsky2015-09-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mpjpeg: probe should require same constraints as packet reader - both proper ↵Alex Agranovsky2015-09-14
| | | | | | | | | | | | | | | | content-type and content-size must be present return AVPROBE_SCORE_MAX, rather than random positive number on success Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mpjpegdec: Allow mpjpeg headers parsing to succeed upon EOF, if ↵Alex Agranovsky2015-09-13
| | | | | | | | | | | | required headers are present Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '8a26ae5f94e613dbf7eb8e3c60462e966e409cdc'Michael Niedermayer2015-06-28
|\| | | | | | | | | | | | | * commit '8a26ae5f94e613dbf7eb8e3c60462e966e409cdc': mpjpeg: Check stream allocation Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpjpeg: Check stream allocationLuca Barbato2015-06-28
| | | | | | | | Bug-Id: CID 1308152
| * mpjpegdec: don't try to alloc an AVIOContext when probe is guaranteed to failJames Almer2015-06-09
| | | | | | | | | | | | | | The first check is done without the AVIOContext, so alloc it only if said check succeeds Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* | mpjpegdec: don't try to alloc an AVIOContext when probe is guaranteed to failJames Almer2015-06-08
| | | | | | | | | | | | | | The first check is done without the AVIOContext, so alloc it only if said check succeeds Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit 'caf7be30b11288c498fae67be4741bfbf083d977'Michael Niedermayer2015-06-08
|\| | | | | | | | | | | | | | | | | | | | | * commit 'caf7be30b11288c498fae67be4741bfbf083d977': mpjpgdec: free AVIOContext leak on early probe fail Conflicts: libavformat/mpjpegdec.c See: 34d278f9838e355b3b2c7a9c0f77d7fcaf37ce49, this was mistakenly reimplemented, also see ffmpeg IRC log of today Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpjpgdec: free AVIOContext leak on early probe failJanne Grunau2015-06-08
| |
* | mpjpegdec: fix memory leak in probe functionJames Almer2015-06-08
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '9b56ac74b170d12027fbc81f581a451a709f1105'Michael Niedermayer2015-06-08
|/ | | | | | | | | | | | * commit '9b56ac74b170d12027fbc81f581a451a709f1105': mpjpeg: Initial implementation Conflicts: Changelog libavformat/allformats.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* mpjpeg: Initial implementationLuca Barbato2015-06-07
Support only streams with Content-Length. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>