summaryrefslogtreecommitdiff
path: root/libavformat/yuv4mpegdec.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/yuv4mpegdec: increase header limitChema Gonzalez2022-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows demuxing UHD F1000000000:33333333 fps yuvj420p files ffmpeg (at HEAD as of now) is creating this: ``` $ ffmpeg -y -i source.265 /tmp/foo.y4m >& /dev/null ... $ xxd /tmp/raw.y4m |less 00000000: 5955 5634 4d50 4547 3220 5731 3932 3020 YUV4MPEG2 W1920 00000010: 4831 3038 3020 4631 3030 3030 3030 3030 H1080 F100000000 00000020: 303a 3333 3333 3333 3333 2049 7020 4130 0:33333333 Ip A0 00000030: 3a30 2043 3432 306d 7065 6732 2058 5953 :0 C420mpeg2 XYS 00000040: 4353 533d 3432 304d 5045 4732 2058 434f CSS=420MPEG2 XCO 00000050: 4c4f 5252 414e 4745 3d4c 494d 4954 4544 LORRANGE=LIMITED 00000060: 0a46 5241 4d45 0a82 8282 8282 8282 8282 .FRAME.......... ... ``` Which cannot be parsed by the same ffmpeg decoder: ``` $ ffmpeg -i /tmp/foo.y4m /tmp/bar.y4m ... [yuv4mpegpipe @ 0x2b69a40] Header too large. /tmp/foo.y4m: Invalid argument ``` This is kicking the ball (per 0b1ff3265e9bdad3b4b6b97ced2f126cb3599568), but seems to work.
* avformat: Avoid allocation for AVFormatInternalAndreas Rheinhardt2021-09-171-3/+3
| | | | | | | | | | | | | Do this by allocating AVFormatContext together with the data that is currently in AVFormatInternal; or rather: Put AVFormatContext at the beginning of a new structure called FFFormatContext (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVFormatInternal altogether. The biggest simplifications occured in avformat_alloc_context(), where one can now simply call avformat_free_context() in case of errors. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/yuv4mpegdec: Don't call avio_tell() twiceAndreas Rheinhardt2021-08-301-2/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/yuv4mpegdec: Use table instead of repeated "else if"Andreas Rheinhardt2021-07-231-103/+80
| | | | | | | | The code savings more than offset the size of the table (1936B vs 768B with GCC 10.3 at -O3). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | 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/yuv4mpegdec: add support for 444alphaPaul B Mahol2020-03-191-3/+1
|
* avformat/yuv4mpegdec: use proper error codesPaul B Mahol2020-03-191-2/+2
|
* avformat: Remove unnecessary av_packet_unref()Andreas Rheinhardt2020-02-101-1/+0
| | | | | | | | | 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/yuv4mpegdec: increase header limitGyan Doshi2020-01-261-1/+1
| | | | Allows demuxing UHD 30000/1001 fps yuvj420p files
* avformat/yuv4mpegdec: better error loggingGyan Doshi2020-01-261-4/+8
|
* avformat/y4m: do not try to seek if pts is less than 0Paul B Mahol2019-09-221-0/+2
| | | | Fixes #8193.
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-211-1/+1
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* libavformat/yuv4mpeg: Add color range support for Y4M Add color_range ↵Wang Cao2018-06-301-0/+8
| | | | | | | | | | support in Y4M. Set pixel format and color_range for YUVJ pixel formats. Also set color_range based on AVFormatContext. Signed-off-by: Wang Cao <wangcao@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/yuv4mpegdec: simplify mathPaul B Mahol2018-05-031-6/+3
| | | | | | This one actually works with hd1080 y4m files when seeking backwards. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avformat/yuv4mpegdec: fix seeking backwardsPaul B Mahol2018-04-251-1/+10
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avformat/yuv4mpeg: add gray9/10/12 supportMateusz2017-10-261-0/+6
| | | | Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
* yuv4mpegdec: fix leaking pkt in yuv4_read_packetAndreas Cadhalpun2016-12-081-2/+3
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-8/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-231-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | avformat/yuv4mpegdec: fix seeking for partial filesPaul B Mahol2016-03-031-1/+2
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'f890677d05bc4e8b494a73373ab4cc19791bf884'Hendrik Leppkes2015-10-221-1/+3
|\ \ | |/ | | | | | | | | | | * commit 'f890677d05bc4e8b494a73373ab4cc19791bf884': Replace any remaining avpicture function with imgutils Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * Replace any remaining avpicture function with imgutilsVittorio Giovara2015-10-211-1/+4
| | | | | | | | | | | | avpicture_get_size() -> av_image_get_buffer_size() Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avformat/yuv4mpegdec: Use 64bit for file offsetMichael Niedermayer2015-07-121-1/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/yuv4mpegdec: remove unused variablePaul B Mahol2015-07-111-1/+0
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/yuv4mpegdec: Remove unused variablesMichael Niedermayer2015-07-111-4/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | yuv4mpeg: add rough duration estimate and seeking.Ronald S. Bultje2015-07-111-7/+19
| | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '08fa34bf75942f66796d770ff42a3721b2e3d2d4'Michael Niedermayer2015-01-291-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '08fa34bf75942f66796d770ff42a3721b2e3d2d4': yuv4mpegdec: initialize field_order in yuv4_read_header() Conflicts: libavformat/yuv4mpegdec.c See: 52a17972defa118705a4020a6d0bb3ad277df819 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * yuv4mpegdec: initialize field_order in yuv4_read_header()Vittorio Giovara2015-01-291-1/+1
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1265721
* | avformat/yuv4mpegdec: fix "warning: field_order may be used uninitialized in ↵Michael Niedermayer2014-12-101-1/+1
| | | | | | | | | | | | this function" Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b513bf6f69e26e724de6d5dca642c3582dcd0517'Michael Niedermayer2014-05-181-23/+23
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'b513bf6f69e26e724de6d5dca642c3582dcd0517': yuv4mpegdec: do not set coded_frame properties Conflicts: libavformat/yuv4mpegdec.c See: b45a3e167f497d82effbf8ada453ea47b0ee21da Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * yuv4mpegdec: do not set coded_frame propertiesAnton Khirnov2014-05-181-20/+6
| | | | | | | | | | | | coded_frame is not meant to be changed from outside of lavc, and is not used for decoding. Set AVCodecContext.field_order instead.
* | Merge commit 'e4dc1000d7bbbcb5b45cf9849fc5315f19578e37'Michael Niedermayer2014-05-181-47/+94
|/ | | | | | | | | | * commit 'e4dc1000d7bbbcb5b45cf9849fc5315f19578e37': yuv4mpeg: split the demuxer and muxer into separate files Conflicts: libavformat/yuv4mpegdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* yuv4mpeg: split the demuxer and muxer into separate filesAnton Khirnov2014-05-181-0/+273