Commit Graph

23 Commits

Author SHA1 Message Date
Andreas Rheinhardt ad3b1fddb3 avfilter/vf_stack: Free inpads' names generically
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-22 16:15:47 +02:00
Andreas Rheinhardt 8be701d9f7 avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilter
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>
2021-08-20 12:53:58 +02:00
Andreas Rheinhardt 515e7fbce1 avfilter/avfilter: Remove unused feature to add pads in the middle
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-17 21:20:59 +02:00
Andreas Rheinhardt 1b20853fb3 avfilter/internal: Factor out executing a filter's execute_func
The current way of doing it involves writing the ctx parameter twice.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-15 21:33:25 +02:00
Andreas Rheinhardt a04ad248a0 avfilter: Constify all AVFilters
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>
2021-04-27 11:48:05 -03:00
Paul B Mahol 5b34fcaa8d avfilter/vf_stack: use ff_formats_pixdesc_filter() 2021-01-16 21:35:44 +01:00
Paul B Mahol a3e67c2d2f avfilter/vf_stack: add fill option for xstack 2020-01-22 19:13:51 +01:00
Paul B Mahol 3530fdc78e avfilter/vf_stack: set framerate to VFR when inputs frame rates differs 2019-12-17 13:30:16 +01:00
Paul B Mahol 631f7acc6c avfilter/vf_stack: add slice threading 2019-09-25 19:02:57 +02:00
Paul B Mahol 44095564d4 avfilter/vf_stack: simplify main processing path 2019-09-25 18:40:56 +02:00
Andreas Rheinhardt 670251de56 avfilter/vf_stack: Don't modify const strings
b3b7ba62 introduced undefined behaviour: A (non-modifiable) string
literal has been assigned to a modifiable string; said string was indeed
modified later via av_strtok.
This of course caused compiler warnings because of the discarded
qualifier; these are in particular fixed by this commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-05-14 14:47:51 +02:00
Gyan Doshi b3b7ba623f avfilter/vf_xstack: set better error msg for
missing layout
2019-05-07 16:45:11 +05:30
Paul B Mahol bf15dcc5c8 avfilter/vf_stack: use time_base from framesync
Fixes non-monotonous timestamps.
2019-04-26 23:59:52 +02:00
Paul B Mahol 4fcfb9c4eb avfilter: add xstack filter 2018-10-26 12:40:54 +02:00
Paul B Mahol 225341b20d avfilter/vf_stack: always copy SAR from first input
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-12-02 23:29:49 +01:00
Nicolas George 5f5dcf44e3 lavfi: rename framesync2 to framesync. 2017-09-12 11:03:51 +02:00
Nicolas George 0dd8320e16 lavfi/vf_stack: move to "activate" design. 2017-07-30 12:26:34 +02:00
Paul B Mahol f862ff750b avfilter/vf_stack: free input pads name on uninit
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-02-04 18:02:29 +01:00
Derek Buitenhuis 21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Paul B Mahol a330430238 avfilter/vf_stack: make it possible to stop with shortest stream
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-26 10:02:00 +01:00
Ganesh Ajjanagadde 6aaac24d72 avfilter/all: propagate errors of functions from avfilter/formats
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>
2015-10-14 10:04:01 -04:00
Michael Niedermayer 7eab904d11 avfilter/vf_stack: Fix memleak of out frame
Fixes CID1322347

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 14:41:45 +02:00
Paul B Mahol 319440e54f avfilter: add hstack & vstack filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-08-26 11:16:51 +00:00