lavfi: add init_opaque callback

This will be used by filters which require an opaque field to be passed
in input. Should be required only for filters which imply a programmatic
use.

This is possibly a temporary solution, to be removed when we'll have a
clearer and better agreememnt of how/if to pass binary data for
initializing a filter.

See thread:
Subject: [FFmpeg-devel][PATCH] lavfi: add init2 callback
Date: Fri,  6 Jul 2012 01:22:17 +0200
This commit is contained in:
Stefano Sabatini
2012-07-06 00:41:27 +02:00
parent aef9e94f73
commit 21d5609826
4 changed files with 14 additions and 2 deletions

View File

@@ -554,7 +554,9 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
{
int ret=0;
if (filter->filter->init)
if (filter->filter->init_opaque)
ret = filter->filter->init_opaque(filter, args, opaque);
else if (filter->filter->init)
ret = filter->filter->init(filter, args);
return ret;
}