FFSWAP(void*, mb->next_cache, mb->point_cache);
mb->cache_used = next_cidx;
if(mb->cache_used == mb->cache_allocated)
- av_log(0, AV_LOG_INFO, "Mandelbrot cache is too small!\n");
+ av_log(ctx, AV_LOG_INFO, "Mandelbrot cache is too small!\n");
}
static int request_frame(AVFilterLink *link)
picref->pts = mb->pts++;
picref->pos = -1;
- ff_start_frame(link, avfilter_ref_buffer(picref, ~0));
draw_mandelbrot(link->src, (uint32_t*)picref->data[0], picref->linesize[0]/4, picref->pts);
- ff_draw_slice(link, 0, mb->h, 1);
- ff_end_frame(link);
- avfilter_unref_buffer(picref);
+ ff_filter_frame(link, picref);
return 0;
}
+static const AVFilterPad mandelbrot_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = config_props,
+ },
+ { NULL },
+};
+
AVFilter avfilter_vsrc_mandelbrot = {
.name = "mandelbrot",
.description = NULL_IF_CONFIG_SMALL("Render a Mandelbrot fractal."),
.uninit = uninit,
.query_formats = query_formats,
-
- .inputs = (const AVFilterPad[]) {{ .name = NULL}},
-
- .outputs = (const AVFilterPad[]) {{ .name = "default",
- .type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
- .config_props = config_props },
- { .name = NULL}},
+ .inputs = NULL,
+ .outputs = mandelbrot_outputs,
+ .priv_class = &mandelbrot_class,
};