Go to the documentation of this file.
63 if (
s->is_packed_rgb) {
66 for (y = 0; y < main_buf->
height; y++) {
68 pout = main_buf->
data[0] + y * main_buf->
linesize[0] +
s->rgba_map[
A];
69 for (x = 0; x < main_buf->
width; x++) {
76 const int main_linesize = main_buf->
linesize[
A];
77 const int alpha_linesize = alpha_buf->
linesize[
Y];
79 alpha_buf->
data[
Y], alpha_linesize,
80 FFMIN(main_linesize, alpha_linesize), alpha_buf->
height);
111 &
ctx->inputs[1]->outcfg.formats);
131 if (mainlink->
w != alphalink->
w || mainlink->
h != alphalink->
h) {
133 "Input frame sizes do not match (%dx%d vs %dx%d).\n",
134 mainlink->
w, mainlink->
h,
135 alphalink->
w, alphalink->
h);
142 outlink->
w = mainlink->
w;
143 outlink->
h = mainlink->
h;
190 .
name =
"alphamerge",
192 "input into the alpha channel of the first input."),
193 .preinit = alphamerge_framesync_preinit,
195 .priv_class = &alphamerge_class,
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
AVPixelFormat
Pixel format.
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
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
static const AVFilterPad alphamerge_inputs[]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
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
This structure describes decoded (raw) audio or video data.
static const AVFilterPad alphamerge_outputs[]
#define FILTER_QUERY_FUNC(func)
static int config_output(AVFilterLink *outlink)
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
const char * name
Filter name.
A link between two filters.
static int query_formats(AVFilterContext *ctx)
static int config_input_main(AVFilterLink *inlink)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
static av_cold int init(AVFilterContext *ctx)
static int do_alphamerge(FFFrameSync *fs)
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
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,...
#define FILTER_INPUTS(array)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Describe the class of an AVClass context structure.
#define fs(width, name, subs,...)
static av_cold void uninit(AVFilterContext *ctx)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
AVFilterContext * src
source filter
FRAMESYNC_DEFINE_CLASS(alphamerge, AlphaMergeContext, fs)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
int w
agreed upon image width
const char * name
Pad name.
const AVFilter ff_vf_alphamerge
int h
agreed upon image height
static const AVOption alphamerge_options[]
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
#define FILTER_OUTPUTS(array)
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
int ff_framesync_dualinput_get_writable(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
Same as ff_framesync_dualinput_get(), but make sure that f0 is writable.
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
static int activate(AVFilterContext *ctx)