summaryrefslogtreecommitdiff
path: root/libavformat/nutenc.c
Commit message (Collapse)AuthorAge
* avformat/utils: Move creation-time functions to mux_utilsAndreas Rheinhardt2022-05-10
| | | | | | Only used by muxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Move ff_choose_timebase to nutenc, its only userAndreas Rheinhardt2022-05-10
| | | | | | (This function does not seem to abide by its documentation.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavformat: Split version.hMartin Storsjö2022-03-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* nutdec: 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>
* lavc: deprecate channel count/layout changing side dataAnton Khirnov2022-03-15
| | | | | | | | They are incompatible with the new channel layout scheme and no decoder uses them. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpegaudiodata: Unavpriv mpa_bitrate and mpa_frequency tabsAndreas Rheinhardt2022-01-04
| | | | | | | | | | | These arrays have a size of 180 resp. six bytes. This does not make it worthwhile to export them due to the overhead this occurs; for x64 Elf/Linux/GNU: 2x2B version, 2x24B .dynsym, 24B .rela.dyn, 8B .got, 4B hash + twice the size of the name (here 20+23B). Therefore these symbols are unavprived and duplicated for shared builds. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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: 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>
* lavf: move AVStream.*index_entries* to AVStreamInternalAnton Khirnov2020-10-28
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Since there are some (semi-)public fields located after these, even though this section is supposed to be private, keep some dummy padding there until the next major bump to preserve ABI compatibility.
* avformat/nutenc: Write size into right dynamic bufferAndreas Rheinhardt2020-05-05
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/aviobuf, nutenc: Move ff_puv_v, ff_get_v_length to nutenc.cAndreas Rheinhardt2020-05-05
| | | | | | | | | | | | | | and make it static again. These functions have been moved from nutenc to aviobuf and internal.h in f8280ff4c00eeaa245085fa9691035203abd168c in order to use them in a forthcoming patch in utils.c. Said patch never happened, so this commit moves them back and makes them static, effectively reverting said commit as well as f8280ff4c00eeaa245085fa9691035203abd168c (which added the ff-prefix to these functions). Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/nutenc: Add goto fail in nut_write_headers()Andreas Rheinhardt2020-05-05
| | | | | | | It allows to combine several ffio_free_dyn_buf(). Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/nutenc: Reuse dynamic buffers when possibleAndreas Rheinhardt2020-05-05
| | | | | | | | | | | | NUT uses variable-length integers in order to for length fields. Therefore the NUT muxer often writes data into a dynamic buffer in order to get the length of it, then writes the length field using the fewest amount of bytes needed. To do this, a new dynamic buffer was opened, used and freed for each element which involves lots of allocations. This commit changes this: The dynamic buffers are now resetted and reused. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavformat/nutenc: Remove redundant function parameterAndreas Rheinhardt2020-05-05
| | | | | | | calculate_checksum in put_packet() is always 1. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/nutenc: Drop redundant freesAndreas Rheinhardt2020-03-14
| | | | | | | | Should writing the header fail, the allocations already performed will be freed during deinit so remove the frees in nut_write_header(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> 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/nutenc: Do not pass NULL to memcmp() in get_needed_flags()Michael Niedermayer2019-11-05
| | | | | | | | | | | | | | This compared to the other suggestions is cleaner and easier to understand keeping the condition in the if() simple. This affects alot of fate tests. See: [FFmpeg-devel] [PATCH 05/11] avformat/nutenc: Don't pass NULL to memcmp See: [FFmpeg-devel] [PATCH]lavf/nutenc: Do not call memcmp() with NULL argument Fixes: Ticket 7980 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/nutenc: free all missing dynamic AVIOContext on header writing failureJames Almer2019-10-19
| | | | | | Fixes part of ticket #8316 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/nutenc: don't allocate a dynamic AVIOContext if no index is going ↵James Almer2019-10-18
| | | | | | | | to be written Fixes ticket #8295 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/nutenc: Document trailer index assert betterMichael Niedermayer2018-12-16
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '07eea5a5ded1141632aefecfa59dcdc26de2d7ea'Clément Bœsch2017-03-24
|\ | | | | | | | | | | | | * commit '07eea5a5ded1141632aefecfa59dcdc26de2d7ea': nut: Drop pointless TRACE level debug code Merged-by: Clément Bœsch <u@pkh.me>
| * nut: Drop pointless TRACE level debug codeDiego Biurrun2016-10-27
| | | | | | | | The code has little usefulness and uses the __PRETTY_FUNCTION__ GNU extension.
* | 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.
* | avformat: use ff_standardize_creation_time for formats writing all format ↵Marton Balint2016-03-03
| | | | | | | | | | | | | | string metadata Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | Merge commit 'dc6527ed908e4d330738f139074455ffbe56a2de'Derek Buitenhuis2016-02-29
|\| | | | | | | | | | | | | | | | | | | FATE tests have been updated to patch. They do not differ in any meaningful way. * commit 'dc6527ed908e4d330738f139074455ffbe56a2de': nutenc: do not use AVCodecContext.frame_size Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * nutenc: do not use AVCodecContext.frame_sizeAnton Khirnov2016-02-22
| | | | | | | | | | It will in general not be available. Use block_align if known or fall back to av_get_audio_frame_duration().
| * nut: Use the correct codec_tag when multiple are availableLuca Barbato2015-11-02
| | | | | | | | | | | | | | | | | | | | Some codecs use the codec_tag to signal specific information and picking the first one would lead to a broken file. Bug-Id: 883 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avformat/nutenc: implement deinit()Michael Niedermayer2016-01-21
| | | | | | | | | | | | Should prevent some leaks if header writing fails Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | avutil/tree: add additional const qualifier to the comparatorGanesh Ajjanagadde2015-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | libc's qsort comparator has a const qualifier on both arguments. This adds a missing const qualifier to exactly match the comparator API. Existing usages of av_tree_find, av_tree_insert are appropriately modified: type signature changes of the comparators, and removal of unnecessary void * casts of function pointers. Reviewed-by: Henrik Gramner <henrik@gramner.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avformat/nutenc: Omit AV_PKT_DATA_QUALITY_STATS when storing side data.Michael Niedermayer2015-07-25
| | | | | | | | | | | | | | This side data does not serve or improve decoding the data, it thus would semantically be metadata and not side data. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/nutenc: Fix writing strings larger than 2gbMichael Niedermayer2015-05-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a'Michael Niedermayer2015-02-25
|\| | | | | | | | | | | | | * commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a': libavformat: Use ffio_free_dyn_buf where applicable Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Use ffio_free_dyn_buf where applicableMartin Storsjö2015-02-24
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | nutdec: Remove unused variablesTimothy Gu2015-02-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '80a11de7dca315505bf203ce9c8c016e71724fd2'Michael Niedermayer2015-01-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '80a11de7dca315505bf203ce9c8c016e71724fd2': nutenc: do not use has_b_frames Conflicts: libavformat/nutenc.c tests/ref/lavf/nut tests/ref/seek/lavf-nut Mostly not merged, this is simply not correct Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * nutenc: do not use has_b_framesAnton Khirnov2015-01-27
| | | | | | | | | | It is unreliable, especially when the stream codec context is not the encoding context. Use the codec descriptor properties instead.
* | avformat/nutenc: store the actual r_frame_rate in the corresponding field if ↵Michael Niedermayer2014-12-14
| | | | | | | | | | | | | | | | available Fixes Ticket 3629 part3 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b69183f65d0f6f4cd7a4e6c0deb57d59b0185aba'Michael Niedermayer2014-10-22
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'b69183f65d0f6f4cd7a4e6c0deb57d59b0185aba': nutenc: check for negative index rather than assert Conflicts: libavformat/nutenc.c Not merged, the assert is correct Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * nutenc: check for negative index rather than assertVittorio Giovara2014-10-21
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 703721
* | Merge commit 'd754ed41727b1fcbab335b510248a9758a73320c'Michael Niedermayer2014-06-18
|\| | | | | | | | | | | | | | | | | | | * commit 'd754ed41727b1fcbab335b510248a9758a73320c': riffenc: take an AVStream instead of an AVCodecContext Conflicts: libavformat/nutenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * riffenc: take an AVStream instead of an AVCodecContextAnton Khirnov2014-06-18
| | | | | | | | | | | | It will be useful in the following commits. Also, rename the AVCodecContext pointer name from 'stream' to 'codec'.
* | avformat/nutenc: cleaner version checkMichael Niedermayer2014-06-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/nutenc: Fix error handling in nut_write_packet()Michael Niedermayer2014-06-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/nutenc: Fix error handling in write_sm_data()Michael Niedermayer2014-06-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/nutenc: Suggest genpts if AV_NOPTS_VALUEMichael Niedermayer2014-05-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/nutenc: replace conditional by assertMichael Niedermayer2014-05-29
| | | | | | | | | | | | Its implied by sp_count==0 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/nutenc: limit index table size if no index is going to be writtenMichael Niedermayer2014-05-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/nutenc: add mode that omits the indexMichael Niedermayer2014-05-29
| | | | | | | | | | | | | | When the index is not written, several data tables become unneeded, reducing memory and cpu requirements. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>