39 #define OFFSET(x) offsetof(FreezeFramesContext, x)
40 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
57 if (sourcelink->
w != replacelink->
w || sourcelink->
h != replacelink->
h) {
59 "Input frame sizes do not match (%dx%d vs %dx%d).\n",
60 sourcelink->
w, sourcelink->
h,
61 replacelink->
w, replacelink->
h);
65 outlink->
w = sourcelink->
w;
66 outlink->
h = sourcelink->
h;
79 int drop =
ctx->inputs[0]->frame_count_out >=
s->first &&
80 ctx->inputs[0]->frame_count_out <=
s->last;
81 int replace =
ctx->inputs[1]->frame_count_out ==
s->replace;
86 if (drop &&
s->replace_frame) {
113 if (replace &&
frame) {
122 if (!drop || (drop &&
s->replace_frame))
124 if (!
s->replace_frame)
159 .
name =
"freezeframes",
162 .priv_class = &freezeframes_class,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
simple assert() macros that are a bit more flexible than ISO C assert().
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Main libavfilter public API header.
common internal and external API header
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
#define FF_FILTER_FORWARD_STATUS(inlink, outlink)
Acknowledge the status on an input link and forward it to an output link.
#define FFERROR_NOT_READY
Filters implementation helper functions.
#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter)
Forward the status on an output link to all input links.
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Describe the class of an AVClass context structure.
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
AVFILTER_DEFINE_CLASS(freezeframes)
static const AVFilterPad freezeframes_inputs[]
AVFilter ff_vf_freezeframes
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static const AVOption freezeframes_options[]
static const AVFilterPad freezeframes_outputs[]
static int config_output(AVFilterLink *outlink)