Commit Graph

21 Commits

Author SHA1 Message Date
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
Nidhi Makhijani 0528226a05 a64: Return correct error code on invalid data stream
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-14 01:22:47 -07:00
Anton Khirnov 3ef6c5264b a64: check that extradata exists before reading from it 2014-05-18 10:20:19 +02:00
Anton Khirnov b136564909 a64: remove unneeded struct qualifier 2014-05-18 10:19:54 +02:00
Anton Khirnov f70381ab9d a64: remove interleaved mode.
It has been disabled since it was added two years ago.
2012-11-02 07:58:37 +01:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Martin Storsjö 20234a4bd7 cosmetics: Align muxer/demuxer declarations
Also add missing trailing commas, break long codec_tag lines and
add spaces in codec_tag declarations.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 19:19:59 +03:00
Diego Biurrun c88ebdb42c Eliminate pointless 0/NULL initializers in AVCodec and similar declarations. 2011-11-28 10:01:50 +01:00
Anton Khirnov dfc2c4d900 lavf: use designated initialisers for all (de)muxers.
It's more readable and less prone to breakage.
2011-07-17 06:58:37 +02:00
Mans Rullgard b27565b143 Remove statements immediately following unconditional jumps
This removes a number of compiler warnings.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 03:15:53 +01:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Anton Khirnov b7f2fdde74 avio: rename put_flush_packet -> avio_flush
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-16 22:59:39 -04:00
Anton Khirnov 77eb5504d3 avio: avio: avio_ prefixes for put_* functions
In the name of consistency:
put_byte           -> avio_w8
put_<type>         -> avio_w<type>
put_buffer         -> avio_write

put_nbyte will be made private
put_tag will be merged with avio_put_str

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-21 14:25:15 -05:00
Diego Elio Pettenò c6610a216e Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.
2011-01-26 22:10:09 +00:00
Tobias Bindhammer 2a26520a97 Cosmetics, lots of.
Originally committed as revision 25348 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-05 12:14:30 +00:00
Tobias Bindhammer 8731c86d03 Solving memory leak and initialization problem with prev_pkt / pkt.
Originally committed as revision 25004 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-31 07:15:11 +00:00
Tobias Bindhammer 133cc989dd Cosmetic changes.
Originally committed as revision 24944 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-26 10:03:14 +00:00
Tobias Bindhammer 2fdb2b5438 Insert info from extradata into header
Originally committed as revision 24943 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-26 10:03:11 +00:00
Tobias Bindhammer 9e906bb1bf Added option to write frames interleaved (yet disabled)
For this reason, a MuxerContext and write_trailer()-function was added,
to track the previous packet and flush the last packet at the end.

Originally committed as revision 24942 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-26 10:03:09 +00:00
Tobias Bindhammer bb07ab7cf2 fixed some return values and deprecated CODEC_TYPE_VIDEO.
dithering (faster) along a linear gradient now.

Originally committed as revision 24898 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-24 14:02:31 +00:00
Tobias Bindhammer 901694f160 Corresponding muxer for the a64 codec
Originally committed as revision 24875 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-23 11:47:50 +00:00