aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mux.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * Reduce the scope of some variablesDiego Biurrun2016-05-111-1/+1
| | | | | | | | | | This avoids unused variable warnings after the next version bump. Also drop a trace level av_log() call that is in the way.
| * Drop pointless assert.h #includesDiego Biurrun2016-05-031-1/+0
| |
* | avformat/mux: do not call write_packet with a flush packet if header is not ↵Marton Balint2016-06-201-0/+5
| | | | | | | | | | | | written Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mux: do not call write_header multiple times if it fails the first timeMarton Balint2016-06-201-2/+3
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mux: factorize header writing codeMarton Balint2016-06-131-22/+22
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mux: call deinit if write_header failsMarton Balint2016-06-131-2/+7
| | | | | | | | | | | | | | | | Docs clearly states that av_write_trailer should only be called if avformat_write_header was successful, therefore we have to deinit if we return failure. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mux: Check that deinit is set before calling itMichael Niedermayer2016-04-241-1/+2
| | | | | | | | | | | | Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab'Derek Buitenhuis2016-04-171-0/+6
|\| | | | | | | | | | | | | | | | | * commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab': lavc: add a new bitstream filtering API Conversions-by: Hendrik Leppkes <h.leppkes@gmail.com> Conversions-by: Derek Buitenguis <derek.buitenhuis@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-60/+87
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-231-32/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 BSFs to drop packets.Ronald S. Bultje2016-03-111-11/+13
| | | | | | | | | | If pkt->size == 0 && pkt->side_data_elems == 0 after bsf->filter() returns, the packet is considered dropped.
* | lavf/mux: do not fail in case of non strictly monotonically increasing DTS ↵Stefano Sabatini2016-02-261-0/+1
| | | | | | | | | | | | values for data packets Consistent with what we already do with subtitles since ac08c5c0adcb7f2f9b5ea3eb473d1c2b9659aab2.
* | Merge commit '521dc78366c6ea54b7b69426dab302a57231f81e'Derek Buitenhuis2016-01-271-6/+0
|\| | | | | | | Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * mux: drop the warning about global headersAnton Khirnov2016-01-121-6/+0
| | | | | | | | | | The AVStream codec context is often not (and should not be) the actual encoding context, so this warning will be spurious in many cases.
* | avformat/mux: Fix error when writing uncoded frames.Matt Oliver2016-01-271-5/+9
| | | | | | | | | | | | | | | | | | | | commit "avpacket: Deprecate av_dup_packet" broke the use av_interleaved_write_uncoded_frame as any input uncoded frame has an invalid packet size that will crash when av_packet_ref tries to allocate 'size' new memory. Since the packet is a temporary created within mux.c itself it can be used directly without needing a new ref. Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* | lavf: add automatic bitstream filtering; bump versionRodger Combs2015-12-281-3/+46
| | | | | | | | | | | | | | | | | | This solves the problem discussed in https://ffmpeg.org/pipermail/ffmpeg-devel/2015-September/179238.html by allowing AVCodec::write_header to be delayed until after packets have been run through required bitstream filters in order to generate global extradata. It also provides a mechanism by which a muxer can add a bitstream filter to a stream automatically, rather than prompting the user to do so.
* | avformat/mux: Rename compute_pkt_fields2(), the name is absolutely terribleMichael Niedermayer2015-11-121-4/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8'Hendrik Leppkes2015-11-111-2/+75
|\| | | | | | | | | | | | | * commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8': lavf: deprecate compute_pkt_fields2 Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: deprecate compute_pkt_fields2Anton Khirnov2015-11-091-2/+75
| | | | | | | | | | | | | | | | | | 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.
* | Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'Hendrik Leppkes2015-10-291-10/+7
|\| | | | | | | | | | | | | * commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6': avpacket: Deprecate av_dup_packet Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Deprecate av_dup_packetLuca Barbato2015-10-261-6/+4
| | | | | | | | | | As documented, `av_dup_packet` is broken by design, `av_packet_ref` matches the AVFrame ref-counted API and can be safely used instead.
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-271-3/+3
|\| | | | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-261-3/+3
| | | | | | | | | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* | avfilter,swresample,swscale: use fabs, fabsf instead of FFABSGanesh Ajjanagadde2015-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is well known that fabs and fabsf are at least as fast and sometimes faster than the FFABS macro, at least on the gcc+glibc combination. For instance, see the reference: http://patchwork.sourceware.org/patch/6735/. This was a patch to glibc in order to remove their usages of a macro. The reason essentially boils down to fabs using the __builtin_fabs of the compiler, while FFABS needs to infer to not use a branch and to simply change the sign bit. Usually the inference works, but sometimes it does not. This may be easily checked by looking at the asm. This also has the added benefit of reducing macro usage, which has problems with side-effects. Note that avcodec is not handled here, as it is huge and most things there are integer arithmetic anyway. Tested with FATE. Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'Hendrik Leppkes2015-09-291-1/+1
|\| | | | | | | | | | | | | * commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d': lavc: Make AVPacket.duration int64, and deprecate convergence_duration Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | Merge commit '9ad1e0c12caa440de860bd8f2122beb11d73815c'Hendrik Leppkes2015-09-071-2/+7
|\| | | | | | | | | | | | | * commit '9ad1e0c12caa440de860bd8f2122beb11d73815c': mux: Make sure that the data is actually written Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mux: Make sure that the data is actually writtenSean McGovern2015-09-031-2/+6
| | | | | | | | | | | | | | | | | | | | And forward the error if it is not. Bug-Id: 881 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Remove left-over FF_API_DESTRUCT_PACKET cruftHendrik Leppkes2015-09-051-5/+0
| |
* | Merge commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8'Hendrik Leppkes2015-09-051-5/+0
|\| | | | | | | | | | | | | * commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8': lavc: Drop deprecated destruct_packet related functions Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Drop deprecated destruct_packet related functionsVittorio Giovara2015-08-281-5/+0
| | | | | | | | Deprecated in 10/2012.
* | mux: warn if the encoders bitexact flag is set, but not the muxersAndreas Cadhalpun2015-08-301-2/+15
| | | | | | | | | | Based-on-patch-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat: Remove use of AVFrac and AVStream->ptsMichael Niedermayer2015-08-231-8/+14
| | | | | | | | | | | | | | Move field to internal part of AVStream and struct to internal.h Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | add missing FF_API_DESTRUCT_PACKET guardsAndreas Cadhalpun2015-08-221-0/+4
| | | | | | | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/mux: Update sidedata in ff_write_chained()Michael Niedermayer2015-08-201-0/+2
| | | | | | | | | | | | Fixes Ticket4777 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-271-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-271-2/+2
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * mux: Do not leave stale side data pointers in ff_interleave_add_packet()Michael Niedermayer2015-05-061-0/+2
| | | | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | libavformat/mux: Add ff_choose_chroma_location()Michael Niedermayer2015-05-221-0/+30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mux: use <0 instead of != 0 for error check of init_muxer()Michael Niedermayer2015-05-161-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mux: Add avoid_negative_ts_use_ptsMichael Niedermayer2015-05-051-12/+24
| | | | | | | | | | | | This allows using pts instead of dts for negative TS avoidance Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mux: Place timestamp related trace av_logs under FF_FDEBUG_TSMichael Niedermayer2015-04-201-3/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'Michael Niedermayer2015-04-201-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1a3eb042c704dea190c644def5b32c9cee8832b8': Replace av_dlog with normal av_log at trace level Conflicts: ffplay.c libavdevice/fbdev_dec.c libavfilter/avfilter.c libavfilter/internal.h libavfilter/setpts.c libavfilter/src_movie.c libavfilter/vf_crop.c libavfilter/vf_drawtext.c libavfilter/vf_fieldorder.c libavformat/assdec.c libavformat/avidec.c libavformat/flvdec.c libavformat/http.c libavformat/ipmovie.c libavformat/isom.c libavformat/mov.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/mpegtsenc.c libavformat/mux.c libavformat/mxfdec.c libavformat/nsvdec.c libavformat/oggdec.c libavformat/r3d.c libavformat/rtspdec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-191-4/+4
| | | | | | | | This applies to every library where performance is not critical.
* | Merge commit '9deaec782810d098bca11c9332fab2d2f4c5fb78'Michael Niedermayer2015-02-111-16/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '9deaec782810d098bca11c9332fab2d2f4c5fb78': lavf: move internal fields from public to internal context Conflicts: libavformat/avformat.h libavformat/internal.h libavformat/mux.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: move internal fields from public to internal contextwm42015-02-101-15/+15
| | | | | | | | | | | | | | This is not an API change; the fields were explicitly declared private before. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * libavformat: Allow calling av_write_trailer with a NULL AVIOContextMartin Storsjö2014-12-191-1/+1
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/mux: remove unneeded #include, there are no assert() only av_assert*Paul B Mahol2015-01-311-3/+0
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/mux: 2 subtitle packets could have the same DTSMichael Niedermayer2014-12-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes Ticket3514 See: ETSI EN 300 743 V1.3.1 (2006-11) "In summary, all of the segments of a single display set shall be carried in one (or more) PES packets that have the same PTS value." with PTS = DTS and remuxing of such a stream it is to be expected that sometimes multiple packets would have the same DTS Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/mux: Always call write_trailer() from av_write_trailer() to avoid a leak.Carl Eugen Hoyos2014-11-201-2/+6
| | | | | | | | Fixes ticket #4049.
* | Merge commit '9257692ac15eff7b07540c1f61cebde0d8823fbd'Michael Niedermayer2014-11-181-2/+2
|\| | | | | | | | | | | | | | | | | | | * commit '9257692ac15eff7b07540c1f61cebde0d8823fbd': lavf: Only initialize s->offset once when using avoid_negative_ts make_zero Conflicts: libavformat/mux.c Merged-by: Michael Niedermayer <michaelni@gmx.at>