Commit Graph

43 Commits

Author SHA1 Message Date
Anton Khirnov 83548fe894 lavf: fix usage of AVIOContext.seekable
It is supposed to be a flag. The only currently defined value is
AVIO_SEEKABLE_NORMAL, but other ones may be added in the future.
However all the current lavf code treats this field as a bool (mainly
for historical reasons).
Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
2016-09-30 16:54:33 +02:00
Diego Biurrun d9442d1303 rm: Drop broken disabled cruft 2016-08-17 12:16:42 +02:00
Vittorio Giovara 41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02: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
Anton Khirnov 1f008f34d5 rmenc: do not use AVCodecContext.frame_size
It will not be set if the stream codec context is not the encoding
context. Use av_get_audio_frame_duration() instead, it should work for
all audio codecs supported by the muxer.
2015-12-12 21:19:08 +01:00
Luca Barbato d34039b171 rmenc: Drop the temporary buffer for ac3 byteswap
Use direcly avio_w8().

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-04-20 12:41:33 +02:00
Federico Tomassetti d3aa307da0 rmenc: Check memory allocation
Bug-Id: CID 1257832

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-21 23:18:14 +01:00
Andreas Cadhalpun bb4edddd93 rmenc: limit packet size
The chunk size is limited to UINT16_MAX (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-05 15:51:05 +01:00
Diego Biurrun daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Anton Khirnov 194be1f43e lavf: switch to AVStream.time_base as the hint for the muxer timebase
Previously, AVStream.codec.time_base was used for that purpose, which
was quite confusing for the callers. This change also opens the path for
removing AVStream.codec.

The change in the lavf-mkv test is due to the native timebase (1/1000)
being used instead of the default one (1/90000), so the packets are now
sent to the crc muxer in the same order in which they are demuxed
(previously some of them got reordered because of inexact timestamp
conversion).
2014-06-18 15:12:34 +02:00
Clément Bœsch 7308439158 lavf: Don't explicitly flush after each written packet in muxers
Since 596e5d4783, this is not necessary anymore. It also allows to
actually disable the flushing, improving write performance (but
possibly giving worse latency in real-time streaming).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:17:33 +03:00
Anton Khirnov 3b4bb19e63 lavf: flush the output AVIOContext in av_write_trailer().
This is consistent with stdio and is what we want to do in all cases.

Fixes a bug in the voc muxer which didn't flush in write_trailer()
previously. This is the cause of the change in the test results.
2012-09-15 18:25:07 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Diego Biurrun 6774247a9d avformat: Drop pointless "format" from container long names 2012-07-30 13:59:06 +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 44b0edda3f Drop some pointless void* return value casts from av_malloc() invocations. 2012-01-02 16:41:24 +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
Anton Khirnov d2d67e424f Remove all uses of now deprecated metadata functions. 2011-06-08 07:43:45 +02:00
Anton Khirnov 8978fedaee avio: introduce an AVIOContext.seekable field
Use it instead of url_is_streamed and AVIOContext.is_streamed.
2011-04-03 22:46:40 +02:00
Anton Khirnov 447fe33691 rmenc: replace avio_seek(0) with avio_tell()
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-20 20:33:05 -04: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 6b4aa5dac8 avio: avio_ prefix for url_fseek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-01 12:12:33 -05:00
Anton Khirnov bbc413f943 lavf: replace remaining uses of put_tag with avio_write
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-25 14:38:56 -05:00
Anton Khirnov 0abdb29317 lavf: use a new ffio_wfourcc macro instead of put_tag() where possible
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-25 14:38:22 -05: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
Anton Khirnov ae628ec1fd avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-20 08:37: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
Francesco Lavra 22a255842b Reindent after r23361.
Patch by Francesco Lavra <francescolavra interfree it>.

Originally committed as revision 23362 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-05-28 18:21:57 +00:00
Francesco Lavra cff87f0404 Use ff_rm_codec_tags[] in RM muxer. This, incidentally, also allows muxing
other audio codecs rather than only AC-3, so add some code that makes
word byte-swapping only happen for AC-3, not for all audio codecs.

Patch by Francesco Lavra <francescolavra interfree it>.

Originally committed as revision 23361 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-05-28 18:21:25 +00:00
Jean-Daniel Dupas cc947f04cc Replace all occurences of PKT_FLAG_KEY with AV_PKT_FLAG_KEY.
Patch by Jean-Daniel Dupas, devlists shadowlab org

Originally committed as revision 22744 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-31 12:29:58 +00:00
Stefano Sabatini 72415b2adb Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-30 23:30:55 +00:00
Ronald S. Bultje 8b9794e542 Remove index writing in RM muxer, since it is broken (multiple streams per
single index chunk) and is always empty anyway. See "[PATCH] rmenc.c: remove
index writing" thread.

Originally committed as revision 18119 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-21 20:34:24 +00:00
Aurelien Jacobs 7379d5bc0b use new metadata API in rm (de)muxer
Originally committed as revision 17396 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-17 21:40:38 +00:00
Diego Biurrun 517ac2434b Use more descriptive format long_names.
Originally committed as revision 17184 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-12 17:26:06 +00:00
Diego Biurrun 406792e7b0 cosmetics: Remove pointless period after copyright statement non-sentences.
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-19 15:46:40 +00:00
Ronald S. Bultje 1edddc99dc Split RMContext into RMDemux/MuxContext and make them private in rmdec/enc.c.
Reason for this is that there are no shared entries in the demuxer/muxer
context, making it a mystery as to why it was shared between the two. See
"[PATCH] clean rmdemux/muxcontext" patch on mailinglist.

Originally committed as revision 16111 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-13 21:40:20 +00:00
Justin Ruggles 14b7062829 cosmetics: make all references to AC-3 capitalized and hyphenated
Originally committed as revision 14523 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-08-03 16:42:32 +00:00
Stefano Sabatini bde15e74de Make long_names in lavf/lavdev optional depending on CONFIG_SMALL.
patch by Stefano Sabatini, stefano.sabatini-lala poste.it
along with some spelling/consistency fixes for the long names by me

Originally committed as revision 13649 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-03 16:20:54 +00:00
Diego Biurrun f4433de9ef consistency cosmetics: indices --> indexes
Originally committed as revision 13444 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-05-26 23:14:25 +00:00
Kostya Shishkov 47ac2b0d14 Fix muxer so that generated files are playable by realplayer, other open
source players and by fixed ffmpeg rm demuxer (after r11127)
Patch by kostya

Originally committed as revision 11129 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-12-02 17:51:05 +00:00
Björn Axelsson 899681cd1d Use dynamically allocated ByteIOContext in AVFormatContext
patch by: Björn Axelsson, bjorn d axelsson a intinor d se
thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007

Originally committed as revision 11071 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-11-21 07:41:00 +00:00
Aurelien Jacobs 7b2a2ce556 split rm muxer and demuxer in their own files
Originally committed as revision 9156 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-05-30 09:44:16 +00:00