1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

32 Commits

Author SHA1 Message Date
Andreas Rheinhardt
fed0282508 avformat: Avoid allocation for AVFormatInternal
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>
2021-09-17 04:58:34 +02:00
Andreas Rheinhardt
9abf0e0419 avformat/yuv4mpegdec: Don't call avio_tell() twice
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-30 15:48:11 +02:00
Andreas Rheinhardt
046cbd255e avformat/yuv4mpegdec: Use table instead of repeated "else if"
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>
2021-07-23 15:05:39 +02:00
Andreas Rheinhardt
bc70684e74 avformat: Constify all muxer/demuxers
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>
2021-04-27 11:48:06 -03:00
Paul B Mahol
c693e7b053 avformat/yuv4mpegdec: add support for 444alpha 2020-03-19 17:34:31 +01:00
Paul B Mahol
4eb5dfb52e avformat/yuv4mpegdec: use proper error codes 2020-03-19 17:34:31 +01:00
Andreas Rheinhardt
6a67d518d6 avformat: Remove unnecessary av_packet_unref()
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>
2020-02-10 22:41:38 +01:00
Gyan Doshi
0b1ff3265e avformat/yuv4mpegdec: increase header limit
Allows demuxing UHD 30000/1001 fps yuvj420p files
2020-01-26 21:44:43 +05:30
Gyan Doshi
724e6b3d63 avformat/yuv4mpegdec: better error logging 2020-01-26 21:44:38 +05:30
Paul B Mahol
05a2ce9326 avformat/y4m: do not try to seek if pts is less than 0
Fixes #8193.
2019-09-22 19:25:55 +02:00
Carl Eugen Hoyos
4d8875ec23 lavf: Constify the probe function argument.
Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
2019-03-21 11:42:17 +01:00
Wang Cao
5a99e00023 libavformat/yuv4mpeg: Add color range support for Y4M Add color_range 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>
2018-06-30 00:41:35 +02:00
Paul B Mahol
5abcf45d75 avformat/yuv4mpegdec: simplify math
This one actually works with hd1080 y4m files when seeking backwards.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-05-03 14:15:07 +02:00
Paul B Mahol
b2570afde3 avformat/yuv4mpegdec: fix seeking backwards
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-25 18:30:46 +02:00
Mateusz
a4743d2574 avformat/yuv4mpeg: add gray9/10/12 support
Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
2017-10-26 18:32:28 +02:00
Andreas Cadhalpun
e3694478a9 yuv4mpegdec: fix leaking pkt in yuv4_read_packet
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-08 00:26:41 +01:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* 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>
2016-04-10 20:59:55 +01:00
Paul B Mahol
dd2ea5cbfb avformat/yuv4mpegdec: fix seeking for partial files
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-03-03 09:28:15 +01:00
Anton Khirnov
9200514ad8 lavf: replace AVStream.codec with AVStream.codecpar
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.
2016-02-23 17:01:58 +01:00
Hendrik Leppkes
470204218f Merge commit 'f890677d05bc4e8b494a73373ab4cc19791bf884'
* commit 'f890677d05bc4e8b494a73373ab4cc19791bf884':
  Replace any remaining avpicture function with imgutils

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-22 20:48:54 +02:00
Vittorio Giovara
f890677d05 Replace any remaining avpicture function with imgutils
avpicture_get_size() -> av_image_get_buffer_size()

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:59 +02:00
Michael Niedermayer
944a1aa3c5 avformat/yuv4mpegdec: Use 64bit for file offset
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-12 00:00:21 +02:00
Paul B Mahol
3666974230 avformat/yuv4mpegdec: remove unused variable
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-11 19:31:04 +00:00
Michael Niedermayer
9b8b804cfb avformat/yuv4mpegdec: Remove unused variables
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-11 14:49:55 +02:00
Ronald S. Bultje
733c5d889b yuv4mpeg: add rough duration estimate and seeking.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-11 14:46:19 +02:00
Michael Niedermayer
c2ad22ff99 Merge commit '08fa34bf75942f66796d770ff42a3721b2e3d2d4'
* commit '08fa34bf75942f66796d770ff42a3721b2e3d2d4':
  yuv4mpegdec: initialize field_order in yuv4_read_header()

Conflicts:
	libavformat/yuv4mpegdec.c

See: 52a17972de
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-29 21:55:02 +01:00
Vittorio Giovara
08fa34bf75 yuv4mpegdec: initialize field_order in yuv4_read_header()
CC: libav-stable@libav.org
Bug-Id: CID 1265721
2015-01-29 15:26:33 +00:00
Michael Niedermayer
52a17972de avformat/yuv4mpegdec: fix "warning: field_order may be used uninitialized in this function"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-10 14:46:39 +01:00
Michael Niedermayer
213e82b55c Merge commit 'b513bf6f69e26e724de6d5dca642c3582dcd0517'
* commit 'b513bf6f69e26e724de6d5dca642c3582dcd0517':
  yuv4mpegdec: do not set coded_frame properties

Conflicts:
	libavformat/yuv4mpegdec.c

See: b45a3e167f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-18 14:02:31 +02:00
Michael Niedermayer
56d3cd1455 Merge commit 'e4dc1000d7bbbcb5b45cf9849fc5315f19578e37'
* commit 'e4dc1000d7bbbcb5b45cf9849fc5315f19578e37':
  yuv4mpeg: split the demuxer and muxer into separate files

Conflicts:
	libavformat/yuv4mpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-18 13:37:25 +02:00
Anton Khirnov
b513bf6f69 yuv4mpegdec: do not set coded_frame properties
coded_frame is not meant to be changed from outside of lavc, and is not
used for decoding.
Set AVCodecContext.field_order instead.
2014-05-18 10:22:08 +02:00
Anton Khirnov
e4dc1000d7 yuv4mpeg: split the demuxer and muxer into separate files 2014-05-18 10:21:31 +02:00