Go to the documentation of this file.
44 #define OFFSET(x) offsetof(SwapRectContext, x)
45 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
67 static const char *
const var_names[] = {
"w",
"h",
"a",
"n",
"t",
"pos",
"sar",
"dar",
NULL };
137 w = dw;
h = dh; x1[0] = dx1; y1[0] = dy1; x2[0] = dx2; y2[0] = dy2;
159 lh[0] = lh[3] =
inlink->h;
161 lw[0] = lw[3] =
inlink->w;
164 x1[0] = x1[3] = x1[0];
166 y1[0] = y1[3] = y1[0];
169 x2[0] = x2[3] = x2[0];
171 y2[0] = y2[3] = y2[0];
173 for (p = 0; p <
s->nb_planes; p++) {
174 if (ph[p] == ah[p] && pw[p] == aw[p]) {
175 uint8_t *
src = in->
data[p] + y1[p] * in->
linesize[p] + x1[p] *
s->pixsteps[p];
176 uint8_t *dst = in->
data[p] + y2[p] * in->
linesize[p] + x2[p] *
s->pixsteps[p];
178 for (y = 0; y < ph[p]; y++) {
179 memcpy(
s->temp,
src, pw[p] *
s->pixsteps[p]);
180 memmove(
src, dst, pw[p] *
s->pixsteps[p]);
181 memcpy(dst,
s->temp, pw[p] *
s->pixsteps[p]);
196 if (!
s->w || !
s->h ||
239 .priv_class = &swaprect_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 const AVFilterPad outputs[]
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
static av_cold void uninit(AVFilterContext *ctx)
const AVPixFmtDescriptor * desc
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).
#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 av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
A filter pad used for either input or output.
const AVFilter ff_vf_swaprect
#define AV_CEIL_RSHIFT(a, b)
int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
static double av_q2d(AVRational a)
Convert an AVRational to a double.
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
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 AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
AVFILTER_DEFINE_CLASS(swaprect)
#define av_malloc_array(a, b)
const char * name
Pad name.
static const AVOption swaprect_options[]
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.
static const char *const var_names[]
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define FILTER_OUTPUTS(array)
static const AVFilterPad inputs[]
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int config_input(AVFilterLink *inlink)
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.