40 unsigned int nb_frames;
44 sscanf(args,
" %3[^:]:%u:%u", in_out, &fade->
start_frame, &nb_frames) != 3) {
46 "Expected 3 arguments '(in|out):#:#':'%s'\n", args);
50 nb_frames = nb_frames ? nb_frames : 1;
52 if (!strcmp(in_out,
"in"))
54 else if (!strcmp(in_out,
"out")) {
59 "first argument must be 'in' or 'out':'%s'\n", in_out);
65 "type:%s start_frame:%d nb_frames:%d\n",
104 if (fade->
factor < UINT16_MAX) {
106 for (i = 0; i < h; i++) {
108 for (j = 0; j < inlink->
w * fade->
bpp; j++) {
112 *p = (*p * fade->
factor + 32768) >> 16;
117 if (outpic->
data[1] && outpic->
data[2]) {
119 for (plane = 1; plane < 3; plane++) {
120 for (i = 0; i < h; i++) {
122 for (j = 0; j < inlink->
w >> fade->
hsub; j++) {
126 *p = ((*p - 128) * fade->
factor + 8421367) >> 16;
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int linesize[8]
number of bytes per line
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static int config_props(AVFilterLink *inlink)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
#define AV_PERM_READ
can read from the buffer
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
A filter pad used for either input or output.
A link between two filters.
static int query_formats(AVFilterContext *ctx)
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
static void end_frame(AVFilterLink *inlink)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
void av_log(void *avcl, int level, const char *fmt,...)
AVFilterFormats * avfilter_make_format_list(const int *fmts)
Create a list of supported formats.
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB]
The array of all the pixel format descriptors.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
int w
agreed upon image width
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
int format
agreed upon media format
A reference to an AVFilterBuffer.
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVFilter avfilter_vf_fade
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
start_frame() handler for filters which simply pass video along
const char * name
filter name
packed RGB 8:8:8, 24bpp, BGRBGR...
AVFilterBufferRef * avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
get_video_buffer() handler for filters which simply pass video along
AVFilterLink ** outputs
array of pointers to output links
#define AV_PERM_PRESERVE
nobody else can overwrite the buffer
static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
#define AV_PERM_WRITE
can write to the buffer
packed RGB 8:8:8, 24bpp, RGBRGB...
AVFilterContext * dst
dest filter
uint8_t * data[8]
picture/audio data for each plane
AVFilterBufferRef * cur_buf