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

Nicolas George nicolas.george at normalesup.org
Fri Jul 6 11:56:57 CEST 2012


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.

And then we can discuss a more generic and clean solution.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120706/ab151b10/attachment.asc>


More information about the ffmpeg-devel mailing list