Commit a5e8c41c authored by Anton Khirnov's avatar Anton Khirnov
Browse files

lavfi: remove 'opaque' parameter from AVFilter.init()

It is not used in any filters currently and is inherently evil. If
passing binary data to filters is required in the future, it should be
done with some AVOptions-based system.
parent fbcaceb1
......@@ -86,7 +86,7 @@ static int get_sample_rate(const char *samplerate)
return FFMAX(ret, 0);
}
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
AFormatContext *s = ctx->priv;
int ret;
......
......@@ -479,7 +479,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
avfilter_unref_buffer(buf);
}
static int init(AVFilterContext *ctx, const char *args, void *opaque)
static int init(AVFilterContext *ctx, const char *args)
{
MixContext *s = ctx->priv;
int i, ret;
......
......@@ -56,7 +56,7 @@ static const AVClass async_class = {
.version = LIBAVUTIL_VERSION_INT,
};
static int init(AVFilterContext *ctx, const char *args, void *opaque)
static int init(AVFilterContext *ctx, const char *args)
{
ASyncContext *s = ctx->priv;
int ret;
......
......@@ -118,8 +118,7 @@ static int get_channel(char **map, uint64_t *ch, char delim)
return 0;
}
static av_cold int channelmap_init(AVFilterContext *ctx, const char *args,
void *opaque)
static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
{
ChannelMapContext *s = ctx->priv;
int ret;
......
......@@ -52,7 +52,7 @@ static const AVClass channelsplit_class = {
.version = LIBAVUTIL_VERSION_INT,
};
static int init(AVFilterContext *ctx, const char *arg, void *opaque)
static int init(AVFilterContext *ctx, const char *arg)
{
ChannelSplitContext *s = ctx->priv;
int nb_channels;
......
......@@ -184,7 +184,7 @@ static int parse_maps(AVFilterContext *ctx)
return 0;
}
static int join_init(AVFilterContext *ctx, const char *args, void *opaque)
static int join_init(AVFilterContext *ctx, const char *args)
{
JoinContext *s = ctx->priv;
int ret, i;
......
......@@ -30,7 +30,7 @@ typedef struct {
int64_t sample_rate;
} ANullContext;
static int init(AVFilterContext *ctx, const char *args, void *opaque)
static int init(AVFilterContext *ctx, const char *args)
{
ANullContext *priv = ctx->priv;
char channel_layout_str[128] = "";
......
......@@ -429,7 +429,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
int ret=0;
if (filter->filter->init)
ret = filter->filter->init(filter, args, opaque);
ret = filter->filter->init(filter, args);
return ret;
}
......
......@@ -456,10 +456,8 @@ typedef struct AVFilter {
/**
* Filter initialization function. Args contains the user-supplied
* parameters. FIXME: maybe an AVOption-based system would be better?
* opaque is data provided by the code requesting creation of the filter,
* and is used to pass data to the filter.
*/
int (*init)(AVFilterContext *ctx, const char *args, void *opaque);
int (*init)(AVFilterContext *ctx, const char *args);
/**
* Filter uninitialization function. Should deallocate any memory held
......
......@@ -173,7 +173,7 @@ int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
return 0;
}
static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init_video(AVFilterContext *ctx, const char *args)
{
BufferSourceContext *c = ctx->priv;
char pix_fmt_str[128];
......@@ -219,7 +219,7 @@ static const AVClass abuffer_class = {
.version = LIBAVUTIL_VERSION_INT,
};
static av_cold int init_audio(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init_audio(AVFilterContext *ctx, const char *args)
{
BufferSourceContext *s = ctx->priv;
int ret = 0;
......
......@@ -50,7 +50,7 @@ typedef struct {
int allocated_samples; ///< number of samples buf_out was allocated for
} FifoContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
FifoContext *fifo = ctx->priv;
fifo->last = &fifo->root;
......
......@@ -28,7 +28,7 @@
#include "internal.h"
#include "video.h"
static int split_init(AVFilterContext *ctx, const char *args, void *opaque)
static int split_init(AVFilterContext *ctx, const char *args)
{
int i, nb_outputs = 2;
......
......@@ -32,7 +32,7 @@ typedef struct {
AVRational aspect;
} AspectContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
AspectContext *aspect = ctx->priv;
double ratio;
......
......@@ -51,7 +51,7 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
BlackFrameContext *blackframe = ctx->priv;
......
......@@ -77,7 +77,7 @@ typedef struct {
#define V 2
#define A 3
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
BoxBlurContext *boxblur = ctx->priv;
int e;
......
......@@ -113,7 +113,7 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
CropContext *crop = ctx->priv;
......
......@@ -80,7 +80,7 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i
return total;
}
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
CropDetectContext *cd = ctx->priv;
......
......@@ -171,7 +171,7 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
DelogoContext *delogo = ctx->priv;
int ret = 0;
......
......@@ -40,7 +40,7 @@ typedef struct {
int vsub, hsub; ///< chroma subsampling
} DrawBoxContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
DrawBoxContext *drawbox= ctx->priv;
char color_str[1024] = "black";
......
......@@ -280,7 +280,7 @@ error:
return ret;
}
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
int err;
DrawTextContext *dtext = ctx->priv;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment