22 #include "libavutil/buffer.h"
23 #include "libavutil/imgutils.h"
24 #include "libavutil/mem.h"
57 #if FF_API_AVFILTERBUFFER
62 AVFilterBuffer *pic =
av_mallocz(
sizeof(AVFilterBuffer));
63 AVFilterBufferRef *picref =
av_mallocz(
sizeof(AVFilterBufferRef));
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)
110 if (link->
dstpad->get_video_buffer)
111 ret = link->
dstpad->get_video_buffer(link, w, h);
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
This structure describes decoded (raw) audio or video data.
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.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
default handler for freeing audio/video buffer when there are no references left
void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
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.
AVFilterPad * dstpad
input pad on the dest filter
AVPixelFormat
Pixel format.
int format
agreed upon media format
Main libavfilter public API header.
AVFilterLink ** outputs
array of pointers to output links
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
AVFilterContext * dst
dest filter
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)
#define FF_DPRINTF_START(ctx, func)
#define AV_NOPTS_VALUE
Undefined timestamp value.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...