diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c index 5658da11ea..39bd850fdb 100644 --- a/libavfilter/af_aformat.c +++ b/libavfilter/af_aformat.c @@ -90,7 +90,7 @@ static int get_sample_rate(const char *samplerate) return FFMAX(ret, 0); } -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { AFormatContext *s = ctx->priv; diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index a1f6747c51..1981365fec 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -483,7 +483,7 @@ fail: return ret; } -static int init(AVFilterContext *ctx, const char *args) +static int init(AVFilterContext *ctx) { MixContext *s = ctx->priv; int i; diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c index 8c7313a321..13c5a915c4 100644 --- a/libavfilter/af_asyncts.c +++ b/libavfilter/af_asyncts.c @@ -60,7 +60,7 @@ static const AVOption asyncts_options[] = { AVFILTER_DEFINE_CLASS(asyncts); -static int init(AVFilterContext *ctx, const char *args) +static int init(AVFilterContext *ctx) { ASyncContext *s = ctx->priv; diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 4cc92c93ac..a4088640a3 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -120,7 +120,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) +static av_cold int channelmap_init(AVFilterContext *ctx) { ChannelMapContext *s = ctx->priv; int ret = 0; diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c index e87d629642..89743c6909 100644 --- a/libavfilter/af_channelsplit.c +++ b/libavfilter/af_channelsplit.c @@ -49,7 +49,7 @@ static const AVOption channelsplit_options[] = { AVFILTER_DEFINE_CLASS(channelsplit); -static int init(AVFilterContext *ctx, const char *arg) +static int init(AVFilterContext *ctx) { ChannelSplitContext *s = ctx->priv; int nb_channels; diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c index cba400225b..f3fdccafc1 100644 --- a/libavfilter/af_join.c +++ b/libavfilter/af_join.c @@ -187,7 +187,7 @@ static int parse_maps(AVFilterContext *ctx) return 0; } -static int join_init(AVFilterContext *ctx, const char *args) +static int join_init(AVFilterContext *ctx) { JoinContext *s = ctx->priv; int ret, i; diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c index 915a4dc197..7d2b9bad55 100644 --- a/libavfilter/af_volume.c +++ b/libavfilter/af_volume.c @@ -56,7 +56,7 @@ static const AVOption volume_options[] = { AVFILTER_DEFINE_CLASS(volume); -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { VolumeContext *vol = ctx->priv; diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 871ab49c7a..a1b0a1da02 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -838,9 +838,9 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque } if (filter->filter->init_opaque) - ret = filter->filter->init_opaque(filter, args, opaque); + ret = filter->filter->init_opaque(filter, opaque); else if (filter->filter->init) - ret = filter->filter->init(filter, args); + ret = filter->filter->init(filter); else if (filter->filter->init_dict) ret = filter->filter->init_dict(filter, &options); if (ret < 0) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 88cd3e3979..4aa4399303 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -441,10 +441,10 @@ typedef struct AVFilter { */ /** - * Filter initialization function. Args contains the user-supplied - * parameters. FIXME: maybe an AVOption-based system would be better? + * Filter initialization function. Called when all the options have been + * set. */ - int (*init)(AVFilterContext *ctx, const char *args); + int (*init)(AVFilterContext *ctx); /** * Should be set instead of init by the filters that want to pass a diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 1d65a1db35..3e05fb37e6 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -289,7 +289,7 @@ int av_buffersrc_buffer(AVFilterContext *ctx, AVFilterBufferRef *buf) } #endif -static av_cold int init_video(AVFilterContext *ctx, const char *args) +static av_cold int init_video(AVFilterContext *ctx) { BufferSourceContext *c = ctx->priv; @@ -352,7 +352,7 @@ static const AVOption abuffer_options[] = { AVFILTER_DEFINE_CLASS(abuffer); -static av_cold int init_audio(AVFilterContext *ctx, const char *args) +static av_cold int init_audio(AVFilterContext *ctx) { BufferSourceContext *s = ctx->priv; int ret = 0; diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c index 5153752f06..ba72cca07f 100644 --- a/libavfilter/fifo.c +++ b/libavfilter/fifo.c @@ -51,7 +51,7 @@ typedef struct { int allocated_samples; ///< number of samples out was allocated for } FifoContext; -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { FifoContext *fifo = ctx->priv; fifo->last = &fifo->root; diff --git a/libavfilter/split.c b/libavfilter/split.c index cde2ab1efb..39d2da41b5 100644 --- a/libavfilter/split.c +++ b/libavfilter/split.c @@ -39,7 +39,7 @@ typedef struct SplitContext { int nb_outputs; } SplitContext; -static int split_init(AVFilterContext *ctx, const char *args) +static int split_init(AVFilterContext *ctx) { SplitContext *s = ctx->priv; int i; diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c index 99457a76a1..973116a958 100644 --- a/libavfilter/vf_aspect.c +++ b/libavfilter/vf_aspect.c @@ -45,7 +45,7 @@ typedef struct { } AspectContext; #if FF_API_OLD_FILTER_OPTS -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { AspectContext *s = ctx->priv; diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index 412af3c74e..758964476b 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@ -78,7 +78,7 @@ typedef struct { #define V 2 #define A 3 -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { BoxBlurContext *boxblur = ctx->priv; diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index b721f70df5..3d109f8a59 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -84,7 +84,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) +static av_cold int init(AVFilterContext *ctx) { CropDetectContext *cd = ctx->priv; diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c index 1b4ea69c38..4808cf368b 100644 --- a/libavfilter/vf_delogo.c +++ b/libavfilter/vf_delogo.c @@ -168,7 +168,7 @@ static int query_formats(AVFilterContext *ctx) return 0; } -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { DelogoContext *delogo = ctx->priv; diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index c575b2fa56..edb77cc79f 100644 --- a/libavfilter/vf_drawbox.c +++ b/libavfilter/vf_drawbox.c @@ -45,7 +45,7 @@ typedef struct { int vsub, hsub; ///< chroma subsampling } DrawBoxContext; -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { DrawBoxContext *drawbox = ctx->priv; uint8_t rgba_color[4]; diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 62d9f88406..89c855c384 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -416,7 +416,7 @@ static int load_textfile(AVFilterContext *ctx) return 0; } -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { int err; DrawTextContext *dtext = ctx->priv; diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index 639ef34cf9..71e0f01208 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -63,7 +63,7 @@ typedef struct { } FadeContext; -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { FadeContext *fade = ctx->priv; diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index 5a95b5f525..56ce74c503 100644 --- a/libavfilter/vf_format.c +++ b/libavfilter/vf_format.c @@ -48,7 +48,7 @@ typedef struct { #define AV_PIX_FMT_NAME_MAXSIZE 32 -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { FormatContext *format = ctx->priv; const char *cur, *sep; diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c index d9f610a00a..b819567960 100644 --- a/libavfilter/vf_fps.c +++ b/libavfilter/vf_fps.c @@ -70,7 +70,7 @@ static const AVOption fps_options[] = { AVFILTER_DEFINE_CLASS(fps); -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { FPSContext *s = ctx->priv; diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index c16e0479bc..6107fc1b32 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -328,7 +328,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx, return 0; } -static av_cold int filter_init(AVFilterContext *ctx, const char *args) +static av_cold int filter_init(AVFilterContext *ctx) { Frei0rContext *frei0r = ctx->priv; @@ -454,7 +454,7 @@ AVFilter avfilter_vf_frei0r = { .outputs = avfilter_vf_frei0r_outputs, }; -static av_cold int source_init(AVFilterContext *ctx, const char *args) +static av_cold int source_init(AVFilterContext *ctx) { Frei0rContext *frei0r = ctx->priv; AVRational frame_rate_q; diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index b174673e2b..9e21560de9 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -121,7 +121,7 @@ static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int wi } } -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { GradFunContext *gf = ctx->priv; diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c index f2117a8db7..1582b3b651 100644 --- a/libavfilter/vf_hqdn3d.c +++ b/libavfilter/vf_hqdn3d.c @@ -181,7 +181,7 @@ static int16_t *precalc_coefs(double dist25, int depth) #define PARAM2_DEFAULT 3.0 #define PARAM3_DEFAULT 6.0 -static int init(AVFilterContext *ctx, const char *args) +static int init(AVFilterContext *ctx) { HQDN3DContext *hqdn3d = ctx->priv; diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c index aa5d0258a6..cbaf8f79b9 100644 --- a/libavfilter/vf_libopencv.c +++ b/libavfilter/vf_libopencv.c @@ -317,7 +317,7 @@ static OCVFilterEntry ocv_filter_entries[] = { { "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter }, }; -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { OCVContext *ocv = ctx->priv; int i; diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index 2824f03b09..1f0b684b75 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -354,7 +354,7 @@ static const AVFilterPad outputs[] = { #define lut_options options AVFILTER_DEFINE_CLASS(lut); -static int lut_init(AVFilterContext *ctx, const char *args) +static int lut_init(AVFilterContext *ctx) { return 0; } @@ -367,7 +367,7 @@ DEFINE_LUT_FILTER(lut, "Compute and apply a lookup table to the RGB/YUV input vi #define lutyuv_options options AVFILTER_DEFINE_CLASS(lutyuv); -static int lutyuv_init(AVFilterContext *ctx, const char *args) +static int lutyuv_init(AVFilterContext *ctx) { LutContext *lut = ctx->priv; @@ -384,7 +384,7 @@ DEFINE_LUT_FILTER(lutyuv, "Compute and apply a lookup table to the YUV input vid #define lutrgb_options options AVFILTER_DEFINE_CLASS(lutrgb); -static int lutrgb_init(AVFilterContext *ctx, const char *args) +static int lutrgb_init(AVFilterContext *ctx) { LutContext *lut = ctx->priv; @@ -405,7 +405,7 @@ static const AVOption negate_options[] = { AVFILTER_DEFINE_CLASS(negate); -static int negate_init(AVFilterContext *ctx, const char *args) +static int negate_init(AVFilterContext *ctx) { LutContext *lut = ctx->priv; int i; @@ -421,7 +421,7 @@ static int negate_init(AVFilterContext *ctx, const char *args) } } - return lut_init(ctx, NULL); + return lut_init(ctx); } DEFINE_LUT_FILTER(negate, "Negate input video."); diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 7159c37c9a..34076799a6 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -94,7 +94,7 @@ typedef struct { FFDrawColor color; } PadContext; -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { PadContext *pad = ctx->priv; diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 176e66dd07..cce2cc220b 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -92,7 +92,7 @@ typedef struct { char *flags_str; } ScaleContext; -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { ScaleContext *scale = ctx->priv; int ret; diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index ba025c9550..038ba4bafe 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -143,7 +143,7 @@ static void set_filter_param(FilterParam *fp, int msize_x, int msize_y, float am fp->halfscale = 1 << (fp->scalebits - 1); } -static av_cold int init(AVFilterContext *ctx, const char *args) +static av_cold int init(AVFilterContext *ctx) { UnsharpContext *unsharp = ctx->priv; diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 7ae256d40d..a981001c04 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -500,7 +500,7 @@ static void test_fill_picture(AVFilterContext *ctx, AVFrame *frame) } } -static av_cold int test_init(AVFilterContext *ctx, const char *args) +static av_cold int test_init(AVFilterContext *ctx) { TestSourceContext *test = ctx->priv; @@ -604,7 +604,7 @@ static void rgbtest_fill_picture(AVFilterContext *ctx, AVFrame *frame) } } -static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args) +static av_cold int rgbtest_init(AVFilterContext *ctx) { TestSourceContext *test = ctx->priv;