Lots of video filters use a very simple input or output:
An array with a single AVFilterPad whose name is "default"
and whose type is AVMEDIA_TYPE_VIDEO; everything else is unset.
Given that we never use pointer equality for inputs or outputs*,
we can simply use a single AVFilterPad instead of dozens; this
even saves .data.rel.ro (8312B here) as well as relocations.
*: In fact, several filters (like the filters in vf_lut.c)
already use the same outputs; furthermore, ff_filter_alloc()
duplicates the input and output pads so that we do not even
work with the pads directly.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
These fields are mutually exclusive, so putting them in a union
is possible and makes AVFilterPad smaller.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
They are not used by the header at all and only used by very few files;
so include the headers in their users instead of in internal.h.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It should not be needed for each filter that sets sample aspect ratio
to set it explicitly also for each and every frame, instead that is
automatically done in get_buffer call.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This is a temporary workaround until all filters have been
upgraded to filter_frame and the framework can forget completely
about start_frame/draw_slice/end_frame.
This fixes a regression with the scale filters input changing.
In the long run filters should get a flag to indicate support of this
and then this flag be used here.
But the regression should not be left standing until thats done.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fix warning when compiling boxblur.
While this is technically a major API break, practically there will be no
one using that function since the filtering API is mostly private, so
that function alone is not usable.
There are several reasons for doing that:
1. It documents the code for the reader and helps find
inconsistencies and bugs.
2. For rej_perms, it guarantees the change will be done
even if the output reference can be created by several
code paths.
3. It can be used to predict cases where a copy will,
or will not happen and optimize buffer allocation
(for example not request a rare direct-rendering buffer
from a device sink if it will be copied anyway).
Note that a filter is still allowed to manage the permissions
on its own without using these fields.
The code currently use cur_buf as the target of the copy,
but cur_buf can be cleared by the filter if it has given
the reference away or stored it elsewhere as soon as start_frame.
The code still relies on the fact that the reference is not
destroyed until end_frame. All filters currently follow that condition.
An av_assert1() is added to check it; it should at least cause
very visible errors in valgrind.
Semantic for the function ff_null_start_frame() was changed in
07bad27810, and it has now the same behavior of
ff_null_start_frame_keep_ref(), thus it makes no sense to keep both of
them.