summaryrefslogtreecommitdiff
path: root/libavformat/internal.h
Commit message (Collapse)AuthorAge
* movenc: Use packets in interleaving queues for the duration at the end of ↵Martin Storsjö2016-05-18
| | | | | | | | | | | | | | fragments As long as caller only writes packets using av_interleaved_write_frame with no manual flushing, this should allow us to always have accurate durations at the end of fragments, since there should be at least one queued packet in each stream (except for the stream where the current packet is being written, but if the muxer itself does the cutting of fragments, it also has info about the next packet for that stream). Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* avformat: expose av_stream_new_side_data helperJohn Stebbins2015-11-18
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: deprecate compute_pkt_fields2Anton Khirnov2015-11-09
| | | | | | | | | All encoders set pts and dts properly now (and have been doing that for a while), so there is no good reason to do any timestamp guessing in the muxer. The newly added AVStreamInternal will be later used for storing all the private fields currently living in AVStream.
* avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* lavf: move internal fields from public to internal contextwm42015-02-10
| | | | | | | This is not an API change; the fields were explicitly declared private before. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: add a convenience function for adding side data to a streamAnton Khirnov2015-01-27
|
* Revert "lavf: Don't try to update files atomically with renames on windows"Martin Storsjö2014-11-27
| | | | | | | | | This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c. After taking MoveFileEx into use, we can replace files with renames on windows as well. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlinkMartin Storsjö2014-11-24
| | | | | | | | | | | | | | | | | | This makes sure that the internal utf8 path names are handled properly - the normal file handling functions assume path names are in the native codepage, which isn't utf8. This assumes that the tools outside of lavf don't use the mkdir definition. (The tools don't do the same reading of command line parameters as wchar either - they probably won't handle all possible unicode file parameters properly, but at least work more predictably if no utf8/wchar conversion is involved.) This is moved further down in os_support.h, since windows.h shouldn't be included before winsock2.h, while io.h needs to be included before the manual defines for lseek functions. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Don't try to update files atomically with renames on windowsMartin Storsjö2014-11-24
| | | | | | | | | On windows, rename(2) will fail if the target file exists. On unix this trick is used to make sure that people reading the file either will get the full previous file, or the full new version of the file, but no intermediate version. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: replace rename() with ff_rename()Luca Barbato2014-10-24
| | | | | | | | | The new function wraps errno so that its value is correctly reported when other functions overwrite it (eg. in case of logging). CC: libav-stable@libav.org Bug-Id: CID 1135748 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavf: switch to AVCodecContext.framerate for demuxingAnton Khirnov2014-10-15
|
* lavf: eliminate ff_get_audio_frame_size()Anton Khirnov2014-08-13
| | | | | | | | | | | | | | | It is basically a wrapper around av_get_audio_frame_duration(), with a fallback to AVCodecContext.frame_size. However, that field is set only when the stream codec context is actually used for encoding or decoding, which is discouraged. For muxing, it is generally the responsibility of the caller to set the packet duration. For demuxing, if the duration is not stored at the container level, it should be set by the parser. Therefore, removing the frame_size fallback should not break any important case.
* avpacket: Check for and return errors in ff_interleave_add_packet()Nidhi Makhijani2014-07-17
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* lavf: ignore attachment streams for interleaving purposesAnton Khirnov2014-02-04
| | | | Those streams should never get any packets by definition.
* lavf: improve support for AVC-Intra files.Reimar Döffinger2013-11-14
| | | | | | | | Generate extradata with SPS/PPS based on container dimensions. Authors of this commit are: Reimar and Thomas Mundt Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avf: move url utility functions in a separate fileLuca Barbato2013-06-16
|
* avf: move ff_http_match_no_proxy to networkLuca Barbato2013-06-16
| | | | It is only used by network protocols.
* lavf: Handle the environment variable no_proxy more properlyMartin Storsjö2013-02-27
| | | | | | | | | | | | | | | | | | | | The handling of the environment variable no_proxy, present since one of the initial commits (de6d9b6404), is inconsistent with how many other applications and libraries interpret this variable. Its bare presence does not indicate that the use of proxies should be skipped, but it is some sort of pattern for hosts that does not need using a proxy (e.g. for a local network). As investigated by Rudolf Polzer, different libraries handle this in different ways, some supporting IP address masks, some supporting arbitrary globbing using *, some just checking that the pattern matches the end of the hostname without regard for whether it actually is the right domain or a domain that ends in the same string. This simple logic should be pretty similar to the logic used by lynx and curl. Signed-off-by: Martin Storsjö <martin@martin.st>
* doxy: Clarify what avpriv_set_pts_info doesDerek Buitenhuis2012-12-17
| | | | | | The "pts for a given stream" was nonsensical. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* lavf: add a common function for selecting a pcm codec from parametersJustin Ruggles2012-11-28
|
* lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.hJustin Ruggles2012-11-28
|
* rtp: set the payload type as stream idLuca Barbato2012-11-14
| | | | | | | Support multiple video/audio streams with different format in the same session. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avformat: split muxing functions from util.cLuca Barbato2012-10-01
|
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* lavf: make av_interleave_packet_per_dts() private.Anton Khirnov2012-03-20
| | | | | There is no reason for it to be public, it's only meant to be used internally.
* lavf: deprecate av_read_packet().Anton Khirnov2012-03-20
| | | | | | 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
* lavf: move CodecMime from matroska.h to internal.hAnton Khirnov2012-02-29
| | | | it will be useful for attached pictures in ID3v2
* libavformat: Add an ff_ prefix to some lavf internal symbolsMartin Storsjö2012-02-15
| | | | | | | | | | Prefix the functions/tables brktimegm, pcm_read_seek, dv_offset_reset, voc_get_packet, codec_movaudio_tags, codec_movvideo_tags. After this, lavf has no global symbols without the proper prefix. Signed-off-by: Martin Storsjö <martin@martin.st>
* frame{crc/md5}: set the stream timebase from codec timebase.Anton Khirnov2012-02-03
| | | | | | | | | | | | | Right now those muxers use the default timebase in all cases(1/90000). This patch avoid unnecessary rescaling and makes the printed timestamps more readable. Also, extend the printed information to include the timebases and packet pts/duration and align the columns. Obviously changes the results of all fate tests which use those two muxers.
* libavformat: Add a utility function for adding parameter change side dataMartin Storsjö2011-12-21
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: make av_set_pts_info private.Anton Khirnov2011-11-30
| | | | It's supposed to be called only from (de)muxers.
* lavf: make some seeking functions privateAnton Khirnov2011-10-28
| | | | | | | Specifically av_update_cur_dts(), av_seek_frame_binary() and av_gen_search(). They are not supposed to be called outside lavf.
* lavf: use avpriv_ prefix for ff_new_chapter().Anton Khirnov2011-10-20
| | | | It's used in libavdevice.
* lavf: factor out conversion of ISO8601 string to unix timeAnton Khirnov2011-07-13
|
* doxygen: Escape '\' in Doxygen documentation.Diego Biurrun2011-07-03
|
* Use av_printf_format to check the usage of printf style functionsMartin Storsjö2011-06-23
| | | | | | | | This helps catching cases where the format string doesn't match what is passed in, or injection bugs where user data is passed in as format string. Signed-off-by: Martin Storsjö <martin@martin.st>
* sdp: Allow passing an AVFormatContext to the SDP generationMartin Storsjö2011-06-10
| | | | | | | Options from the AVFormatContext can be read for modifying the generated SDP. Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Wrap #ifdef DEBUG and av_hex_dump_log() combination in a macro.Diego Biurrun2011-06-03
|
* lavf: remove FF_API_URL_SPLIT cruftAnton Khirnov2011-04-19
|
* lavf: make av_guess_image2_codec internalAnton Khirnov2011-04-08
| | | | It doesn't look very useful as a public function.
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* lavf: Make make_absolute_url a lavf internal functionMartin Storsjö2011-03-17
| | | | | | This is shared by both applehttp demuxer and protocol. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avio: rename ByteIOContext to AVIOContext.Anton Khirnov2011-02-20
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Deprecate parse_date() in favor of av_parse_time().Stefano Sabatini2011-02-16
| | | | | | | | The new av_parse_time() is created in libavutil/parseutils.h, all the internal functions used by parse_date are moved to libavutil/parseutils.c and made static. Signed-off-by: Mans Rullgard <mans@mansr.com>
* lavf: rename ff_probe_input_buffer to make it publicAnssi Hannula2011-02-08
| | | | | | | It is useful for applications that hand input data directly to lavf via a ByteIOContext. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* lavf: simplify pb parameter of ff_probe_input_bufferAnssi Hannula2011-02-08
| | | | | | | There is no need to pass the ByteIOContext via a pointer to a pointer anymore. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* lavf: update ff_probe_input_buffer documentationAnssi Hannula2011-02-08
| | | | | | It never reopens the bytestream anymore. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>