FFmpeg
Data Structures | Macros | Functions | Variables
vf_freezedetect.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
#include "filters.h"
#include "scene_sad.h"

Go to the source code of this file.

Data Structures

struct  FreezeDetectContext
 

Macros

#define OFFSET(x)   offsetof(FreezeDetectContext, x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (freezedetect)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int is_frozen (FreezeDetectContext *s, AVFrame *reference, AVFrame *frame)
 
static int set_meta (FreezeDetectContext *s, AVFrame *frame, const char *key, const char *value)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption freezedetect_options []
 
static const AVFilterPad freezedetect_inputs []
 
static const AVFilterPad freezedetect_outputs []
 
AVFilter ff_vf_freezedetect
 

Detailed Description

video freeze detection filter

Definition in file vf_freezedetect.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 50 of file vf_freezedetect.c.

◆ V

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 51 of file vf_freezedetect.c.

◆ F

Definition at line 52 of file vf_freezedetect.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( freezedetect  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 65 of file vf_freezedetect.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 100 of file vf_freezedetect.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 121 of file vf_freezedetect.c.

◆ is_frozen()

static int is_frozen ( FreezeDetectContext s,
AVFrame reference,
AVFrame frame 
)
static

Definition at line 127 of file vf_freezedetect.c.

Referenced by activate().

◆ set_meta()

static int set_meta ( FreezeDetectContext s,
AVFrame frame,
const char *  key,
const char *  value 
)
static

Definition at line 147 of file vf_freezedetect.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 153 of file vf_freezedetect.c.

Variable Documentation

◆ freezedetect_options

const AVOption freezedetect_options[]
static
Initial value:
= {
{ "n", "set noise tolerance", OFFSET(noise), AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0, 1.0, V|F },
{ "noise", "set noise tolerance", OFFSET(noise), AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0, 1.0, V|F },
{ "d", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=2000000}, 0, INT64_MAX, V|F },
{ "duration", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=2000000}, 0, INT64_MAX, V|F },
{NULL}
}

Definition at line 54 of file vf_freezedetect.c.

◆ freezedetect_inputs

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

Definition at line 208 of file vf_freezedetect.c.

◆ freezedetect_outputs

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

Definition at line 217 of file vf_freezedetect.c.

◆ ff_vf_freezedetect

AVFilter ff_vf_freezedetect
Initial value:
= {
.name = "freezedetect",
.description = NULL_IF_CONFIG_SMALL("Detects frozen video input."),
.priv_size = sizeof(FreezeDetectContext),
.priv_class = &freezedetect_class,
}

Definition at line 225 of file vf_freezedetect.c.

activate
static int activate(AVFilterContext *ctx)
Definition: vf_freezedetect.c:153
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:237
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_freezedetect.c:121
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_freezedetect.c:100
freezedetect_inputs
static const AVFilterPad freezedetect_inputs[]
Definition: vf_freezedetect.c:208
duration
int64_t duration
Definition: movenc.c:63
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
FreezeDetectContext
Definition: vf_freezedetect.c:34
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_freezedetect.c:65
freezedetect_outputs
static const AVFilterPad freezedetect_outputs[]
Definition: vf_freezedetect.c:217
V
#define V
Definition: vf_freezedetect.c:51
noise
static int noise(AVBSFContext *ctx, AVPacket *pkt)
Definition: noise_bsf.c:38
OFFSET
#define OFFSET(x)
Definition: vf_freezedetect.c:50
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
F
#define F
Definition: vf_freezedetect.c:52