summaryrefslogtreecommitdiff
path: root/libavfilter/af_join.c
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/af_join: fix leak on errorPaul B Mahol2023-05-101-1/+1
|
* avfilter/af_join: set output frame durationPaul B Mahol2023-05-051-0/+4
|
* avfilter/af_join: do not dereference possible null pointerPaul B Mahol2022-03-311-1/+2
|
* avfilter/af_join: Don't use memcpy for overlapping regionsAndreas Rheinhardt2022-03-151-2/+2
| | | | | | | | Reported by ASAN as memcpy-param-overlap when running the filter-join FATE-test. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: convert to new channel layout APIJames Almer2022-03-151-93/+177
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one looks at the many query_formats callbacks in existence, one will immediately recognize that there is one type of default callback for video and a slightly different default callback for audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);" for video with a filter-specific pix_fmts list. For audio, it is the same with a filter-specific sample_fmts list together with ff_set_common_all_samplerates() and ff_set_common_all_channel_counts(). This commit allows to remove the boilerplate query_formats callbacks by replacing said callback with a union consisting the old callback and pointers for pixel and sample format arrays. For the not uncommon case in which these lists only contain a single entry (besides the sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also added to the union to store them directly in the AVFilter, thereby avoiding a relocation. The state of said union will be contained in a new, dedicated AVFilter field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t in order to create a hole for this new field; this is no problem, as the maximum of all the nb_inputs is four; for nb_outputs it is only two). The state's default value coincides with the earlier default of query_formats being unset, namely that the filter accepts all formats (and also sample rates and channel counts/layouts for audio) provided that these properties agree coincide for all inputs and outputs. By using different union members for audio and video filters the type-unsafety of using the same functions for audio and video lists will furthermore be more confined to formats.c than before. When the new fields are used, they will also avoid allocations: Currently something nearly equivalent to ff_default_query_formats() is called after every successful call to a query_formats callback; yet in the common case that the newly allocated AVFilterFormats are not used at all (namely if there are no free links) these newly allocated AVFilterFormats are freed again without ever being used. Filters no longer using the callback will not exhibit this any more. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-201-7/+7
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/af_join: Free inpads' names genericallyAndreas Rheinhardt2021-08-221-7/+1
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, an AVFilter's lists of input and output AVFilterPads were terminated by a sentinel and the only way to get the length of these lists was by using avfilter_pad_count(). This has two drawbacks: first, sizeof(AVFilterPad) is not negligible (i.e. 64B on 64bit systems); second, getting the size involves a function call instead of just reading the data. This commit therefore changes this. The sentinels are removed and new private fields nb_inputs and nb_outputs are added to AVFilter that contain the number of elements of the respective AVFilterPad array. Given that AVFilter.(in|out)puts are the only arrays of zero-terminated AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads are not zero-terminated and they already have a size field) the argument to avfilter_pad_count() is always one of these lists, so it just has to find the filter the list belongs to and read said number. This is slower than before, but a replacement function that just reads the internal numbers that users are expected to switch to will be added soon; and furthermore, avfilter_pad_count() is probably never called in hot loops anyway. This saves about 49KiB from the binary; notice that these sentinels are not in .bss despite being zeroed: they are in .data.rel.ro due to the non-sentinels. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Remove unused feature to add pads in the middleAndreas Rheinhardt2021-08-171-1/+1
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Factor common function combinations outAndreas Rheinhardt2021-08-131-1/+1
| | | | | | | | | | | Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/af_join: fix eof timestamps and blocking in many scenariosPaul B Mahol2021-08-101-25/+37
|
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | 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>
* lavfi: regroup formats lists in a single structure.Nicolas George2020-09-081-2/+2
| | | | | | | | | | | | | | | It will allow to refernce it as a whole without clunky macros. Most of the changes have been automatically made with sed: sed -i ' s/-> *in_formats/->incfg.formats/g; s/-> *out_formats/->outcfg.formats/g; s/-> *in_channel_layouts/->incfg.channel_layouts/g; s/-> *out_channel_layouts/->outcfg.channel_layouts/g; s/-> *in_samplerates/->incfg.samplerates/g; s/-> *out_samplerates/->outcfg.samplerates/g; ' src/libavfilter/*(.)
* avfilter/af_join: fix possible memory leaksPaul B Mahol2019-10-211-1/+4
| | | | | Allocation of input frames is independent from allocation of new input pads.
* avfilter/af_join: cosmeticsPaul B Mahol2019-09-301-2/+2
|
* avfilter/af_join: use av_asprintf()Paul B Mahol2019-09-301-3/+2
|
* avfilter: forward status back in some filters that missed itPaul B Mahol2018-05-051-0/+2
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/af_join: Fix crash in join filterNikolas Bowe2018-02-031-0/+3
| | | | | | | Previously if ff_outlink_frame_wanted() returned 0 it could dereference a null pointer when trying to read nb_samples. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_join: switch to activatePaul B Mahol2017-10-311-47/+51
| | | | | | Fixes #6780. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Merge commit '88fd836a015a5f3380df74592e440e7d1e5b8000'James Almer2017-10-211-8/+0
|\ | | | | | | | | | | | | * commit '88fd836a015a5f3380df74592e440e7d1e5b8000': lavfi: Drop deprecated way of passing options for a few filters Merged-by: James Almer <jamrial@gmail.com>
| * lavfi: Drop deprecated way of passing options for a few filtersVittorio Giovara2017-03-231-8/+0
| | | | | | | | Deprecated in 02/2013.
| * cosmetics: Drop empty comment linesDiego Biurrun2016-02-181-1/+0
| |
* | avfilter/af_join: check ff_insert_inpad() for failurePaul B Mahol2017-08-251-1/+4
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter: do not use AVFrame accessorMuhammad Faiz2017-04-231-1/+1
| | | | | | | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* | lavfi/af_join: partially fix scheduling.Nicolas George2015-11-071-17/+33
| |
* | avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde2015-10-141-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM). This propagates the return values. All of these were found by using av_warn_unused_result, demonstrating its utility. Tested with FATE. I am least sure of the changes to avfilter/filtergraph, since I don't know what/how reduce_format is intended to behave and how it should react to errors. Fixes: CID 1325680, 1325679, 1325678. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Previous version Reviewed-by: Nicolas George <george@nsup.org> Previous version Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avfilter/af_join: swap av_mallocz_array() args for consistency with the ↵Paul B Mahol2015-01-201-6/+6
| | | | | | | | | | | | prototype Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter/af_join: Use av_mallocz_array()Paul B Mahol2015-01-201-6/+6
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi: check av_strdup() return valuePaul B Mahol2015-01-061-0/+2
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | libavfilter/af_join: avoid derreferencing possible nullReynaldo H. Verdejo Pinochet2014-09-261-3/+6
| | | | | | | | | | | | | | | | ff_all_channel_layouts() might return null on alloc failure. Fixes CID1241518 Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | Merge commit '87efaa97ceb0ad5820870855d6df3e569e6eac7e'Michael Niedermayer2014-08-021-1/+1
|\ \ | |/ | | | | | | | | | | | | * commit '87efaa97ceb0ad5820870855d6df3e569e6eac7e': af_join: Set the output frame format See: e0dd8cadcc386a168e7acd079463880154086446 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * af_join: Set the output frame formatLuca Barbato2014-08-021-0/+1
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-291-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavfi: do not export the filters from shared objects Conflicts: libavfilter/af_amix.c libavfilter/af_anull.c libavfilter/asrc_anullsrc.c libavfilter/f_select.c libavfilter/f_settb.c libavfilter/split.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_blackframe.c libavfilter/vf_colorbalance.c libavfilter/vf_copy.c libavfilter/vf_crop.c libavfilter/vf_cropdetect.c libavfilter/vf_drawbox.c libavfilter/vf_format.c libavfilter/vf_framestep.c libavfilter/vf_frei0r.c libavfilter/vf_hflip.c libavfilter/vf_libopencv.c libavfilter/vf_lut.c libavfilter/vf_null.c libavfilter/vf_overlay.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_unsharp.c libavfilter/vf_vflip.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: do not export the filters from shared objectsAnton Khirnov2013-10-281-1/+1
| |
* | avfilter/af_join: remove now unnecessary gotoPaul B Mahol2013-10-081-10/+5
| | | | | | | | | | | | | | Options are freed from the generic code now, there is no need to call av_opt_free() from the filter. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter: various cosmeticsPaul B Mahol2013-09-121-8/+4
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Reinstate proper FFmpeg license for all files.Thilo Borgmann2013-08-301-4/+4
| |
* | lavfi/join: make use of AVFILTER_DEFINE_CLASSPaul B Mahol2013-05-271-6/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '093804a93cc5da3f95f98265a5df116912443cec'Michael Niedermayer2013-05-051-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * commit '093804a93cc5da3f95f98265a5df116912443cec': avfilter: Add av_cold attributes to init/uninit functions Conflicts: libavfilter/af_ashowinfo.c libavfilter/af_volume.c libavfilter/src_movie.c libavfilter/vf_lut.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avfilter: Add av_cold attributes to init/uninit functionsDiego Biurrun2013-05-041-2/+2
| |
* | lavfi: add missing periods in filter descriptions.Clément Bœsch2013-04-141-1/+1
| |
* | Merge commit '7cdd737ba81b5c2c9521c4509edf0ac315fabc65'Michael Niedermayer2013-04-121-0/+2
|\ \ | |/ | | | | | | | | | | * commit '7cdd737ba81b5c2c9521c4509edf0ac315fabc65': lavfi: mark filters with dynamic number of inputs or outputs with special flags Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: mark filters with dynamic number of inputs or outputs with special flagsAnton Khirnov2013-04-111-0/+2
| | | | | | | | | | This will be useful in avtools in the following commits. Any other caller might also want to know this information.
| * lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-091-1/+1
| |
* | lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: libavfilter/avfilter.c libavfilter/vf_drawtext.c libavfilter/vf_lut.c libavfilter/vf_select.c libavfilter/vf_setpts.c libavfilter/vsrc_color.c libavfilter/vsrc_movie.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'dd7fc37c71955b78a2687f29e871f714d18de386'Michael Niedermayer2013-04-111-7/+11
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'dd7fc37c71955b78a2687f29e871f714d18de386': af_join: switch to an AVOptions-based system. Conflicts: doc/filters.texi libavfilter/af_join.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * af_join: switch to an AVOptions-based system.Anton Khirnov2013-04-091-8/+11
| | | | | | | | | | | | Change the mappings separator from comma to '|' to avoid excessive escaping, since comma is already used for separating filters in the filtergraph description.
* | af_join: fix channel count and formatMichael Niedermayer2013-03-281-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>