[FFmpeg-devel] Detecting invalid filter parameters

Jean Delvare jdelvare at suse.de
Thu Dec 10 08:28:00 CET 2015


Hi Paul,

Thanks for your quick reply.

On Wed, 9 Dec 2015 19:45:16 +0000, Paul B Mahol wrote:
> On 12/9/15, Jean Delvare <jdelvare at suse.de> wrote:
> > I would like to add a check for the delogo filter parameters to ensure
> > that there is enough frame room around the area to execute the
> > algorithm.
> >
> > My question is: do I have to do this check in filter_frame() for every
> > frame, or can I do it once in init() and be done with it? Or is it
> > supposed to be done in config_props()? I read the documentation about
> > config_props but I'm afraid it did not really enlightened me as to what
> > this callback is for. For performance reasons I'd like to avoid
> > performing the same check repeatedly.
> 
> If filter doesn't support midstream resolution changes than its ok
> to do it in config_props for one of input or output pads.

OK. I found that I couldn't do it in init() because ctx->inputs[0] is
NULL at that point. So I implemented .config_props. Midstream
resolution change would make no sense for the delogo filter. Pixel
format changes would be supportable though and the check would have to
be done again due to possibly different subsampling factors.

This brings two additional questions:

1* Can a filter declare which midstream changes it does or does not
support?

2* Can a filter be called back on midstream changes, or does it have to
detect it by itself?

Thanks,
-- 
Jean Delvare
SUSE L3 Support


More information about the ffmpeg-devel mailing list