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/mathematics.h"
#include "avfilter.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))

Enumerations

enum  var_name {
  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_POS, 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_POS, VAR_VARS_NB, VAR_E,
  VAR_INTERLACED, VAR_N, VAR_PHI, VAR_PI,
  VAR_POS, VAR_PREV_INPTS, VAR_PREV_OUTPTS, VAR_PTS,
  VAR_STARTPTS, VAR_TB, 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, const char *args, void *opaque)
static int config_input (AVFilterLink *inlink)
static int select_frame (AVFilterContext *ctx, AVFilterBufferRef *picref)
static void start_frame (AVFilterLink *inlink, AVFilterBufferRef *picref)
static void draw_slice (AVFilterLink *inlink, int y, int h, int slice_dir)
static void end_frame (AVFilterLink *inlink)
static int request_frame (AVFilterLink *outlink)
static int poll_frame (AVFilterLink *outlink)
static av_cold void uninit (AVFilterContext *ctx)

Variables

static const char * var_names []
AVFilter avfilter_vf_select

Detailed Description

filter for selecting which frame passes in the filterchain

Definition in file vf_select.c.

Macro Definition Documentation

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

Definition at line 178 of file vf_select.c.

#define FIFO_SIZE   8

Definition at line 113 of file vf_select.c.

Referenced by init().

#define INTERLACE_TYPE_B   2

Definition at line 144 of file vf_select.c.

Referenced by config_input(), and select_frame().

#define INTERLACE_TYPE_P   0

Definition at line 142 of file vf_select.c.

Referenced by config_input(), and select_frame().

#define INTERLACE_TYPE_T   1

Definition at line 143 of file vf_select.c.

Referenced by config_input(), and select_frame().

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

Definition at line 179 of file vf_select.c.

Referenced by select_frame().

Enumeration Type Documentation

enum var_name
Enumerator:
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_POS 
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_POS 
VAR_VARS_NB 
VAR_E 
VAR_INTERLACED 
VAR_N 
VAR_PHI 
VAR_PI 
VAR_POS 
VAR_PREV_INPTS 
VAR_PREV_OUTPTS 
VAR_PTS 
VAR_STARTPTS 
VAR_TB 
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 72 of file vf_select.c.

Function Documentation

static int config_input ( AVFilterLink inlink)
static

Definition at line 146 of file vf_select.c.

static void draw_slice ( AVFilterLink inlink,
int  y,
int  h,
int  slice_dir 
)
static

Definition at line 235 of file vf_select.c.

static void end_frame ( AVFilterLink inlink)
static

Definition at line 243 of file vf_select.c.

static av_cold int init ( AVFilterContext ctx,
const char *  args,
void opaque 
)
static

Definition at line 123 of file vf_select.c.

static int poll_frame ( AVFilterLink outlink)
static

Definition at line 282 of file vf_select.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 256 of file vf_select.c.

static int select_frame ( AVFilterContext ctx,
AVFilterBufferRef picref 
)
static

Definition at line 181 of file vf_select.c.

Referenced by start_frame().

static void start_frame ( AVFilterLink inlink,
AVFilterBufferRef picref 
)
static

Definition at line 215 of file vf_select.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 304 of file vf_select.c.

Variable Documentation

AVFilter avfilter_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),
.inputs = (AVFilterPad[]) {{ .name = "default",
.get_video_buffer = avfilter_null_get_video_buffer,
.config_props = config_input,
.start_frame = start_frame,
.draw_slice = draw_slice,
.end_frame = end_frame },
{ .name = NULL }},
.outputs = (AVFilterPad[]) {{ .name = "default",
.poll_frame = poll_frame,
.request_frame = request_frame, },
{ .name = NULL}},
}

Definition at line 319 of file vf_select.c.

const char* var_names[]
static

Definition at line 31 of file vf_select.c.

Referenced by init().