summaryrefslogtreecommitdiff
path: root/libavformat/tee.c
Commit message (Collapse)AuthorAge
* 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/tee: ReindentationAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Process strings immediately if possibleAndreas Rheinhardt2021-10-03
| | | | | | This avoids having to free them manually lateron. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Fix leak of FIFO-options dictionaryAndreas Rheinhardt2021-10-03
| | | | | | Happened for all slaves which didn't use the FIFO. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Fix leak of stringsAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Avoid stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Unref packet on av_bsf_send_packet() failureAndreas Rheinhardt2021-10-03
| | | | | | | | Given that the packet sent to av_bsf_send_packet() is always already refcounted, it is doubtful whether the error can even be triggered currently. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Fix inconsistency wrt av_packet_ref() failure handlingAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Stop including bsf.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include bsf.h directly wherever it is used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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/tee: allow packets with negative timestampsJan Ekström2020-12-07
| | | | | | | | As this is a meta muxer and the same flag is set with the fifo meta muxer, there is really no reason not to have this set here as well. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* lavf/tee: pass options to protocol.Nicolas George2020-06-04
| | | | Fix trac ticket #8705.
* 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/tee: use AV_OPT_TYPE_DICT for fifo_optionsMarton Balint2020-01-01
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee.c: steal bsf option before passing to fifo muxerJun Li2019-10-25
| | | | | | | | | Fix #7620 In the case tee muxer with both "bsf" and "use_fifo" parameters will trigger this bug. Tee muxer will first steal parameters (like "f", "select"...) and then "use_fifo" will try reading out remaining options and pass them to fifo as option "format_options". Current code miss the part of stealing "bsf" options.
* avformat/tee : Pass standards compliance value to slave muxers as wellKarthick J2019-01-30
|
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/tee: tee was passing a wrong option name for fifo's format_optionsFelipe Astroza2017-01-24
| | | | | | | | If fifo is enabled on tee muxer, ffmpeg exits because of an unknown option passed to fifo muxer. Option name "format_options" was replaced by "format_opts" on tee muxer. Signed-off-by: Felipe Astroza <felipe@astroza.cl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/tee: Add fifo support for teeJan Sebechlebsky2016-12-28
| | | | Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
* avformat/tee: Copy interrupt callback and flags to slaveJan Sebechlebsky2016-09-29
| | | | | | | Copy interrupt callback to slave format context to allow user to interrupt IO. Copy format flags as well. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
* avformat/tee: Use BSF list APIJan Sebechlebsky2016-09-12
| | | | Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
* avformat/tee: Factor parse_slave_options() outMichael Niedermayer2016-08-02
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/tee: Rescale ts using av_packet_rescale_tsJan Sebechlebsky2016-07-23
| | | | | | | | | This ensures that AV_NOPTS_VALUE value is handled correctly. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Use ff_format_output_open() functionJan Sebechlebsky2016-07-16
| | | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Support flushing by writing NULL pktJan Sebechlebsky2016-07-16
| | | | | | | | | This will add support for flushing by writing NULL packet to the tee muxer, which propagates the action to slave muxers as expected. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Use ff_stream_encode_params_copy()Jan Sebechlebsky2016-07-16
| | | | | | | | | Use ff_stream_encode_params_copy() to copy encoding-related fields (parameters) of stream. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Support arbitrary number of slavesJan Sebechlebsky2016-06-25
| | | | Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
* avformat/tee: Use ref instead copy in write_packetJan Sebechlebsky2016-05-07
| | | | | | | | | Replace av_copy_packet and deprecated av_dup_packet by creating reference using av_packet_ref. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Fix TeeSlave.bsfs pointer array sizeJan Sebechlebsky2016-05-07
| | | | | | | | | | TeeSlave.bsfs is array of pointers to AVBitStreamFilterContext, so element size should be really size of a pointer, not size of TeeSlave structure. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Handling slave failure in tee muxerJan Sebechlebsky2016-04-22
| | | | | | | | | Adds per slave option 'onfail' to the tee muxer allowing an output to fail, so other slave outputs can continue. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Fix leaks in tee muxer when open_slave failsJan Sebechlebsky2016-04-22
| | | | | | | | | | | | | | | | | | In open_slave failure can happen before bsfs array is initialized, close_slave must check that bsfs is not NULL before accessing tee_slave->bsfs[i] element. Slave muxer expects write_trailer to be called if it's write_header suceeded (so resources allocated in write_header are freed). Therefore if failure happens after successfull write_header call, we must ensure that write_trailer of that particular slave is called. Some cleanups are made by Marton Balint. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tee: Refactor close_slaves function in tee muxerJan Sebechlebsky2016-04-14
| | | | | | | | | | | Closing single slave operation is pulled out into separate function close_slave(TeeSlave*). Both close_slave and close_slaves function are moved before open_slave function. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
| | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-10
| | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-02
| | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/tee: use lavf API for applying bitstream filtersRodger Combs2015-12-28
|
* lavf/tee: fix side data double free.Nicolas George2015-12-13
| | | | | | | | Similar to 33fefdb44. Fix trac ticket #4921. Signed-off-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
|
* lavf/tee: allow multiple stream specifiers in select.Bela Bodecs2015-10-12
| | | | | | | | | It makes possible to put multiple stream specifier into the select option separated by comma. eg. select=\'a:0,v\' Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Nicolas George <george@nsup.org>
* Remove left-over FF_API_DESTRUCT_PACKET cruftHendrik Leppkes2015-09-05
|
* add missing FF_API_DESTRUCT_PACKET guardsAndreas Cadhalpun2015-08-22
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avformat/tee: Simplify code by using avio_closep()Michael Niedermayer2015-01-09
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/tee: flip assigment directionMichael Niedermayer2014-08-03
| | | | | | Found-by: CSA Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/tee: print errors for each failed bitstream filterMichael Niedermayer2014-04-26
| | | | | | Fixes CID1108584 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavf/tee: fix leak of bsfs array.Nicolas George2013-10-21
|
* lavf/tee: fix leak of select option.Nicolas George2013-10-21
|
* lavf/tee: fix leak of strdup/strtoked buffer.Nicolas George2013-10-21
| | | | Fix CID 1108606.
* vformat/tee: fix uninitialized use of retMichael Niedermayer2013-09-07
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>