summaryrefslogtreecommitdiff
path: root/libavformat/rtpenc_chain.c
Commit message (Collapse)AuthorAge
* 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.
* libavformat: Use ffio_free_dyn_buf where applicableMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_chain: Pass the initial time_base hint on to the chained muxerMartin Storsjö2014-09-17
| | | | | | | | | | | | In practice this hint is ignored - the rtp muxer always overwrites the stream time base without taking the hint into account. But as a general practice this is the correct way to pass a time base hint on to a chained muxer. This avoids warnings about using the codec time base as hint being deprecated. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_chain: Don't copy the time base to the source stream by defaultMartin Storsjö2014-05-31
| | | | | | | | | | | | | | | Only copy it manually in the muxers where it makes sense (rtspenc, sapenc). Don't touch the original AVStream in movenchint, where the original AVStream should be kept untouched. This fixes the normal tracks in RTP hinted files after abb810db - the hint tracks were ok while the normal media tracks were broken, noticed by Michael Niedermayer. This reverts abb810db but achieves the same effect for the other muxers. Signed-off-by: Martin Storsjö <martin@martin.st>
* Revert "rtpenc_chain: Don't copy the time_base back to the caller"Martin Storsjö2014-05-30
| | | | | | | | | | | | | While it strictly isn't necessary to copy the time base (since any use of it is scaled in ff_write_chained), it still is better to signal the actual time base to the caller, avoiding one unnecessary rescaling. This also lets the caller know what the actual internal time base is, in case that is useful info for some caller. This reverts commit 397ffde115f4e0482a007b672f40457596cebfc4. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_chain: Check for errors from ffio_fdopen and ffio_open_dyn_packet_bufMartin Storsjö2013-08-07
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_chain: Use the original AVFormatContext for getting payload typeMartin Storsjö2013-01-24
| | | | | | | | | | | | | | | | | In ff_rtp_get_payload_type, the AVFormatContext is used for checking whether the payload_type or rtpflags options are set. In rtpenc_chain, the rtpctx struct is a newly initialized struct where no options have been set yet, so no options can be fetched from there. All muxers that internally chain rtp muxers have the "rtpflags" field that allows passing such options on (which is how this worked before 8034130e06), so this works just as intended. This makes it possible to produce H263 in RFC2190 format with chained RTP muxers. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_chain: Remove unused variableDiego Biurrun2012-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>
* rtpenc_chain: Return an error code instead of just a plain pointerMartin Storsjö2012-05-26
| | | | | | Also check the return value in sapenc. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_chain: Free the URLContext on failureMartin Storsjö2012-05-26
| | | | | | | | If an URLContext is passed in, its ownership is given to this function, and is either owned by the returned AVFormatContext on a successful return, or freed on failure. Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Remove extra newlines at EOFAlex Converse2012-01-27
|
* avformat: Pass the interrupt callback on to chained muxers/demuxersMartin Storsjö2011-11-13
| | | | | | There are a few more cases of chained demuxers, but they only use custom IO which don't do any blocking IO and thus don't need the callback.
* lavf,lavd: replace av_new_stream->avformat_new_stream part I.Anton Khirnov2011-10-19
| | | | | Trivial replacements with sed are done in this commit: sed 's/av_new_stream(\([^)]*\), 0)/avformat_new_stream(\1, NULL)/'
* Remove all uses of deprecated AVOptions API.Anton Khirnov2011-10-12
|
* lavf: add avformat_write_header() as a replacement for av_write_header().Anton Khirnov2011-06-16
| | | | It supports more convenient setting of AVOptions.
* rtpenc_chain: Pass the rtpflags options through to the chained muxerMartin Storsjö2011-06-10
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avio: make url_fdopen internal.Anton Khirnov2011-04-03
| | | | | The unbuffered URLContext API will be made private, so there's no point in this function being public.
* avio: make url_open_dyn_packet_buf internal.Anton Khirnov2011-04-03
| | | | | | | It doesn't look fit to be a part of the public API. Adding a temporary hack to ffserver to be able to use it, should be cleaned up when somebody is up for it.
* avio: avio_ prefix for url_close_dyn_bufAnton Khirnov2011-04-03
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* avio: rename url_fopen/fclose -> avio_open/close.Anton Khirnov2011-02-23
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* rtpenc_chain: Don't copy the time_base back to the callerMartin Storsjö2011-02-04
| | | | | | | | If required, the caller can do this itself. ff_write_chained rescales timestamps as necessary, and all current callers of rtpenc_chain use ff_write_chained, making this timebase copy unnecessary. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Use avformat_free_context for cleaning up muxersMartin Storsjö2011-02-04
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* libavformat: Use avcodec_copy_context for chained muxersMartin Storsjö2011-02-04
| | | | | | | | | | | | | This avoids having the chained AVStream->codec point to the same AVCodecContext owned by the outer AVStream. The downside is that changes to the AVCodecContext made after calling av_write_header cannot be detected automatically within the chained muxer. This avoids having to manually unlink the chained AVStream->codec by setting it to null before freeing the chained muxer via generic freeing functions. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Free AVStream->info in chained muxersMartin Storsjö2011-02-03
| | | | | | | This fixes memory leaks in the RTSP muxer and RTP hinting in the mov muxer present since SVN rev 25418. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* rtsp: Factorize out code for opening a chained RTP muxerMartin Storsjö2010-10-08
The new object file is added to the SDP demuxer in the makefile, since it is needed in both the RTSP muxer and demuxer and in the SDP demuxer, due to the current code coupling. Originally committed as revision 25410 to svn://svn.ffmpeg.org/ffmpeg/trunk