aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/framesync.c
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/framesync: fix forward EOF ptsNicolas Gaullier2024-10-131-12/+11
| | | | | | | | | | | | | | | | | | | | Note1: when the EOF pts is not accurate enough, the last frame can be dropped by vf_fps with default rounding. Note2: vf_scale use framesync since e82a3997cdd6c0894869b33ba42430ac3, so this is a very commonplace scenario. For example: ./ffprobe -f lavfi testsrc=d=1,scale,fps -of flat \ -count_frames -show_entries stream=nb_read_frames Before: streams.stream.0.nb_read_frames="24" After: streams.stream.0.nb_read_frames="25" Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavfi/framesync: avoid forcing frame writability unnecessarilyAnton Khirnov2024-07-311-5/+0
| | | | | | | | | | | Callers of ff_framesync_get_frame() generally do not expect the result to be writable, those that do (e.g. ff_framesync_dualinput_get_writable()) ensure writability themselves. Significantly reduces memory consumption in complex graphs with framesync-based filters (e.g. scale, ssim). Reported-By: Mark Shwartzman
* avfilter/framesync: reset nb_in on allocation failureJames Almer2024-05-051-1/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/framesync: make framesync_class un-staticNiklas Haas2024-05-031-3/+3
| | | | And rename to ff_framesync_class. More convenient for downstream users.
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-1/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-141-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* avfilter/framesync: fix OOM casePaul B Mahol2023-11-301-0/+3
| | | | | | Fixes OOM when caller keeps adding frames into filtergraph that reached EOF by other means, for example EOF is signalled by other filter in filtergraph or by buffersink.
* avfilter/framesync: fix order of operation with = and <0Michael Niedermayer2023-11-031-1/+1
| | | | | | Reviewed-by: Sean McGovern <gseanmcg@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: use ff_inlink_make_frame_writable()Paul B Mahol2023-02-121-1/+1
|
* avfilter/framesync: add a new option to set how to sync streams based on ↵James Almer2022-08-101-0/+19
| | | | | | | | | | | | | | | | secondary input timestamps Include two values for it, a default one that sets/keeps the current behavior, where the frame event generated by the primary input will have a timestamp equal or higher than frames in secondary input, plus a new one where the secondary input frame will be that with the absolute closest timestamp to that of the frame event one. Addresses ticket #9689, where the new optional behavior produces better frame syncronization. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/framesync: Remove redundant setting of AVClassAndreas Rheinhardt2021-09-231-5/+0
| | | | | | | | | Every filter exposing the framesync options via its child_next callback already calls framesync_preinit() in its preinit callback. So the filter is already preinited whenever its child_next is called. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* framesync: switch to child_class_iterate()Anton Khirnov2020-06-101-0/+7
|
* lavfi/framesync: use av_gcd_q().Nicolas George2020-05-231-12/+2
|
* avfilter/framesync: fix shortest with eof_action=passGyan Doshi2019-06-061-4/+4
| | | | | Shifted check of shortest to after repeatlast, to ensure shortest=1 is always honoured.
* lavfi/framesync: Add namespace prefix to framesync_get_classMark Thompson2018-06-241-1/+1
|
* lavfi/framesync: remove an invalid free.Nicolas George2018-01-031-1/+1
|
* lavfi/framesync: remove dead code.Nicolas George2017-09-121-3/+1
| | | | Fix CID 1416960.
* lavfi/framesync: reword repeatlast option help.Nicolas George2017-09-121-1/+1
|
* lavfi: rename framesync2 to framesync.Nicolas George2017-09-121-0/+415
|
* lavfi: remove framesync.Nicolas George2017-09-121-343/+0
|
* lavf/framesync: detect EOF immediately.Nicolas George2016-12-241-1/+9
| | | | Fix an infinite loop in forward_status_change().
* lavfi: remove FF_LINK_FLAG_REQUEST_LOOP.Nicolas George2015-09-201-1/+0
| | | | It has no longer any effect.
* avfilter/framesync: allocate FFFrameSyncIn internallyPaul B Mahol2015-08-261-1/+8
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi: add an API to synchronize multiple video inputs.Nicolas George2013-09-231-0/+329
Compared to dualinput, this API can handle more than two inputs and can generate frames synchronized to any or all input streams.