Go to the documentation of this file.
50 if (
s->x +
s->w >
ctx->inputs[0]->w)
51 s->x =
ctx->inputs[0]->w -
s->w;
52 if (
s->y +
s->h >
ctx->inputs[0]->h)
53 s->y =
ctx->inputs[0]->h -
s->h;
58 if (
s->x >=
ctx->inputs[0]->w)
60 if (
s->y >=
ctx->inputs[0]->h)
64 s->w =
ctx->inputs[0]->w -
s->x;
66 s->h =
ctx->inputs[0]->h -
s->y;
68 if (
s->w >
ctx->inputs[0]->w)
69 s->w =
ctx->inputs[0]->w;
70 if (
s->h >
ctx->inputs[0]->h)
71 s->h =
ctx->inputs[0]->h;
89 ctx->inputs[1]->w =
s->w;
90 ctx->inputs[1]->h =
s->h;
102 ctx->outputs[0]->w =
ctx->inputs[0]->w;
103 ctx->outputs[0]->h =
ctx->inputs[0]->h;
104 ctx->outputs[1]->w =
s->w;
105 ctx->outputs[1]->h =
s->h;
125 for (
int i = 0;
i <
ctx->nb_outputs;
i++)
162 for (
int y = 0; y <
src->height; y++) {
163 memmove(dst->
data[0] + (
s->y + y) * dst->
linesize[0] +
s->x *
s->max_step[0],
164 src->data[0] + y *
src->linesize[0],
src->width *
s->max_step[0]);
167 for (
int i = 1;
i < 3;
i++) {
169 for (
int y = 0; y <
src->height; y++) {
170 memmove(dst->
data[
i] + ((
s->y + y) >>
s->vsub) * dst->
linesize[
i] + (
s->x >>
s->hsub) *
s->max_step[
i],
171 src->data[
i] + (y >>
s->vsub) *
src->linesize[
i], (
src->width >>
s->hsub) *
s->max_step[
i]);
177 for (
int y = 0; y <
src->height; y++) {
178 memmove(dst->
data[3] + (
s->y + y) * dst->
linesize[3] +
s->x *
s->max_step[3],
179 src->data[3] + y *
src->linesize[3],
src->width *
s->max_step[3]);
188 if (!
s->feed ||
ctx->is_disabled) {
195 if (
ret > 0 &&
ctx->is_disabled)
217 for (
int i = 1;
i < 3;
i ++) {
245 if (!
s->feed ||
ctx->is_disabled) {
248 if (!
ctx->is_disabled)
274 for (
size_t n = 0; n <
size; n++) {
312 #define OFFSET(x) offsetof(FeedbackContext, x)
313 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
314 #define TFLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM)
329 .priv_class = &feedback_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
static int config_input(AVFilterLink *inlink)
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
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
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.
#define FILTER_QUERY_FUNC(func)
static int query_formats(AVFilterContext *ctx)
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
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.
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
static int activate(AVFilterContext *ctx)
A filter pad used for either input or output.
static void adjust_parameters(AVFilterContext *ctx, FeedbackContext *s)
int av_fifo_read(AVFifo *f, void *buf, size_t nb_elems)
Read data from a FIFO.
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
#define FILTER_INPUTS(array)
const AVFilter ff_vf_feedback
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
size_t av_fifo_can_read(const AVFifo *f)
AVFILTER_DEFINE_CLASS(feedback)
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
static const AVOption feedback_options[]
static int config_output(AVFilterLink *outlink)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
AVFilterContext * src
source filter
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
#define i(width, name, range_min, range_max)
static const AVFilterPad inputs[]
const char * name
Pad name.
AVFifo * av_fifo_alloc2(size_t nb_elems, size_t elem_size, unsigned int flags)
Allocate and initialize an AVFifo with a given element size.
static av_cold int init(AVFilterContext *ctx)
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc)
Compute the max pixel step for each plane of an image with a format described by pixdesc.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define FILTER_OUTPUTS(array)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
void av_fifo_freep2(AVFifo **f)
Free an AVFifo and reset pointer to NULL.
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the ff_outlink_frame_wanted() function. If this function returns true
static const AVFilterPad outputs[]
static void adjust_pos(AVFilterContext *ctx, FeedbackContext *s)
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
#define AV_FIFO_FLAG_AUTO_GROW
Automatically resize the FIFO on writes, so that the data fits.
static av_cold void uninit(AVFilterContext *ctx)