Go to the documentation of this file.
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) {
92 int64_t dropped_pts =
frame->pts;
98 frame->pts = dropped_pts;
113 if (replace &&
frame) {
122 if (!drop || (drop &&
s->replace_frame))
124 if (!
s->replace_frame)
159 .
name =
"freezeframes",
162 .priv_class = &freezeframes_class,
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int config_output(AVFilterLink *outlink)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
A link between two filters.
static av_cold void uninit(AVFilterContext *ctx)
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter)
Forward the status on an output link to all input links.
static const AVFilterPad freezeframes_inputs[]
A filter pad used for either input or output.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But first
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
static const AVFilterPad outputs[]
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
static const AVOption freezeframes_options[]
Describe the class of an AVClass context structure.
AVFilter ff_vf_freezeframes
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
AVFilterContext * src
source filter
FF_FILTER_FORWARD_WANTED(outlink, inlink)
int w
agreed upon image width
const char * name
Pad name.
static int activate(AVFilterContext *ctx)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int h
agreed upon image height
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVFILTER_DEFINE_CLASS(freezeframes)
FF_FILTER_FORWARD_STATUS(inlink, outlink)
static const AVFilterPad freezeframes_outputs[]