Go to the documentation of this file.
65 "output will be wrong!\n",
69 if (
s->is_packed_rgb) {
72 for (y = 0; y < main_buf->
height; y++) {
74 pout = main_buf->
data[0] + y * main_buf->
linesize[0] +
s->rgba_map[
A];
75 for (x = 0; x < main_buf->
width; x++) {
82 const int main_linesize = main_buf->
linesize[
A];
83 const int alpha_linesize = alpha_buf->
linesize[
Y];
85 alpha_buf->
data[
Y], alpha_linesize,
86 FFMIN(main_linesize, alpha_linesize), alpha_buf->
height);
117 &
ctx->inputs[1]->outcfg.formats);
137 if (mainlink->
w != alphalink->
w || mainlink->
h != alphalink->
h) {
139 "Input frame sizes do not match (%dx%d vs %dx%d).\n",
140 mainlink->
w, mainlink->
h,
141 alphalink->
w, alphalink->
h);
148 outlink->
w = mainlink->
w;
149 outlink->
h = mainlink->
h;
196 .
name =
"alphamerge",
198 "input into the alpha channel of the first input."),
199 .preinit = alphamerge_framesync_preinit,
201 .priv_class = &alphamerge_class,
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
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...
const char * av_color_range_name(enum AVColorRange range)
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.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
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)