/*
* 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.
*/
* Ported from MPlayer libmpcodecs/vf_cropdetect.c.
*/
+#include <stdio.h>
+
#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;
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;
}
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;
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;
return 0;
}
-static void end_frame(AVFilterLink *inlink)
+static int end_frame(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
CropDetectContext *cd = ctx->priv;
w, h, x, y);
}
- avfilter_end_frame(inlink->dst->outputs[0]);
+ return ff_end_frame(inlink->dst->outputs[0]);
}
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}},
};