summaryrefslogtreecommitdiff
path: root/libavfilter/buffersrc.c
Commit message (Collapse)AuthorAge
* lavfi: use AVFrame.duration instead of AVFrame.pkt_durationAnton Khirnov2022-07-19
|
* avfilter/buffersrc: uninitialize the context ch_layout before overwritting itJames Almer2022-03-27
| | | | | | | av_buffersrc_parameters_set() can be called to set paramenters after the filter was initialized with for example avfilter_graph_create_filter(). Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter: convert to new channel layout APIJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Constify all AVFiltersAndreas 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>
* avfilter/buffersrc: simplify av_buffersrc_add_frame_flags()James Almer2021-02-16
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
* lavfi/buffersrc: Remove redundant free after ff_filter_frame() failureJun Zhao2020-01-04
| | | | | | | | | ff_filter_frame() always frees the frame in case of error, so we don't need to free the frame after ff_filter_frame() fails. Fix CID 1457230. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avfilter/buffersrc: deprecate sws_param optionZhao Zhili2019-12-30
|
* avfilter/buffersrc: Remove unused variablesAndreas Rheinhardt2019-12-26
| | | | | | | Unused since f09ae730. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/buffersrc: remove redundant flagZhao Zhili2019-12-23
| | | | | | | | | | | | | | | | !(c->pix_fmt != AV_PIX_FMT_NONE || c->got_format_from_params) equals (c->pix_fmt == AV_PIX_FMT_NONE) && !c->got_format_from_params 1. When (c->pix_fmt == AV_PIX_FMT_NONE) is true, got_format_from_params is always false, the flag doesn't contribute to the result. 2. When the first part is false, the second part doesn't matter, the flag doesn't contribute to the result. The result only depends on c->pix_fmt.
* lavfi/buffersrc: push frame directly.Nicolas George2019-12-23
| | | | This allows to remove the queued frame entirely.
* lavfi/buffersrc: remove poll_frame.Nicolas George2019-12-23
|
* lavfi/buffersrc: remove fifo.Nicolas George2019-12-23
| | | | The frame is immediately pushed, the fifo has never more than one.
* avfilter/buffersrc: remove write-only variableZhao Zhili2019-12-02
|
* avfilter/buffersrc: print relevant info when skipping filter reinitGyan Doshi2019-01-27
| | | | | | The timestamp of the changed input frame as well as its relevant properties can be examined by the user. Only applicable when reinit_filter is disabled on the input stream.
* lavfi/buffersrc: Indent the code.Jun Zhao2018-11-27
| | | | | | commit b0012de420f missed reindent. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* Merge commit '88fd836a015a5f3380df74592e440e7d1e5b8000'James Almer2017-10-21
|\ | | | | | | | | | | | | * 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-23
| | | | | | | | Deprecated in 02/2013.
* | lavfi/buffersrc: add av_buffersrc_close().Nicolas George2017-09-08
| |
* | Revert "Revert "lavfi/buffersrc: push the frame deeper if requested.""Nicolas George2017-07-30
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 04aa09c4bcf2d5a634a35da3a3ae3fc1abe30ef8 and reintroduces 0ff5567a30be6d7c804e95997ae282d6bacd76c3 that was temporarily reverted due to minor regressions. It also reverts e5bce8b4ce7b1f3a83998febdfa86a3771df96ce that fixed FATE refs. The fate-ffm change is caused by field_order now being set on the output format because the first frame arrives earlier. The fate-mxf change is assumed to be the same.
* | Revert "lavfi/buffersrc: push the frame deeper if requested."Paul B Mahol2017-06-23
| | | | | | | | | | | | Fixes framesync filters with shortest option enabled. This reverts commit 0ff5567a30be6d7c804e95997ae282d6bacd76c3.
* | avfilter: do not use AVFrame accessorMuhammad Faiz2017-04-23
| | | | | | | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* | lavfi/buffersrc: fix directly setting channel layoutRostislav Pehlivanov2017-02-21
| | | | | | | | | | | | | | | | | | When setting the channel layout directly using AVBufferSrcParameters the channel layout was correctly set however the init function still expected the old string format to set the number of channels (when it hadn't already been specified). Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* | lavfi/buffersrc: push the frame deeper if requested.Nicolas George2016-12-24
| | | | | | | | Reduce peak memory consumption with ffmpeg in certain cases.
* | lavfi: make filter_frame non-recursive.Nicolas George2016-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of changes happen at the same time: - Add a framequeue fifo to AVFilterLink. - split AVFilterLink.status into status_in and status_out: requires changes to the few filters and programs that use it directly (f_interleave, split, filtfmts). - Add a field ready to AVFilterContext, marking when the filter is ready and its activation priority. - Add flags to mark blocked links. - Change ff_filter_frame() to enqueue the frame. - Change all filtering functions to update the ready field and the blocked flags. - Update ff_filter_graph_run_once() to use the ready field. - buffersrc: always push the frame immediately.
* | Merge commit 'b3dd30db0b2d857147fc0e1461a00bd6172a26a3'Derek Buitenhuis2016-02-24
|\| | | | | | | | | | | | | * commit 'b3dd30db0b2d857147fc0e1461a00bd6172a26a3': lavfi: pass the hw frames context through the filter chain Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavfi: pass the hw frames context through the filter chainAnton Khirnov2016-02-14
| |
* | Merge commit 'c084d6d2cfb570b10d8784eb20cc696dfb7c5605'Derek Buitenhuis2016-02-17
|\| | | | | | | | | | | | | * commit 'c084d6d2cfb570b10d8784eb20cc696dfb7c5605': buffersrc: default SAR to 0 (unknown) rather than 1 Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * buffersrc: default SAR to 0 (unknown) rather than 1Anton Khirnov2016-02-14
| | | | | | | | | | | | It makes more sense to not claim anything about the SAR if we don't know anything. No changes in the FATE tests, since this is what avconv ends up doing anyway.
* | Merge commit 'fb25d99b0a5e21fb8cc184c7a9d3736387778266'Derek Buitenhuis2016-02-16
|\| | | | | | | | | | | | | | | | | This commit is a no-op. * commit 'fb25d99b0a5e21fb8cc184c7a9d3736387778266': buffersrc: do not discard the error from ff_filter_frame() Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * buffersrc: do not discard the error from ff_filter_frame()Anton Khirnov2016-02-12
| |
| * buffersrc: accept the frame rate as argument.Nicolas George2015-11-09
| | | | | | | | | | | | (cherry picked from ffmpeg commit 9ca440679dc535b31edd569393d8d3dda59db90e) Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * buffersrc: Improve initialization log messageVittorio Giovara2015-09-13
| | | | | | | | Add timebase and aspect ratio information.
* | avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde2015-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove left-over FF_API_AVFILTERBUFFER cruftHendrik Leppkes2015-09-05
| |
* | Merge commit 'f6974fe651d29ef6eb68d66d73f7b6c011062aa0'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit 'f6974fe651d29ef6eb68d66d73f7b6c011062aa0': lavfi: Drop deprecated AVFilterBuffer* code Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavfi: Drop deprecated AVFilterBuffer* codeVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 11/2012.
| * buffersrc: Use the correct deallocation functionFederico Tomassetti2015-04-22
| | | | | | | | | | | | This correction was suggested to me by Michael Niedermayer Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avfilter/buffersrc: Use correct, matching deallocation functionMichael Niedermayer2015-04-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '617814b4a717b38add5ccb8dd200dbb655f98f09'Michael Niedermayer2015-04-20
|\| | | | | | | | | | | | | * commit '617814b4a717b38add5ccb8dd200dbb655f98f09': buffersrc: Fix resource leak on error Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * buffersrc: Fix resource leak on errorFederico Tomassetti2015-04-19
| | | | | | | | | | | | Bug-Id: CID 1267902 CC: libav-stable@libav.org Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * buffersrc: avoid using AV_PIX_FMT_NBAnton Khirnov2014-05-26
| | | | | | | | | | That hardcodes the number of pixel formats into lavfi and will break when a shared lavu is updated, adding new pixel formats.
* | avfilter/buffersrc: add context to av_log() callMichael Niedermayer2014-12-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter/buffersrc: reindentClément Bœsch2014-06-29
| |
* | avcodec/buffersrc: use av_mallocz_array()Michael Niedermayer2014-05-12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavfi: use av_fifo_freepLukasz Marek2014-05-07
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | Merge commit '58400ac133bcfb6bf8196b4e5208bc178307739b'Michael Niedermayer2014-04-19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '58400ac133bcfb6bf8196b4e5208bc178307739b': lavfi: name anonymous structs Conflicts: libavfilter/buffersink.c libavfilter/f_select.c libavfilter/src_movie.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_overlay.c libavfilter/vf_showinfo.c libavfilter/vf_unsharp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: name anonymous structsVittorio Giovara2014-04-19
| |