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_E,
  VAR_PHI, VAR_PI, VAR_AVTB, VAR_INTB,
  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_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

§ FIFO_SIZE

#define FIFO_SIZE   8

Definition at line 116 of file vf_select.c.

Referenced by init().

§ INTERLACE_TYPE_P

#define INTERLACE_TYPE_P   0

Definition at line 148 of file vf_select.c.

Referenced by config_input(), and select_frame().

§ INTERLACE_TYPE_T

#define INTERLACE_TYPE_T   1

Definition at line 149 of file vf_select.c.

Referenced by config_input(), and select_frame().

§ INTERLACE_TYPE_B

#define INTERLACE_TYPE_B   2

Definition at line 150 of file vf_select.c.

Referenced by config_input(), and select_frame().

§ D2TS

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

Definition at line 184 of file vf_select.c.

§ TS2D

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

Definition at line 185 of file vf_select.c.

Referenced by select_frame().

§ OFFSET

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

Definition at line 304 of file vf_select.c.

§ FLAGS

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 305 of file vf_select.c.

Enumeration Type Documentation

§ var_name

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_E 
VAR_PHI 
VAR_PI 
VAR_AVTB 
VAR_INTB 
VAR_SR 
VAR_VARS_NB 
VAR_PI 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_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_VARS_NB 

Definition at line 76 of file vf_select.c.

Function Documentation

§ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 128 of file vf_select.c.

§ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 152 of file vf_select.c.

§ select_frame()

static int select_frame ( AVFilterContext ctx,
AVFrame frame 
)
static

Definition at line 187 of file vf_select.c.

Referenced by filter_frame().

§ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 220 of file vf_select.c.

§ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 244 of file vf_select.c.

§ poll_frame()

static int poll_frame ( AVFilterLink outlink)
static

Definition at line 267 of file vf_select.c.

§ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 289 of file vf_select.c.

Variable Documentation

§ var_names

const char* const var_names[]
static

Definition at line 35 of file vf_select.c.

Referenced by init().

§ options

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 },
}
#define FLAGS
Definition: vf_select.c:305
#define OFFSET(x)
Definition: vf_select.c:304
NULL
Definition: eval.c:55

Definition at line 306 of file vf_select.c.

§ select_class

const AVClass select_class
static
Initial value:
= {
.class_name = "select",
.item_name = av_default_item_name,
.option = options,
}
static const AVOption options[]
Definition: vf_select.c:306
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:52

Definition at line 311 of file vf_select.c.

§ avfilter_vf_select_inputs

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 }
}
static int config_input(AVFilterLink *inlink)
Definition: vf_select.c:152
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
Definition: video.c:30
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_select.c:220
NULL
Definition: eval.c:55

Definition at line 318 of file vf_select.c.

§ avfilter_vf_select_outputs

const AVFilterPad avfilter_vf_select_outputs[]
static
Initial value:
= {
{
.name = "default",
.poll_frame = poll_frame,
.request_frame = request_frame,
},
{ NULL }
}
NULL
Definition: eval.c:55
static int poll_frame(AVFilterLink *outlink)
Definition: vf_select.c:267
static int request_frame(AVFilterLink *outlink)
Definition: vf_select.c:244

Definition at line 329 of file vf_select.c.

§ ff_vf_select

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,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:232
static const AVFilterPad avfilter_vf_select_outputs[]
Definition: vf_select.c:329
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:145
static const AVFilterPad avfilter_vf_select_inputs[]
Definition: vf_select.c:318
static av_cold int init(AVFilterContext *ctx)
Definition: vf_select.c:128
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:221
static const AVClass select_class
Definition: vf_select.c:311
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_select.c:289

Definition at line 339 of file vf_select.c.