26 #include "libavutil/avassert.h"
27 #include "libavutil/buffer.h"
28 #include "libavutil/imgutils.h"
29 #include "libavutil/mem.h"
62 #if FF_API_AVFILTERBUFFER
67 AVFilterBuffer *pic =
av_mallocz(
sizeof(AVFilterBuffer));
68 AVFilterBufferRef *picref =
av_mallocz(
sizeof(AVFilterBufferRef));
74 picref->buf->free = ff_avfilter_default_free_buffer;
75 if (!(picref->video =
av_mallocz(
sizeof(AVFilterBufferRefVideoProps))))
78 pic->w = picref->video->w = w;
79 pic->h = picref->video->h = h;
82 picref->perms = perms | AV_PERM_READ;
86 pic->format = picref->format = format;
88 memcpy(pic->data, data, 4*
sizeof(data[0]));
89 memcpy(pic->linesize, linesize, 4*
sizeof(linesize[0]));
90 memcpy(picref->data, pic->data,
sizeof(picref->data));
91 memcpy(picref->linesize, pic->linesize,
sizeof(picref->linesize));
93 pic-> extended_data = pic->data;
94 picref->extended_data = picref->data;
101 if (picref && picref->video)
This structure describes decoded (raw) audio or video data.
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for 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.
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
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(). ...
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define FF_TPRINTF_START(ctx, func)
AVFilterPad * dstpad
input pad on the dest filter
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVPixelFormat
Pixel format.
#define av_unused
Disable warnings about deprecated features This is useful for sections of code kept for backward comp...
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...
AVFrame *(* get_video_buffer)(AVFilterLink *link, int w, int h)
Callback function to get a video buffer.
void ff_tlog_link(void *ctx, AVFilterLink *link, int end)
AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t *const data[4], const int linesize[4], int perms, int w, int h, enum AVPixelFormat format)
AVFilterContext * dst
dest filter
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
#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 ...