[vlc-devel] [PATCH] filter: add a pf_close callback

Alexandre Janniaux ajanni at videolabs.io
Mon Jul 20 11:11:27 CEST 2020


Hi,

On Fri, Jul 17, 2020 at 05:04:36PM +0300, Rémi Denis-Courmont wrote:
> Le perjantaina 17. heinäkuuta 2020, 16.58.26 EEST Alexandre Janniaux a écrit :
> > Hi,
> >
> > I first switched filter_t to an op structure, which is painful too
> > to bring at once (~80 filters), but I reached issues when it comes
> > with function having multiple different pf_filter callback (especially,
> > video converter) and didn't come up with a decision between not doing
> > this, doing memory allocation of the vtable or a generic pf_filter
> > switching the real filter functions.
> >
> > The last one seems reasonable, but is a bit ugly in comparison with
> > the current implementation. But the goal of not switching all filters
> > right now is especially to avoid doing this job twice yes.
>
> There are two ways:
> - recreate a pf_filter pointer in the private data for the affected cases, or
> - maintain separate op objects for each case.

Exactly, I guess I'll have both depending on the case (some filters
have packed/planar variants, and I'll have additional hop for video
converters).

>
> It's like deciding between function pointers or separate classes in C++.
>
>
> I'm in favor of the patch. I just fear it creates more churn and work in that
> order.

My idea was to have this merged, so as to start writing filters with
this, and then have the big filter refactor which is more time consuming
and blocking/daunting task, since refactoring close into vtable is easier
when it already has the correct prototype anyway. However, if you don't
feel confortable with this I might finish the whole filter refactor
instead.

Thank you for your feedback!

Regards,
--
Alexandre Janniaux
Videolabs


More information about the vlc-devel mailing list