FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_fps.c File Reference

a filter enforcing given constant framerate More...

#include <float.h>
#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/fifo.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "framequeue.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  FPSContext
 

Macros

#define FF_INTERNAL_FIELDS   1
 
#define OFFSET(x)   offsetof(FPSContext, x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  EOFAction {
  EOF_ACTION_REPEAT, EOF_ACTION_ENDALL, EOF_ACTION_PASS, EOF_ACTION_ROUND,
  EOF_ACTION_PASS, EOF_ACTION_NB, EOF_ACTION_REPEAT, EOF_ACTION_ENDALL
}
 

Functions

 AVFILTER_DEFINE_CLASS (fps)
 
static av_cold int init (AVFilterContext *ctx)
 
static void flush_fifo (AVFifoBuffer *fifo)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *link)
 
static int request_frame (AVFilterLink *outlink)
 
static int write_to_fifo (AVFifoBuffer *fifo, AVFrame *buf)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *buf)
 

Variables

static const AVOption fps_options []
 
static const AVFilterPad avfilter_vf_fps_inputs []
 
static const AVFilterPad avfilter_vf_fps_outputs []
 
AVFilter ff_vf_fps
 

Detailed Description

a filter enforcing given constant framerate

Definition in file vf_fps.c.

Macro Definition Documentation

#define FF_INTERNAL_FIELDS   1

Definition at line 37 of file vf_fps.c.

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

Definition at line 70 of file vf_fps.c.

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 71 of file vf_fps.c.

Definition at line 72 of file vf_fps.c.

Enumeration Type Documentation

enum EOFAction
Enumerator
EOF_ACTION_REPEAT 
EOF_ACTION_ENDALL 
EOF_ACTION_PASS 
EOF_ACTION_ROUND 
EOF_ACTION_PASS 
EOF_ACTION_NB 
EOF_ACTION_REPEAT 
EOF_ACTION_ENDALL 

Definition at line 43 of file vf_fps.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( fps  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 90 of file vf_fps.c.

static void flush_fifo ( AVFifoBuffer fifo)
static

Definition at line 103 of file vf_fps.c.

Referenced by filter_frame(), and uninit().

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 112 of file vf_fps.c.

static int config_props ( AVFilterLink link)
static

Definition at line 125 of file vf_fps.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 137 of file vf_fps.c.

static int write_to_fifo ( AVFifoBuffer fifo,
AVFrame buf 
)
static

Definition at line 201 of file vf_fps.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 215 of file vf_fps.c.

Variable Documentation

const AVOption fps_options[]
static
Initial value:
= {
{ "fps", "A string describing desired output framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, V|F },
{ "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V|F },
{ "round", "set rounding method for timestamps", OFFSET(rounding), AV_OPT_TYPE_INT, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
{ "zero", "round towards 0", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_ZERO }, 0, 0, V|F, "round" },
{ "inf", "round away from 0", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_INF }, 0, 0, V|F, "round" },
{ "down", "round towards -infty", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_DOWN }, 0, 0, V|F, "round" },
{ "up", "round towards +infty", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_UP }, 0, 0, V|F, "round" },
{ "near", "round to nearest", 0, AV_OPT_TYPE_CONST, { .i64 = AV_ROUND_NEAR_INF }, 0, 0, V|F, "round" },
{ "eof_action", "action performed for last frame", OFFSET(eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_ROUND }, 0, EOF_ACTION_NB-1, V|F, "eof_action" },
{ "round", "round similar to other frames", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ROUND }, 0, 0, V|F, "eof_action" },
{ "pass", "pass through last frame", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, 0, 0, V|F, "eof_action" },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define F
Definition: vf_fps.c:72
static int64_t start_time
Definition: ffplay.c:327
Round toward +infinity.
Definition: mathematics.h:83
Round away from zero.
Definition: mathematics.h:81
Round to nearest and halfway cases away from zero.
Definition: mathematics.h:84
#define V
Definition: vf_fps.c:71
#define OFFSET(x)
Definition: vf_fps.c:70
Round toward zero.
Definition: mathematics.h:80
offset must point to AVRational
Definition: opt.h:236
Round toward -infinity.
Definition: mathematics.h:82

Definition at line 73 of file vf_fps.c.

const AVFilterPad avfilter_vf_fps_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: vf_fps.c:215

Definition at line 314 of file vf_fps.c.

const AVFilterPad avfilter_vf_fps_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_props
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: vf_fps.c:137
static int config_props(AVFilterLink *link)
Definition: vf_fps.c:125

Definition at line 323 of file vf_fps.c.

AVFilter ff_vf_fps
Initial value:
= {
.name = "fps",
.description = NULL_IF_CONFIG_SMALL("Force constant framerate."),
.init = init,
.uninit = uninit,
.priv_size = sizeof(FPSContext),
.priv_class = &fps_class,
}
static av_cold int init(AVFilterContext *ctx)
Definition: vf_fps.c:90
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_fps.c:112
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad avfilter_vf_fps_inputs[]
Definition: vf_fps.c:314
static const AVFilterPad avfilter_vf_fps_outputs[]
Definition: vf_fps.c:323
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203

Definition at line 333 of file vf_fps.c.