66 "output will be wrong!\n",
70 if (
s->is_packed_rgb) {
73 for (y = 0; y < main_buf->
height; y++) {
75 pout = main_buf->
data[0] + y * main_buf->
linesize[0] +
s->rgba_map[
A];
76 for (x = 0; x < main_buf->
width; x++) {
83 const int main_linesize = main_buf->
linesize[
A];
84 const int alpha_linesize = alpha_buf->
linesize[
Y];
86 alpha_buf->
data[
Y], alpha_linesize,
87 FFMIN(main_linesize, alpha_linesize), alpha_buf->
height);
124 &cfg_out[0]->alpha_modes);
150 if (mainlink->
w != alphalink->
w || mainlink->
h != alphalink->
h) {
152 "Input frame sizes do not match (%dx%d vs %dx%d).\n",
153 mainlink->
w, mainlink->
h,
154 alphalink->
w, alphalink->
h);
161 outlink->
w = mainlink->
w;
162 outlink->
h = mainlink->
h;
209 .p.name =
"alphamerge",
211 "input into the alpha channel of the first input."),
212 .p.priv_class = &alphamerge_class,
214 .preinit = alphamerge_framesync_preinit,
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
const FFFilter ff_vf_alphamerge
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
#define fs(width, name, subs,...)
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
int(* init)(AVBSFContext *ctx)
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
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.
#define FRAMESYNC_DEFINE_CLASS(name, context, field)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
static FilterLink * ff_filter_link(AVFilterLink *link)
#define FILTER_QUERY_FUNC2(func)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const char * av_color_range_name(enum AVColorRange range)
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVALPHA_MODE_STRAIGHT
Alpha channel is independent of color values.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Describe the class of an AVClass context structure.
void * priv
private data for use by the filter
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
enum AVAlphaMode alpha_mode
alpha mode (for videos with an alpha channel)
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVAlphaMode alpha_mode
Indicates how the alpha channel of the video is to be handled.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
static const AVFilterPad alphamerge_inputs[]
static int do_alphamerge(FFFrameSync *fs)
static const AVOption alphamerge_options[]
static int config_input_main(AVFilterLink *inlink)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad alphamerge_outputs[]
static int config_output(AVFilterLink *outlink)