Libav
Data Structures | Macros | Functions | Variables
vf_cropdetect.c File Reference

border detection filter Ported from MPlayer libmpcodecs/vf_cropdetect.c. More...

#include <stdio.h>
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  CropDetectContext

Macros

#define OFFSET(x)   offsetof(CropDetectContext, x)
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Functions

static int query_formats (AVFilterContext *ctx)
static int checkline (void *ctx, const unsigned char *src, int stride, int len, int bpp)
static av_cold int init (AVFilterContext *ctx)
static int config_input (AVFilterLink *inlink)
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)

Variables

static const AVOption options []
static const AVClass cropdetect_class
static const AVFilterPad avfilter_vf_cropdetect_inputs []
static const AVFilterPad avfilter_vf_cropdetect_outputs []
AVFilter ff_vf_cropdetect

Detailed Description

border detection filter Ported from MPlayer libmpcodecs/vf_cropdetect.c.

Definition in file vf_cropdetect.c.

Macro Definition Documentation

#define OFFSET (   x)    offsetof(CropDetectContext, x)

Definition at line 196 of file vf_cropdetect.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 197 of file vf_cropdetect.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)
static

Definition at line 47 of file vf_cropdetect.c.

static int checkline ( void ctx,
const unsigned char *  src,
int  stride,
int  len,
int  bpp 
)
static

Definition at line 62 of file vf_cropdetect.c.

Referenced by filter_frame().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 89 of file vf_cropdetect.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 101 of file vf_cropdetect.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 117 of file vf_cropdetect.c.

Variable Documentation

const AVOption options[]
static
Initial value:
{
{ "limit", "Threshold below which the pixel is considered black", OFFSET(limit), AV_OPT_TYPE_INT, { .i64 = 24 }, 0, INT_MAX, FLAGS },
{ "round", "Value by which the width/height should be divisible", OFFSET(round), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
{ "reset", "Recalculate the crop area after this many frames", OFFSET(reset_count), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
{ NULL },
}

Definition at line 198 of file vf_cropdetect.c.

const AVClass cropdetect_class
static
Initial value:
{
.class_name = "cropdetect",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 205 of file vf_cropdetect.c.

const AVFilterPad avfilter_vf_cropdetect_inputs[]
static
Initial value:
{
{
.name = "default",
.config_props = config_input,
.get_video_buffer = ff_null_get_video_buffer,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 212 of file vf_cropdetect.c.

const AVFilterPad avfilter_vf_cropdetect_outputs[]
static
Initial value:
{
{
.name = "default",
},
{ NULL }
}

Definition at line 223 of file vf_cropdetect.c.

AVFilter ff_vf_cropdetect
Initial value:
{
.name = "cropdetect",
.description = NULL_IF_CONFIG_SMALL("Auto-detect crop size."),
.priv_size = sizeof(CropDetectContext),
.priv_class = &cropdetect_class,
.init = init,
}

Definition at line 231 of file vf_cropdetect.c.