summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
Commit message (Collapse)AuthorAgeFilesLines
* avformat: deprecate AVFormatContext io_close callbackMarton Balint2023-02-161-0/+5
| | | | | | io_close2 should be used instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: remove FF_API_AVSTREAM_CLASSJames Almer2023-02-091-2/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove FF_API_LAVF_PRIV_OPTJames Almer2023-02-091-3/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Move AVOutputFormat internals out of public headerAndreas Rheinhardt2023-02-091-109/+0
| | | | | | | | | | | | | | This commit does for AVOutputFormat what commit 20f972701806be20a77f808db332d9489343bb78 did for AVCodec: It adds a new type FFOutputFormat, moves all the internals of AVOutputFormat to it and adds a now reduced AVOutputFormat as first member. This does not affect/improve extensibility of both public or private fields for muxers (it is still a mess due to lavd). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/avformat: Move codecpar up in AVStreamAndreas Rheinhardt2023-02-091-11/+11
| | | | | | | | | It is the most commonly used field and moving it to the start e.g. allows to encode the offset in a pointer+offset addressing mode on one byte on x86. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/avformat: Remove AVOutputFormat.data_codecAndreas Rheinhardt2023-02-091-1/+0
| | | | | | | No AVOutputFormat has this set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/avformat: Improve doxy styleMarvin Scholz2022-10-171-77/+103
| | | | Mostly re-indenting and adding some missing references.
* avformat/avformat: Fix mismatching argument namesMarvin Scholz2022-10-171-2/+2
|
* lavf: deprecate av_stream_get_end_pts()Anton Khirnov2022-08-221-0/+3
| | | | | | | | | | | According to its documentation it returns "pts of the last muxed packet + its duration", but the value it actually returns right now is (possibly guessed) dts after muxer-internal bitstream filtering (if any). This function was added for ffmpeg.c, but it is not used there anymore. Since the value it returns is ill-defined and so inappropriate for any serious use, deprecate it.
* Keep including the full version.h when headers are included externallyMartin Storsjö2022-03-191-0/+6
| | | | | | | | | This avoids unnecessary churn and build breakage for users, by making sure the whole version.h is included like it has been so far, while keeping the benefit of not needing to rebuild most files in the ffmpeg tree on minor/micro bumps. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Split version.hMartin Storsjö2022-03-161-1/+1
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Add non diegetic stream disposition flagVittorio Giovara2022-03-151-0/+7
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mux: Peek into the muxing queue for avoid_negative_tsAndreas Rheinhardt2022-01-211-1/+1
| | | | | | | | | | | Peeking into the muxing queue can improve the estimate of the lowest timestamp needed for avoid_negative_ts in case the lowest timestamp is in a packet other than the first packet to be muxed. This fixes tickets #4536 and #5784 as well as the output from the matroska-avoid-negative-ts FATE-test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Add AVFMT_AVOID_NEG_TS_DISABLEDAndreas Rheinhardt2022-01-211-0/+1
| | | | | | And also don't use explicit constants in the movenc test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: add a flag for experimental (de)muxersAnton Khirnov2022-01-031-0/+7
|
* avformat: introduce AVFormatContext io_close2 which returns an intMarton Balint2021-12-121-0/+13
| | | | | | | | | | | | | | | | | Otherwise there is no way to detect an error returned by avio_close() because ff_format_io_close cannot get the return value. Checking the return value of the close function is important in order to check if all data was successfully written and the underlying close() operation was successful. It can also be useful even for read mode because it can return any pending AVIOContext error, so the user don't have to manually check AVIOContext->error. In order to still support if the user overrides io_close, the generic code only uses io_close2 if io_close is either NULL or the default io_close callback. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/avformat: Add AVStream parameter to check_bitstream() sigAndreas Rheinhardt2021-11-271-1/+6
| | | | | | | | | | For most check_bitstream() functions this just avoids having to dereference s->streams[pkt->stream_index] themselves; but for meta-muxers it will allow to forward the packet to stream with a different stream_index (belonging to a different AVFormatContext) without using a spare packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: add public functions converting dispositions to/from stringsAnton Khirnov2021-11-161-0/+14
|
* lavf: add an AVClass to AVStream on next major bumpAnton Khirnov2021-11-161-0/+15
| | | | | | | Also add a function to retrieve that class, analogously to avformat_get_class(). This will be useful for adding an AVOption for dispositions.
* lavf: improve AV_DISPOSITION_* doxyAnton Khirnov2021-11-161-19/+77
| | | | | Also switch the values definition to the (1 << N) style, which is easier to read.
* avformat/mux: Don't use stack packet when writing interleaved packetsAndreas Rheinhardt2021-10-031-3/+15
| | | | | | | | | | | | | | | | | | | Currently the interleave_packet functions use a packet for a new packet to be interleaved (may be NULL if there is none) and a packet for output; said packet is always a stack packet in interleaved_write_packet(). But all the interleave_packet functions in use first move the packet to the packet list and then check whether a packet can be returned, i.e. the effective lifetime of the new packet ends before the packet for output is touched. So one can use one packet both for input and output by adding a new parameter that indicates whether there is a packet to add to the packet list; there is just one complication: In case the muxer is flushed, there is no packet available. This can be solved by reusing one of the packets from AVFormatInternal. They are currently unused when flushing in av_interleaved_write_frame(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Clarify documentation of av_interleaved_write_frame()Andreas Rheinhardt2021-10-031-8/+7
| | | | | | | | | | | | | | | | | | | The earlier documentation claimed that av_interleaved_write_frame() always orders by dts, which is not necessarily true when using muxers with custom interleavement functions or the audio_preload option. Furthermore, the documentation stated that libavformat takes ownership of the reference of the provided packet (if it is refcounted) and that the caller may not access the data through this reference after the function returns. This suggests that the returned packet is not blank, but instead still contains some set, but invalid fields, which implies that it would be dangerous to unreference this packet again. But this is not true: av_interleaved_write_frame()'s actual behaviour is to always output blank packet (even on error). This commit documents this fact so that callers know that they can directly reuse this packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-171-8/+0
| | | | | | | | | | Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Avoid allocation for AVFormatInternalAndreas Rheinhardt2021-09-171-8/+0
| | | | | | | | | | | | | 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>
* avformat: Add internal flags for AV(In|Out)putFormatAndreas Rheinhardt2021-07-071-0/+10
| | | | | | | | | | | | | | | | Both AVInputFormat and AVOutputFormat currently lack an equivalent to AVCodec's caps_internal. E.g. if reading a header fails, each demuxer is currently required to clean up manually, which often means to just call the demuxer's read_close function. This could (and will) be done generically via an equivalent of FF_CODEC_CAP_INIT_CLEANUP. Because of the unholy ABI-relationship between libavdevice and libavformat adding such a flag is only possible when the ABI is open (despite the flag not being part of the public API), such as now. Therefore such a flag is also added to AVOutputFormat, despite there being no immediate use for it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: clarify probesize/format_probesize doxyAnton Khirnov2021-06-111-5/+15
| | | | | probesize is not used for probing the input format, but its documentation claims it does.
* avformat: make AVStream.pts_wrap_bits publicJames Almer2021-06-101-10/+7
| | | | | | | It can be useful to library users, and is currently being used by ffmpeg.c Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/avformat.h: drop the avcodec.h includeAnton Khirnov2021-06-101-1/+6
| | | | | Since AVStream.codec is gone, avformat.h does not require anything from avcodec.h.
* avformat: move AVStream.{first,cur}_dts to AVStreamInternalJames Almer2021-06-091-11/+0
| | | | | | They are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: move AVStream.stream_identifier to AVStreamInternalJames Almer2021-05-071-7/+0
| | | | | | It's a private field, no reason to have it exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: move AVStream.codec_info_nb_frames to AVStreamInternalJames Almer2021-05-071-5/+0
| | | | | | It's a private field, no reason to have it exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: move AVStream.{parser,need_parsing} to AVStreamInternalJames Almer2021-05-071-4/+0
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: move AVStream.probe_packets to AVStreamInternalJames Almer2021-05-071-5/+0
| | | | | | It's a private fields, no reason to have it exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: move AVStream.last-IP_{pts,duration} to AVStreamInternalJames Almer2021-05-071-2/+0
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: constrain the lifetime of the pointer returned by ↵James Almer2021-05-061-6/+6
| | | | | | | | | avformat_index_get_entry() This will give us more room to improve the implementation later. Suggested-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated AVStream.codecJames Almer2021-04-271-12/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat, utils: Make av_find_best_stream const-correctAndreas Rheinhardt2021-04-271-1/+1
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Constify AVFormatContext.*_codec pointersAndreas Rheinhardt2021-04-271-4/+4
| | | | | | | | This also allows to exclusively use pointers to const AVCodec in fftools/ffmpeg_opt.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-271-8/+0
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Switch AVChapter.id to 64bitsAndreas Rheinhardt2021-04-271-4/+0
| | | | | | | Announced in e318438f2f30525d8baca2b5683aa9898d0c56f7. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove deprecated av_demuxer_open()Andreas Rheinhardt2021-04-271-9/+1
| | | | | | | Deprecate in e37f161e66e042d6c2c7470c4d9881df9427fc4a. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove deprecated AVFMT_FLAG_MP4A_LATM flag, latm optionAndreas Rheinhardt2021-04-271-3/+0
| | | | | | | Deprecated in 67747c89ad4d3bfb4381c3d274603a4f0da773d8. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove remnants of side data mergingAndreas Rheinhardt2021-04-271-3/+0
| | | | | | | | Deprecated in d682ae70b4b3a53fb73ec30281f9f4cfbc531edd, ineffective since ca4df37f06f8a47651c67693b4851ed8d7e3ef74. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Remove outdated private fieldsAndreas Rheinhardt2021-04-271-47/+0
| | | | | | | | Affected function pointers (always NULL) in AVInputFormat, AVOutputFormat as well as private fields of AVStream. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove deprecated filename field from AVFormatContextAndreas Rheinhardt2021-04-271-13/+0
| | | | | | | Deprecated in fa8308d3d4f27d6fb38ac2069887a7b259f1c6ab. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove getters and settersAndreas Rheinhardt2021-04-271-48/+0
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove deprecated old open callbacksAndreas Rheinhardt2021-04-271-26/+0
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove FFserver leftoversAndreas Rheinhardt2021-04-271-18/+0
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify the API wrt AV(In|Out)putFormatAndreas Rheinhardt2021-04-271-25/+19
| | | | | | | Also constify AVProbeData. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec, avformat: Remove old BSF APIAndreas Rheinhardt2021-04-271-17/+0
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>