Commit Graph

714 Commits

Author SHA1 Message Date
John Stebbins 26b241c079 matroskaenc: Allow chapters to be written in trailer
This allows creation of frame accurate chapter marks from sources like
DVD and BD where the precise chapter location is not known until the
chapter mark has been reached during reading.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-04 20:30:43 +02:00
Diego Biurrun 64af59bc49 avformat: Fix references to removed av_close_input_file in Doxygen 2013-08-20 13:33:47 +02:00
Diego Biurrun e0f8be6413 avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate 2013-05-04 21:43:06 +02:00
Diego Biurrun a5f8873620 silly typo fixes 2013-05-03 18:26:12 +02:00
Luca Barbato c2cb01d418 lavf: introduce AVFMT_TS_NEGATIVE
Most formats do not support negative timestamps, shift them to avoid
unexpected behaviour and a number of bad crashes.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-04-25 10:13:27 +02:00
Anton Khirnov 85a5bc054c lavf: remove disabled FF_API_R_FRAME_RATE cruft 2013-03-11 18:23:50 +01:00
Anton Khirnov 7b486ab13b lavf: remove disabled FF_API_AV_GETTIME cruft 2013-03-11 18:23:18 +01:00
Anton Khirnov 32e5194969 lavf: remove disabled FF_API_INTERLEAVE_PACKET cruft 2013-03-11 18:23:10 +01:00
Anton Khirnov 435c2a31ad lavf: remove disabled FF_API_READ_PACKET cruft 2013-03-11 18:23:02 +01:00
Anton Khirnov 0a7c4daf46 lavf: remove disabled FF_API_CLOSE_INPUT_FILE cruft 2013-03-11 18:22:45 +01:00
Anton Khirnov 1afddbe59e avpacket: use AVBuffer to allow refcounting the packets.
This will allow us to avoid copying the packets in many cases.

This breaks ABI.
2013-03-08 07:33:45 +01:00
Diego Biurrun 511cf612ac miscellaneous typo fixes 2012-12-21 00:18:34 +01:00
Luca Barbato 8034130e06 rtp: set the payload type as stream id
Support multiple video/audio streams with different format in the
same session.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-11-14 20:38:51 +01:00
Luca Barbato 3b4296f414 avformat: clarify stream id for muxing 2012-11-14 20:38:51 +01:00
Anton Khirnov 9221efef79 lavf: fix av_interleaved_write_frame() doxy.
A sentence was mistakenly inserted in the middle of another sentence.
2012-11-02 18:28:56 +01:00
Anton Khirnov 717a450993 lavf: clarify the lifetime of demuxed packets. 2012-11-02 18:28:56 +01:00
Martin Storsjö 0af1fe845a avformat: Fix references to the removed function av_write_header in comments
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 16:33:48 +03:00
Diego Biurrun d3c40a7d1d avformat: const correctness for av_hex_dump / av_hex_dump_log 2012-10-01 13:18:28 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Anton Khirnov aba232cfa9 lavf: deprecate r_frame_rate.
According to its description, it is supposed to be the LCM of all the
frame durations. The usability of such a thing is vanishingly small,
especially since we cannot determine it with any amount of reliability.
Therefore get rid of it after the next bump.

Replace it with the average framerate where it makes sense.

FATE results for the wtv and xmv demux tests change. In the wtv case
this is caused by the file being corrupted (or possibly badly cut) and
containing invalid timestamps. This results in lavf estimating the
framerate wrong and making up wrong frame durations.
In the xmv case the file contains pts jumps, so again the estimated
framerate is far from anything sane and lavf again makes up different
frame durations.

In some other tests lavf starts making up frame durations from different
frame.
2012-07-29 08:06:30 +02:00
Anton Khirnov fe1c1198e6 lavf: use dts difference instead of AVPacket.duration in find_stream_info()
AVPacket.duration is mostly made up and thus completely useless, this is
especially true for video streams.
Therefore use dts difference for framerate estimation and
the max_analyze_duration check.

The asyncts test now needs -analyzeduration, because the default is 5
seconds and the audio stream in the sample appears at ~10 seconds.
2012-07-29 08:04:42 +02:00
Luca Barbato 681ed00099 avf: introduce nobuffer option
Useful in cases where a significant analyzeduration is
still needed, while minimizing buffering before output.

An example is processing low-latency streams where all
media types won't necessarily come in if the
analyzeduration is small.

Additional changes by Josh Allmann <joshua.allmann@gmail.com>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-07-29 07:58:00 +02:00
Mans Rullgard c19e0ebe53 lavf: include libavutil/time.h instead of redeclaring av_gettime()
This avoids some warnings about redundant declarations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-21 22:53:05 +01:00
Mans Rullgard ae0a301668 Move av_gettime() to libavutil
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 17:09:03 +01:00
James Zern e9cef89702 avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-05-20 19:50:32 -04:00
Anton Khirnov 1432c1c429 lavf: add missing '*' in a doxy. 2012-05-07 14:22:42 +02:00
Jindrich Makovicka 904100e5fc make av_interleaved_write_frame() flush packets when pkt is NULL
This patch allows the user to force flushing of all queued packets
by calling av_interleaved_write_frame() with pkt set to NULL.

Signed-off-by: Jindrich Makovicka <jindrich.makovicka@nangu.tv>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-27 11:12:55 +03:00
Anton Khirnov 967923abd1 lavf doxy: expand AVStream.codec doxy. 2012-03-26 10:59:43 +02:00
Anton Khirnov e44ada129c lavf doxy: improve AVStream.time_base doxy.
Remove confusing sentence that implied the user should set the timebase.
Elaborate on how the timebase is set for muxing.
2012-03-26 10:59:43 +02:00
Anton Khirnov f58b8cc3e3 lavf doxy: add some basic documentation about reading from the demuxer. 2012-03-26 10:59:43 +02:00
Anton Khirnov 10fa4ff7bc lavf doxy: document passing options to demuxers. 2012-03-26 10:59:43 +02:00
Anton Khirnov dca9c81d82 lavf doxy: clarify that an AVPacket contains encoded data. 2012-03-26 10:59:42 +02:00
Martin Storsjö e20ad71ebb libavformat: Document who sets the AVStream.id field
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-24 22:17:37 +02:00
Anton Khirnov a6733202cc lavf: make av_interleave_packet_per_dts() private.
There is no reason for it to be public, it's only meant to be used
internally.
2012-03-20 20:12:16 +01:00
Anton Khirnov 3c90cc2ef2 lavf: deprecate av_read_packet().
The caller can achieve the same effect (i.e. getting raw unparsed/mangled
packets) with av_read_frame() and AVFMT_FLAG_NOPARSE |
AVFMT_FLAG_NOFILLIN
2012-03-20 20:12:16 +01:00
Justin Ruggles 8c1d6ac66a avformat: do not require a pixel/sample format if there is no decoder
Also, do not keep trying to find and open a decoder in try_decode_frame() if
we already tried and failed once.

Fixes always searching until max_analyze_duration in
avformat_find_stream_info() when demuxing codecs without a decoder.
2012-03-05 13:08:18 -05:00
Anton Khirnov 27c7ca9c12 lavf: deobfuscate read_frame_internal().
Split off packet parsing into a separate function. Parse full packets at
once and store them in a queue, eliminating the need for tracking
parsing state in AVStream.

The horrible unreadable loop in read_frame_internal() now isn't weirdly
ordered and doesn't contain evil gotos, so it should be much easier to
understand.

compute_pkt_fields() now invents slightly different timestamps for two
raw vc1 tests, due to has_b_frames being set a bit later. They shouldn't
be more wrong (or right) than previous ones.
2012-03-05 18:47:05 +01:00
Anton Khirnov dd2a4bcfd7 lavf: generic code for exporting attached pictures. 2012-02-29 14:16:25 +01:00
Luca Barbato ee42df8a35 avf: reorder AVStream and AVFormatContext 2012-02-28 15:01:20 +01:00
Luca Barbato 6b8b0fe2bc doxy: remove reference to removed api 2012-02-19 19:10:28 +01:00
Anton Khirnov dd6d3b0e02 lavf: add functions for accessing the fourcc<->CodecID mapping tables.
Fixes bug 212.
2012-01-31 16:53:35 +01:00
Anton Khirnov f7fe41a04f lavf: rename AVInputFormat.value to raw_codec_id.
It's only used by raw demuxers for storing the codec id.
2012-01-31 07:50:31 +01:00
Anton Khirnov 183eaa9a25 lavf: reorder AVInput/OutputFormat fields.
Put all private fields at the end and mark them as such so they can be
easily changed/removed.

This breaks ABI.
2012-01-31 07:21:06 +01:00
Anton Khirnov c5254755c0 lavf: remove disabled FF_API_SET_PTS_INFO cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov bf868727d7 lavf: remove disabled FF_API_REORDER_PRIVATE cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov fd87ba3220 lavf: remove disabled FF_API_SEEK_PUBLIC cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov bd4c51312b lavf: remove disabled FF_API_STREAM_COPY cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 2a0f868cfa lavf: remove disabled FF_API_PRELOAD cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 1329827e79 lavf: remove disabled FF_API_NEW_STREAM cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov f0cb13958d lavf: remove disabled FF_API_MUXRATE cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 2f5e728b58 lavf: remove disabled FF_API_FILESIZE cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov df0bb26aca lavf: remove disabled FF_API_TIMESTAMP cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 3bbfd3026c lavf: remove disabled FF_API_LOOP_OUTPUT cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 6dc345555f lavf: remove disabled FF_API_LOOP_INPUT cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov b32e30faa1 lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 2d70912cc2 lavf: remove disabled FF_API_FLAG_RTP_HINT cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 1d911bb404 lavf: remove disabled FF_API_SDP_CREATE cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 64f6f6f836 lavf: remove disabled FF_API_GUESS_IMG2_CODEC cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 21824e5b88 lavf: remove disabled FF_API_PKT_DUMP cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov cc10ab79ec lavf: remove disabled FF_API_FIND_INFO_TAG cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov ecd5f41a06 lavf: remove disabled FF_API_PARSE_DATE cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 997420abf2 lavf: remove disabled FF_API_DUMP_FORMAT cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 2fb7501938 lavf: remove disabled FF_API_FORMAT_PARAMETERS cruft
Also remove now unused AVFormatParameters struct and
AVOutputFormat.set_parameters().
2012-01-27 10:52:42 +01:00
Anton Khirnov 38233fc131 lavf: remove disabled FF_API_OLD_METADATA2 cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov 6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Martin Storsjö f1caf01d5e libavformat: Add a flag for muxers that support write_packet(NULL) for flushing
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Anton Khirnov f97cb45156 lavf: fix and extend av_interleaved_write_frame() doxy.
Specify that lavf is responsible for freeing the data.
2012-01-18 20:08:13 +01:00
Anton Khirnov e5c708151e lavf: undeprecate read_seek().
The "new seeking API" was never finished and nobody is working on it.
2012-01-12 18:18:23 +01:00
Diego Biurrun 58c42af722 doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
Anton Khirnov 526604545f lavf: add avformat_close_input().
It sets the supplied AVFormatContext pointer to NULL after freeing it,
which is safer and its name is consistent with other lavf functions.

Also deprecate av_close_input_file().
2011-12-12 20:23:56 +01:00
Anton Khirnov 3a7f7678eb lavf: deprecate av_close_input_stream().
And remove all its uses.
2011-12-12 20:21:47 +01:00
Anton Khirnov 59826cab8a lavf doxy: add some basic demuxing documentation. 2011-12-12 19:44:23 +01:00
Anton Khirnov ccbc106841 lavf doxy: add some general lavf information. 2011-12-12 19:44:12 +01:00
Anton Khirnov abf2c2d787 lavf doxy: add misc utility functions to a group. 2011-12-12 19:44:03 +01:00
Anton Khirnov c8dffc02fd lavf doxy: add av_guess_codec/format to the encoding group. 2011-12-12 19:43:56 +01:00
Anton Khirnov 469c62d002 lavf doxy: add core functions to a doxy group. 2011-12-12 19:43:44 +01:00
Diego Biurrun da9cea77e3 Fix a bunch of common typos. 2011-12-11 00:32:25 +01:00
Anton Khirnov 489a7b07e9 lavf doxy: add muxing stuff to lavf_encoding group 2011-12-10 22:02:28 +01:00
Anton Khirnov 370f27dee3 lavf doxy: add demuxing stuff to lavf_decoding group 2011-12-10 22:02:28 +01:00
Anton Khirnov 28b4c06b9d lavf doxy: expand/reword metadata API doxy. 2011-12-10 22:02:28 +01:00
Anton Khirnov eca06cbed9 lavf doxy: add installed headers to groups. 2011-12-10 22:02:28 +01:00
Anton Khirnov e4f4a1f93e lavf doxy: rename lavf I/O group to lavf_io. 2011-12-10 22:02:28 +01:00
Anton Khirnov b262a05904 lavf doxy: add metadata docs to the main lavf group 2011-12-10 22:02:28 +01:00
Diego Biurrun c68fafe0d2 doxygen: eliminate Qt-style doxygen syntax 2011-12-05 13:06:58 +01:00
Anton Khirnov c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Luca Barbato e361b5089a doxy: structure libavformat groups 2011-11-22 17:16:02 +01:00
Martin Storsjö 6aa0b98fb2 avio: Add AVIOInterruptCB
This is a better io interrupt callback function, which has an
opaque parameter, which is given to the interrupt callback.

This allows callers to precisely cancel IO for one single
AVFormatContext, without interrupt other ones in the same
process.

Note, it's not needed in AVIOContext, at the moment.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-11-13 12:59:56 +01:00
Anton Khirnov 83daced0a3 lavf: expand doxy for some AVFormatContext fields. 2011-11-08 14:25:24 +01:00
Martin Storsjö 87892ef8a6 avformat: Revise wording
It might make sense not to make the function completely mandatory
immediately at the next bump, which might be quite soon after
the function was introduced.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-07 19:29:32 +02:00
Martin Storsjö b6d08f40aa avformat: Add functions for doing global network initialization
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-05 12:17:51 +02:00
Ronald S. Bultje 38a4be3fa7 lavf: use number of output pictures for delay checks.
This fixes false positives of has_codec_delay_been_guessed() for
streams where not every input picture generates an output picture,
such as interlaced H264.
2011-10-28 23:42:57 -07:00
Anton Khirnov 9a174562e4 lavf: move private fields in AVStream to the end at next bump. 2011-10-28 09:25:26 +02:00
Anton Khirnov df968050ab lavf: move private fields in AVFormatContext to the end at next bump. 2011-10-28 09:24:14 +02:00
Anton Khirnov a2faa95151 lavf: make some seeking functions private
Specifically av_update_cur_dts(), av_seek_frame_binary() and
av_gen_search().

They are not supposed to be called outside lavf.
2011-10-28 09:23:24 +02:00
Anton Khirnov 3d813e4c54 lavf: deprecate AVStream.stream_copy
It's only used in avconv, so it properly belongs to OutputStream struct
there.
2011-10-25 16:30:00 +02:00
Anton Khirnov f172132f82 mpegenc: add preload private option.
Deprecate AVFormatContext.preload.
2011-10-25 16:27:48 +02:00
Anton Khirnov 569129a6dc lavf: add avformat_new_stream as a replacement for av_new_stream.
It takes a codec parameter, thus enabling codec-specific defaults.
2011-10-19 17:02:11 +02:00
Anton Khirnov 5a9ee3152b mpegenc/mpegtsenc: add muxrate private options.
Deprecate AVFormatContext.mux_rate.
2011-10-17 08:39:53 +02:00
Anton Khirnov c10731e78b lavf: deprecate AVFormatContext.file_size
It's too unreliable to be useful. avio_size() should be called instead.
2011-10-17 08:25:38 +02:00
Justin Ruggles b631fba936 avformat: add AVInputFormat flag AVFMT_NO_BYTE_SEEK.
This will prevent seeking by bytes for formats that cannot handle this.
2011-10-13 16:31:15 -04:00