#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"
+#include "internal.h"
#include "formats.h"
#include "video.h"
{ NULL },
};
-static const AVClass life_class = {
- .class_name = "life",
- .item_name = av_default_item_name,
- .option = life_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(life);
static int parse_rule(uint16_t *born_rule, uint16_t *stay_rule,
const char *rule_str, void *log_ctx)
return 0;
}
-static int init(AVFilterContext *ctx, const char *args, void *opaque)
+static int init(AVFilterContext *ctx, const char *args)
{
LifeContext *life = ctx->priv;
AVRational frame_rate;
life->class = &life_class;
av_opt_set_defaults(life);
- if ((ret = av_set_options_string(life, args, "=", ":")) < 0) {
- av_log(ctx, AV_LOG_ERROR, "Error parsing options string: '%s'\n", args);
+ if ((ret = av_set_options_string(life, args, "=", ":")) < 0)
return ret;
- }
if ((ret = av_parse_video_rate(&frame_rate, life->rate)) < 0) {
av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: %s\n", life->rate);
return ret;
}
- av_log(ctx, AV_LOG_INFO,
+ av_log(ctx, AV_LOG_VERBOSE,
"s:%dx%d r:%d/%d rule:%s stay_rule:%d born_rule:%d stitch:%d seed:%u\n",
life->w, life->h, frame_rate.num, frame_rate.den,
life->rule_str, life->stay_rule, life->born_rule, life->stitch,