Libav
Data Structures | Macros | Enumerations | Functions | Variables
vf_select.c File Reference

filter for selecting which frame passes in the filterchain More...

#include "libavutil/eval.h"
#include "libavutil/fifo.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  SelectContext

Macros

#define FIFO_SIZE   8
#define INTERLACE_TYPE_P   0
#define INTERLACE_TYPE_T   1
#define INTERLACE_TYPE_B   2
#define D2TS(d)   (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
#define TS2D(ts)   ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
#define OFFSET(x)   offsetof(SelectContext, x)
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Enumerations

enum  var_name {
  VAR_E, VAR_INTERLACED, VAR_N, VAR_PHI,
  VAR_PI, VAR_PREV_INPTS, VAR_PREV_OUTPTS, VAR_PTS,
  VAR_STARTPTS, VAR_TB, VAR_RTCTIME, VAR_RTCSTART,
  VAR_S, VAR_SR, VAR_VARS_NB, VAR_PI,
  VAR_PHI, VAR_E, VAR_W, VAR_H,
  VAR_A, VAR_DAR, VAR_SAR, VAR_HSUB,
  VAR_VSUB, VARS_NB, VAR_W, VAR_H,
  VAR_CW, VAR_CH, VAR_HSUB, VAR_VSUB,
  VARS_NB, VAR_E, VAR_PHI, VAR_PI,
  VAR_IN_W, VAR_IW, VAR_IN_H, VAR_IH,
  VAR_OUT_W, VAR_OW, VAR_OUT_H, VAR_OH,
  VAR_X, VAR_Y, VAR_N, VAR_T,
  VAR_VARS_NB, VAR_E, VAR_PHI, VAR_PI,
  VAR_MAIN_W, VAR_MW, VAR_MAIN_H, VAR_MH,
  VAR_TEXT_W, VAR_TW, VAR_TEXT_H, VAR_TH,
  VAR_X, VAR_Y, VAR_N, VAR_T,
  VAR_VARS_NB, VAR_E, VAR_PHI, VAR_PI,
  VAR_W, VAR_H, VAR_VAL, VAR_MAXVAL,
  VAR_MINVAL, VAR_NEGVAL, VAR_CLIPVAL, VAR_VARS_NB,
  VAR_E, VAR_PHI, VAR_PI, VAR_MAIN_W,
  VAR_MW, VAR_MAIN_H, VAR_MH, VAR_OVERLAY_W,
  VAR_OW, VAR_OVERLAY_H, VAR_OH, VAR_VARS_NB,
  VAR_PI, VAR_PHI, VAR_E, VAR_IN_W,
  VAR_IW, VAR_IN_H, VAR_IH, VAR_OUT_W,
  VAR_OW, VAR_OUT_H, VAR_OH, VAR_X,
  VAR_Y, VAR_A, VAR_HSUB, VAR_VSUB,
  VARS_NB, VAR_PI, VAR_PHI, VAR_E,
  VAR_IN_W, VAR_IW, VAR_IN_H, VAR_IH,
  VAR_OUT_W, VAR_OW, VAR_OUT_H, VAR_OH,
  VAR_A, VAR_DAR, VAR_SAR, VAR_HSUB,
  VAR_VSUB, VARS_NB, VAR_E, VAR_PHI,
  VAR_PI, VAR_TB, VAR_PTS, VAR_START_PTS,
  VAR_PREV_PTS, VAR_PREV_SELECTED_PTS, VAR_T, VAR_START_T,
  VAR_PREV_T, VAR_PREV_SELECTED_T, VAR_PICT_TYPE, VAR_PICT_TYPE_I,
  VAR_PICT_TYPE_P, VAR_PICT_TYPE_B, VAR_PICT_TYPE_S, VAR_PICT_TYPE_SI,
  VAR_PICT_TYPE_SP, VAR_PICT_TYPE_BI, VAR_INTERLACE_TYPE, VAR_INTERLACE_TYPE_P,
  VAR_INTERLACE_TYPE_T, VAR_INTERLACE_TYPE_B, VAR_N, VAR_SELECTED_N,
  VAR_PREV_SELECTED_N, VAR_KEY, VAR_VARS_NB, VAR_E,
  VAR_PHI, VAR_PI, VAR_AVTB, VAR_INTB,
  VAR_VARS_NB, VAR_E, VAR_PHI, VAR_PI,
  VAR_AVTB, VAR_VARS_NB
}

Functions

static av_cold int init (AVFilterContext *ctx)
static int config_input (AVFilterLink *inlink)
static int select_frame (AVFilterContext *ctx, AVFrame *frame)
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
static int request_frame (AVFilterLink *outlink)
static int poll_frame (AVFilterLink *outlink)
static av_cold void uninit (AVFilterContext *ctx)

Variables

static const char *const var_names []
static const AVOption options []
static const AVClass select_class
static const AVFilterPad avfilter_vf_select_inputs []
static const AVFilterPad avfilter_vf_select_outputs []
AVFilter ff_vf_select

Detailed Description

filter for selecting which frame passes in the filterchain

Definition in file vf_select.c.

Macro Definition Documentation

#define FIFO_SIZE   8

Definition at line 116 of file vf_select.c.

Referenced by init().

#define INTERLACE_TYPE_P   0

Definition at line 148 of file vf_select.c.

Referenced by config_input(), and select_frame().

#define INTERLACE_TYPE_T   1

Definition at line 149 of file vf_select.c.

Referenced by config_input(), and select_frame().

#define INTERLACE_TYPE_B   2

Definition at line 150 of file vf_select.c.

Referenced by config_input(), and select_frame().

#define D2TS (   d)    (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))

Definition at line 184 of file vf_select.c.

#define TS2D (   ts)    ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))

Definition at line 185 of file vf_select.c.

Referenced by select_frame().

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

Definition at line 316 of file vf_select.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 317 of file vf_select.c.

Enumeration Type Documentation

enum var_name
Enumerator:
VAR_E 
VAR_INTERLACED 
VAR_N 
VAR_PHI 
VAR_PI 
VAR_PREV_INPTS 
VAR_PREV_OUTPTS 
VAR_PTS 
VAR_STARTPTS 
VAR_TB 
VAR_RTCTIME 
VAR_RTCSTART 
VAR_S 
VAR_SR 
VAR_VARS_NB 
VAR_PI 
VAR_PHI 
VAR_E 
VAR_W 
VAR_H 
VAR_A 
VAR_DAR 
VAR_SAR 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_W 
VAR_H 
VAR_CW 
VAR_CH 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_IN_W 
VAR_IW 
VAR_IN_H 
VAR_IH 
VAR_OUT_W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E_TYPE_P 
VAR_INTERLACE_TYPE_T 
VAR_INTERLACE_TYPE_B 
VAR_N 
VAR_SELECTED_N 
VAR_PREV_SELECTED_N 
VAR_KEY 
VAR_VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_AVTB 
VAR_INTB 
VAR_VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_AVTB 
VAR_VARS_NB 

Definition at line 76 of file vf_select.c.

Function Documentation

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 128 of file vf_select.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 152 of file vf_select.c.

static int select_frame ( AVFilterContext ctx,
AVFrame frame 
)
static

Definition at line 187 of file vf_select.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 232 of file vf_select.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 256 of file vf_select.c.

static int poll_frame ( AVFilterLink outlink)
static

Definition at line 279 of file vf_select.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 301 of file vf_select.c.

Variable Documentation

const char* const var_names[]
static

Definition at line 35 of file vf_select.c.

Referenced by init().

const AVOption options[]
static
Initial value:
{
{ "expr", "An expression to use for selecting frames", OFFSET(expr_str), AV_OPT_TYPE_STRING, { .str = "1" }, .flags = FLAGS },
{ NULL },
}

Definition at line 318 of file vf_select.c.

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

Definition at line 323 of file vf_select.c.

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

Definition at line 330 of file vf_select.c.

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

Definition at line 341 of file vf_select.c.

AVFilter ff_vf_select
Initial value:
{
.name = "select",
.description = NULL_IF_CONFIG_SMALL("Select frames to pass in output."),
.init = init,
.uninit = uninit,
.priv_size = sizeof(SelectContext),
.priv_class = &select_class,
}

Definition at line 351 of file vf_select.c.