X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_cropdetect.c;h=e107f471c3048fddb9dab3302e84bc638046e593;hb=cdaec0b24045963487f121a7a191dcdb530d008d;hp=000c8bb2c27162b87f4e7f3651ea3c2c950c5585;hpb=737eb5976f6a37703923ce3c3d5e6ca8eeabb43a;p=ffmpeg diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index 000c8bb2c27..e107f471c30 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -1,19 +1,19 @@ /* * Copyright (c) 2002 A'rpi - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or modify + * Libav is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * with Libav; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ @@ -23,8 +23,14 @@ * Ported from MPlayer libmpcodecs/vf_cropdetect.c. */ +#include + #include "libavutil/imgutils.h" +#include "libavutil/internal.h" #include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" typedef struct { int x1, y1, x2, y2; @@ -46,7 +52,7 @@ static int query_formats(AVFilterContext *ctx) PIX_FMT_NONE }; - avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); + ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; } @@ -77,7 +83,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; @@ -89,7 +95,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) if (args) sscanf(args, "%d:%d:%d", &cd->limit, &cd->round, &cd->reset_count); - av_log(ctx, AV_LOG_INFO, "limit:%d round:%d reset_count:%d\n", + av_log(ctx, AV_LOG_VERBOSE, "limit:%d round:%d reset_count:%d\n", cd->limit, cd->round, cd->reset_count); return 0; @@ -111,7 +117,7 @@ static int config_input(AVFilterLink *inlink) return 0; } -static void end_frame(AVFilterLink *inlink) +static int end_frame(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; CropDetectContext *cd = ctx->priv; @@ -188,7 +194,7 @@ static void end_frame(AVFilterLink *inlink) w, h, x, y); } - avfilter_end_frame(inlink->dst->outputs[0]); + return ff_end_frame(inlink->dst->outputs[0]); } AVFilter avfilter_vf_cropdetect = { @@ -200,15 +206,15 @@ AVFilter avfilter_vf_cropdetect = { .query_formats = query_formats, - .inputs = (AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - .get_video_buffer = avfilter_null_get_video_buffer, - .start_frame = avfilter_null_start_frame, - .end_frame = end_frame, }, - { .name = NULL}}, - - .outputs = (AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO }, - { .name = NULL}}, + .inputs = (const AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .end_frame = end_frame, }, + { .name = NULL}}, + + .outputs = (const AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO }, + { .name = NULL}}, };