[FFmpeg-devel] [PATCH] lavfi: add init2 callback

Stefano Sabatini stefasab at gmail.com
Fri Jul 6 12:37:10 CEST 2012

On date Friday 2012-07-06 11:56:57 +0200, Nicolas George encoded:
> Le nonidi 19 messidor, an CCXX, Stefano Sabatini a écrit :
> > This will be used by filters which require an opaque field to be passed.
> > Should be required only for filters which imply a programmatic use.
> I do not like that solution very much. We have been discussing for some time
> ways of enhancing the initialization and option passing of filters, while
> this looks like a quick-and-dirty solution to make things work the way they
> did.
> I have nothing against quick-and-dirty temporary solutions, but I really do
> not like them visible in the public API.

> IMHO, for a quick-and-dirty temporary fix, you could just change
> avfilter_init_filter so that it passes the opaque argument to the init
> function, using a cast (AFAIK, passing more arguments to a function is
> always ok in C), and add the opaque argument back to the buffersink init
> functions (again, using a cast to silence the warning about mismatching
> types for the structure argument).
> Since the opaque argument is still present for the avfilter_init_filter
> function, it should be perfectly safe.

Honestly I'd find this more hackish/less usable.
> And then we can discuss a more generic and clean solution.

I propose to keep my hack, and then deprecate the init_opaque
interface when we'll have a better solution, for the moment I prefer
the lazy minimum-effort solution which works and seems not too
occlusive and allows easy backward compatibility. 
FFmpeg = Fancy and Fast Merciless Peaceless Esoteric Guide

More information about the ffmpeg-devel mailing list