summaryrefslogtreecommitdiff
path: root/libavformat/swfenc.c
Commit message (Collapse)AuthorAge
* 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>
* av(format|device): Add const to muxer packet data pointersAndreas Rheinhardt2022-07-09
| | | | | | | The packets given to muxers need not be writable, so it is best to access them via const uint8_t*. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* swf: convert to new channel layout APIVittorio Giovara2022-03-15
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/swfenc: switch to new FIFO APIAnton Khirnov2022-02-07
|
* 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/swf: add support for reading and writing VP6A and Flash Screen ↵Marton Balint2021-01-23
| | | | | | Video codecs Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/swfenc: add support for muxing png imagesMarton Balint2021-01-23
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/swfenc: fix generation of FileAttributes tagMarton Balint2021-01-23
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/swf: Separate mux and demux contextsAndreas Rheinhardt2020-09-20
| | | | | | | | | There was almost no overlap between them: The only field used by both was an int named samples_per_frame. Therefore this commit separates them. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/swfenc: Fix memleak upon write_header errorAndreas Rheinhardt2020-09-20
| | | | | | | | | | | The SWF muxer accepts at most one mp3 audio and at most one VP6F, FLV1 or MJPEG stream. Upon encountering an mp3 stream, a fifo is allocated that leaks if one of the subsequent streams is incompliant with the restrictions mentioned above or if the framerate or samplerate are invalid. This is fixed by adding a deinit function to free said fifo. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/swfenc: Fix integer overflow in frame rate handlingMichael Niedermayer2020-05-21
| | | | | | | | Fixes: signed integer overflow: 30000299 * 256 cannot be represented in type 'int' Fixes: ticket8184 Found-by: Suhwan Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: remove avio_flush() calls from the end of write_header functionsMarton Balint2020-01-07
| | | | | | | | | | | | | | To make it consistent with other muxers. The user can still control the generic flushing behaviour after write_header (same way as after packets) using the -flush_packets option, the default typically means to flush unless a non-streamed file output is used. Therefore this change should have no adverse effect on streaming, even if it is assumed that the first packet has a clean buffer, so small seekbacks within the output buffer work even when the IO context is not seekable. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/swfenc: use FFABS to instead of absSteven Liu2017-11-20
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'James Almer2017-03-21
|\ | | | | | | | | | | | | * commit '83548fe894cdb455cc127f754d09905b6d23c173': lavf: fix usage of AVIOContext.seekable Merged-by: James Almer <jamrial@gmail.com>
| * lavf: fix usage of AVIOContext.seekableAnton Khirnov2016-09-30
| | | | | | | | | | | | | | | | It is supposed to be a flag. The only currently defined value is AVIO_SEEKABLE_NORMAL, but other ones may be added in the future. However all the current lavf code treats this field as a bool (mainly for historical reasons). Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
* | 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>
| * 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.
| * lavf: Explicitly convert types at function pointer assignmentDiego Biurrun2015-03-11
| | | | | | | | This fixes a number of "assignment from incompatible pointer type" warnings.
* | avformat/swfenc: Check frama rate before writing itMichael Niedermayer2015-12-17
| | | | | | | | | | | | Fixes assertion failure with ffserver Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/swfenc: Remove another unneeded float computationMichael Niedermayer2015-05-24
| | | | | | | | | | | | fewer chances for rounding differences between platforms is better Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/swfenc: Remove unneeded floatsMichael Niedermayer2015-05-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '194be1f43ea391eb986732707435176e579265aa'Michael Niedermayer2014-06-18
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '194be1f43ea391eb986732707435176e579265aa': lavf: switch to AVStream.time_base as the hint for the muxer timebase Conflicts: doc/APIchanges libavformat/filmstripenc.c libavformat/movenc.c libavformat/mxfenc.c libavformat/oggenc.c libavformat/swf.h libavformat/version.h tests/ref/lavf/mkv Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: switch to AVStream.time_base as the hint for the muxer timebaseAnton Khirnov2014-06-18
| | | | | | | | | | | | | | | | | | | | | | | | Previously, AVStream.codec.time_base was used for that purpose, which was quite confusing for the callers. This change also opens the path for removing AVStream.codec. The change in the lavf-mkv test is due to the native timebase (1/1000) being used instead of the default one (1/90000), so the packets are now sent to the crc muxer in the same order in which they are demuxed (previously some of them got reordered because of inexact timestamp conversion).
| * lavf: Don't explicitly flush after each written packet in muxersClément Bœsch2013-09-16
| | | | | | | | | | | | | | | | Since 596e5d4783, this is not necessary anymore. It also allows to actually disable the flushing, improving write performance (but possibly giving worse latency in real-time streaming). Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavf: use av_fifo_freepLukasz Marek2014-05-07
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | Merge commit '4a2ef39442bf7f0150db07a1fbfcf8286e4d44a3'Michael Niedermayer2013-07-26
|\| | | | | | | | | | | | | | | | | | | * commit '4a2ef39442bf7f0150db07a1fbfcf8286e4d44a3': cosmetics: Add '0' to float constants ending in '.'. Conflicts: libavcodec/ra288.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Add '0' to float constants ending in '.'.Diego Biurrun2013-07-25
| |
* | lavf: remove some flushing in write_packet muxers callbacks.Clément Bœsch2013-04-14
| | | | | | | | | | Since 4f112a8e3, this is not necessary anymore. Also, it allows to actually disable the flushing.
* | Revert "swfenc: use av_get_audio_frame_duration() instead of ↵Carl Eugen Hoyos2013-02-17
| | | | | | | | | | | | | | | | | | | | | | AVCodecContext.frame_size" This reverts commit 620b88a302d522f71a6a95aff500cf7bd8520043. Fixes ticket #2272. Conflicts: libavformat/swfenc.c
* | swfenc: zero fifo after freeingMichael Niedermayer2012-10-27
| | | | | | | | | | Fixes CID602000 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a'Michael Niedermayer2012-10-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a': cmdutils_read_file: increment *size after writing the trailing \0 af_resample: unref out_buf when avresample_convert returns 0 af_amix: prevent memory leak on error path vc1dec: prevent memory leak in error path vc1dec: prevent memory leak on av_realloc error af_channelmap: free old extended_data on reallocation avconv: simplify memory allocation in copy_chapters matroskaenc: check cue point validity before reallocation swfenc: error out for more than 1 audio or video stream build: link test programs only against static libs Conflicts: ffmpeg_opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * swfenc: error out for more than 1 audio or video streamJanne Grunau2012-10-09
| | | | | | | | Prevents CID602000.
* | Merge commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b'Michael Niedermayer2012-09-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b': avformat: fix typo in avformat_close_input mp3enc: write Xing TOC mp3enc: support MPEG-2 and MPEG-2.5 in Xing header. mp3enc: downgrade some errors in writing Xing frame to warnings lavf: flush the output AVIOContext in av_write_trailer(). lavf: cosmetics, reformat av_write_trailer(). avio: flush the internal buffer in avio_close() Enhance doc on asyncts audiofilter cmdutils: avoid setting data pointers to invalid values in alloc_buffer() libavcodec: remove av_destruct_packet_nofree() Conflicts: libavcodec/avpacket.c libavformat/mp3enc.c libavformat/nutenc.c libavformat/utils.c libavformat/version.h tests/ref/lavf/voc tests/ref/lavf/voc_s16 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: flush the output AVIOContext in av_write_trailer().Anton Khirnov2012-09-15
| | | | | | | | | | | | | | This is consistent with stdio and is what we want to do in all cases. Fixes a bug in the voc muxer which didn't flush in write_trailer() previously. This is the cause of the change in the test results.
* | Fix muxing mjpeg in swf.Carl Eugen Hoyos2012-09-12
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: g723.1: fix addition overflow g723.1: simplify and fix multiplication overflow g723.1: deobfuscate an expression g723.1: remove unused #includes ARM: add missing "cc" clobber in av_clipl_int32_arm() rtmp: Factorize the code by adding handle_invoke_error rtmp: Factorize the code by adding handle_invoke_status rtmp: Factorize the code by adding handle_invoke_result libavutil: remove unused av_abort() macro ffmenc: replace if/abort with assert() libavutil: drop offsetof() fallback definition libavutil: drop fallback definitions of INTxx_MIN/MAX configure: Check for a sctp struct instead of just the header configure: suncc: Add -xc99 to dependency flags, required on Solaris doxygen: Fix function parameter names to match the code doc: Drop obsolete shared libs cflags hint to workaround Cygwin gcc bugs swf: Move shared table out of the header file swf: Move swf_audio_codec_tags table to the only place it is used fate: add G.723.1 decoder tests Conflicts: configure doc/platform.texi libavformat/Makefile libavutil/arm/intmath.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * swf: Move shared table out of the header fileDiego Biurrun2012-08-09
| |
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-31
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpc8: return more meaningful error codes. mpc: return more meaningful error codes. wv,mpc8: don't return apetag data in packets. rtmp: do not warn about receiving metadata packets x86: h264dsp: Adjust YASM #ifdefs x86: yadif: Mark mmxext optimizations as such h264: convert loop filter strength dsp function to yasm. Improve descriptiveness of a number of codec and container long names Conflicts: libavcodec/flvdec.c libavcodec/libopenjpegdec.c libavformat/apetag.c libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Improve descriptiveness of a number of codec and container long namesDiego Biurrun2012-07-30
| |
* | swfenc: use av_assertMichael Niedermayer2012-06-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-05-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: dwt: K&R prettyprinting cosmetics Remove libnut wrapper fate: change name of FATE samples location environment variable avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps. http: Factorize the code by adding http_read_header() Conflicts: configure doc/APIchanges doc/fate.texi libavcodec/dwt.c libavcodec/dwt.h libavformat/Makefile libavformat/avformat.h libavformat/libnut.c libavformat/matroskaenc.c libavformat/utils.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps.James Zern2012-05-20
| | | | | | | | Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-06
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (31 commits) cdxl demux: do not create packets with uninitialized data at EOF. Replace computations of remaining bits with calls to get_bits_left(). amrnb/amrwb: Remove get_bits usage. cosmetics: reindent avformat: do not require a pixel/sample format if there is no decoder avformat: do not fill-in audio packet duration in compute_pkt_fields() lavf: Use av_get_audio_frame_duration() in get_audio_frame_size() dca_parser: parse the sample rate and frame durations libspeexdec: do not set AVCodecContext.frame_size libopencore-amr: do not set AVCodecContext.frame_size alsdec: do not set AVCodecContext.frame_size siff: do not set AVCodecContext.frame_size amr demuxer: do not set AVCodecContext.frame_size. aiffdec: do not set AVCodecContext.frame_size mov: do not set AVCodecContext.frame_size ape: do not set AVCodecContext.frame_size. rdt: remove workaround for infinite loop with aac avformat: do not require frame_size in avformat_find_stream_info() for CELT avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3 avformat: do not require frame_size in avformat_find_stream_info() for AAC ... Conflicts: doc/APIchanges libavcodec/Makefile libavcodec/avcodec.h libavcodec/h264.c libavcodec/h264_ps.c libavcodec/utils.c libavcodec/version.h libavcodec/x86/dsputil_mmx.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_sizeJustin Ruggles2012-03-05
| | | | | | | | | | This way we can do stream copy without having the demuxer wait until frame_size has been set.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: ffmpeg: fix some indentation ffmpeg: fix operation with --disable-avfilter simple_idct: remove disabled code motion_est: remove disabled code vc1: remove disabled code fate: separate lavf-mxf_d10 test from lavf-mxf cabac: Move code only used in the cabac test program to cabac.c. ffplay: warn that -pix_fmt is no longer working, suggest alternative ffplay: warn that -s is no longer working, suggest alternative lavf: rename enc variable in utils.c:has_codec_parameters() lavf: use designated initialisers for all (de)muxers. wav: remove a use of deprecated AV_METADATA_ macro rmdec: remove useless ap parameter from rm_read_header_old() dct-test: remove write-only variable des: fix #if conditional around P_shuffle Use LOCAL_ALIGNED in ff_check_alignment() Conflicts: ffmpeg.c libavformat/avidec.c libavformat/matroskaenc.c libavformat/mp3enc.c libavformat/oggenc.c libavformat/utils.c tests/ref/lavf/mxf Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: use designated initialisers for all (de)muxers.Anton Khirnov2011-07-17
| | | | | | | | It's more readable and less prone to breakage.
* | Fix some passing argument from incompatible pointer type warnings.Michael Niedermayer2011-04-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>