summaryrefslogtreecommitdiff
path: root/libavformat/fifo.c
Commit message (Collapse)AuthorAge
* avformat/mux: Rename FF_FMT_ALLOW_FLUSH->FF_OFMT_FLAG_ALLOW_FLUSHAndreas Rheinhardt2024-03-22
| | | | | | | It better reflects that this is a muxer-only flag. Also document the flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/fifo_test: Move into tests/fifo_muxer.cAndreas Rheinhardt2024-03-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This muxer solely exists to test the fifo muxer via a dedicated test tool in libavformat/tests/fifo_muxer.c. It fulfills no other role and it is only designed with this role in mind. The latter can be seen in two facts: The muxer uses printf for logging and it simply presumes the packets' data to contain a FailingMuxerPacketData (a struct duplicated in fifo_test.c and tests/fifo_muxer.c.); in particular, it presumes packets to have data at all, but this need not be true with side-data only packets and a segfault can easily be triggered by e.g. encoding flac (our native encoder sends a side-data only packet with updated extradata at the end of encoding). This patch fixes this by moving the test muxer into the fifo test tool, making it inaccessible via the API (and actually removing it from libavformat.so and libavformat.a). While this muxer was accessible via e.g. av_guess_format(), it was not really usable for an API user as FailingMuxerPacketData was not public. Therefore this is not considered a breaking change. In order to continue to use the test muxer in the test tool, the ordinary fifo muxer had to be overridden: fifo_muxer.c includes lavf/fifo.c but with FIFO_TEST defined which makes it support the fifo_test muxer. This is possible because test tools are always linked statically to their respective library. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf/fifo: sort options by nameStefano Sabatini2024-03-12
|
* lavf/fifo: fix typoStefano Sabatini2024-03-11
|
* avformat: remove deprecated FF_API_AVFORMAT_IO_CLOSEJames Almer2024-03-07
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-20
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-22
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Deprecate AVFMT_ALLOW_FLUSHAndreas Rheinhardt2023-10-03
| | | | | | | | | | | | | | | It is of no value to the user, because every muxer can always be flushed with a NULL packet. As its documentation shows ("If not set, the muxer will not receive a NULL packet in the write_packet function") it is actually an internal flag that has been publically exposed because there was no internal flags field for output formats for a long time. But now there is and so use it by replacing the public flag with a private one. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Anton Khirnov <anton@khirnov.net> Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: deprecate AVFormatContext io_close callbackMarton Balint2023-02-16
| | | | | | io_close2 should be used instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/avformat: Move AVOutputFormat internals out of public headerAndreas Rheinhardt2023-02-09
| | | | | | | | | | | | | | 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/fifo: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: set internal thread namesAnton Khirnov2022-10-24
|
* avformat: refactor ff_stream_encode_params_copy() to stream_params_copy()Pierre-Anthony Lemieux2022-08-12
| | | | | | Addresses http://ffmpeg.org/pipermail/ffmpeg-devel/2022-August/299726.html Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move ff_format_output_open() to mux_utils.cAndreas Rheinhardt2022-05-10
| | | | | | It is obviously a muxing-only function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: introduce AVFormatContext io_close2 which returns an intMarton Balint2021-12-12
| | | | | | | | | | | | | | | | | 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/fifo: avoid repeated scaling of timestamps on failure and recoveryRyoji Gyoda2021-11-29
| | | | | | | | | | | | | | | | | | | If fifo_thread_recover() succeeds immediately after fifo_thread_dispatch_message() fails, the dts of the packet is scaled twice, causing cur_dts to be abnormally large and "Application provided invalid, non monotonically increasing dts to muxer in stream" to occur repeatedly. Steps to reproduce: 1. ffmpeg -f lavfi -i testsrc -c:v libx264 -map 0:v -flags +global_header -f fifo -fifo_format flv -attempt_recovery 1 -recover_any_error 1 rtmp://example.com/livekey 2. set a breakpoint on fifo_thread_recover 3. force disconnect from the rtmp server 4. wait for break 5. reconnect to the rtmp server 6. resume execution of ffmpeg Signed-off-by: Ryoji Gyoda <gy.cft4@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-17
| | | | | | | | | | 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/fifo: Free dict on av_dict_copy() failureAndreas Rheinhardt2021-08-06
| | | | | | | | av_dict_copy() puts the onus on the caller to clean up dst on failure; it can be nonempty if copying a later entry of src fails after having successfully copied an earlier entry. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: move AVStream.{first,cur}_dts to AVStreamInternalJames Almer2021-06-09
| | | | | | They are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/fifo: check for flushed packets and timeshiftMichael Niedermayer2021-05-18
| | | | | | | Fixes: CID1464151 Dereference after null check Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify the API wrt AV(In|Out)putFormatAndreas Rheinhardt2021-04-27
| | | | | | | Also constify AVProbeData. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/fifo: add timeshift option to delay outputMarton Balint2020-06-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffplay, avcodec, avformat: Don't initialize before av_packet_ref()Andreas Rheinhardt2020-03-28
| | | | | | | It already initializes the packet. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/fifo: use AV_OPT_TYPE_DICT for format_optsMarton Balint2020-01-01
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf: Constify AVOutputFormat pointer.Carl Eugen Hoyos2019-03-20
|
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/fifo: Fix initialization of underlying AVFormatContextJan Sebechlebsky2017-07-19
| | | | | | | | | | | | | Muxers may want to directly access filename in stored in AVFormatContext. For example in case of RTSP, the filename (url) is used by the muxer to extract parameters of the connection. These muxers will fail when used with fifo pseudo-muxer. This commit fixes this issue by passing filename from AVFormatContext of fifo pseudo-muxer to all AVFormatContext(s) of underlying muxers during initialization. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
* avformat/fifo: assert on disallowed message type and state combinationsMarton Balint2017-02-19
| | | | | | Fixes Coverity CID 1396277. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/fifo: fix undefined behaviour in deinit when destroying mutexMarton Balint2016-11-13
| | | | | Reviewed-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: Add fifo pseudo-muxerJan Sebechlebsky2016-08-22
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>