57 #if FF_API_AVFILTERBUFFER
62 AVFilterBuffer *pic =
av_mallocz(
sizeof(AVFilterBuffer));
63 AVFilterBufferRef *picref =
av_mallocz(
sizeof(AVFilterBufferRef));
69 picref->buf->free = ff_avfilter_default_free_buffer;
70 if (!(picref->video =
av_mallocz(
sizeof(AVFilterBufferRefVideoProps))))
73 pic->w = picref->video->w = w;
74 pic->h = picref->video->h = h;
77 picref->perms = perms | AV_PERM_READ;
81 pic->format = picref->format = format;
83 memcpy(pic->data, data, 4*
sizeof(data[0]));
84 memcpy(pic->linesize, linesize, 4*
sizeof(linesize[0]));
85 memcpy(picref->data, pic->data,
sizeof(picref->data));
86 memcpy(picref->linesize, pic->linesize,
sizeof(picref->linesize));
88 pic-> extended_data = pic->data;
89 picref->extended_data = picref->data;
96 if (picref && picref->video)
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
This structure describes decoded (raw) audio or video data.
Main libavfilter public API header.
memory handling functions
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
AVFilterPad * dstpad
input pad on the dest filter
void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
A link between two filters.
int width
width and height of the video frame
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int format
agreed upon media format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
AVFrame *(* get_video_buffer)(AVFilterLink *link, int w, int h)
Callback function to get a video buffer.
refcounted data buffer API
AVFilterLink ** outputs
array of pointers to output links
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms, int w, int h, enum AVPixelFormat format)
AVFilterContext * dst
dest filter
#define FF_DPRINTF_START(ctx, func)
AVPixelFormat
Pixel format.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AV_NOPTS_VALUE
Undefined timestamp value.