Commit 018cc6f0 authored by Paul B Mahol's avatar Paul B Mahol

lavfi/histogram: use standard options parsing

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 1f97dfb7
...@@ -73,20 +73,6 @@ static const AVOption histogram_options[] = { ...@@ -73,20 +73,6 @@ static const AVOption histogram_options[] = {
AVFILTER_DEFINE_CLASS(histogram); AVFILTER_DEFINE_CLASS(histogram);
static av_cold int init(AVFilterContext *ctx, const char *args)
{
HistogramContext *h = ctx->priv;
int ret;
h->class = &histogram_class;
av_opt_set_defaults(h);
if ((ret = (av_set_options_string(h, args, "=", ":"))) < 0)
return ret;
return 0;
}
static const enum AVPixelFormat color_pix_fmts[] = { static const enum AVPixelFormat color_pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NONE AV_PIX_FMT_NONE
...@@ -306,13 +292,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -306,13 +292,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return 0; return 0;
} }
static av_cold void uninit(AVFilterContext *ctx)
{
HistogramContext *h = ctx->priv;
av_opt_free(h);
}
static const AVFilterPad inputs[] = { static const AVFilterPad inputs[] = {
{ {
.name = "default", .name = "default",
...@@ -332,14 +311,15 @@ static const AVFilterPad outputs[] = { ...@@ -332,14 +311,15 @@ static const AVFilterPad outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] = { NULL };
AVFilter avfilter_vf_histogram = { AVFilter avfilter_vf_histogram = {
.name = "histogram", .name = "histogram",
.description = NULL_IF_CONFIG_SMALL("Compute and draw a histogram."), .description = NULL_IF_CONFIG_SMALL("Compute and draw a histogram."),
.priv_size = sizeof(HistogramContext), .priv_size = sizeof(HistogramContext),
.init = init,
.uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = inputs, .inputs = inputs,
.outputs = outputs, .outputs = outputs,
.priv_class = &histogram_class, .priv_class = &histogram_class,
.shorthand = shorthand,
}; };
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