1 /*
2 * Copyright 2007 Bobby Bingham
3 * Copyright Stefano Sabatini <stefasab gmail com>
4 * Copyright Vitor Sessak <vitor1001 gmail com>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #include <string.h>
24 #include <stdio.h>
25
30
34
35 #define BUFFER_ALIGN 32
36
37
39 {
41 }
42
44 {
45 int pool_width = 0;
46 int pool_height = 0;
47 int pool_align = 0;
49
55 } else {
57 &pool_width, &pool_height,
58 &pool_format, &pool_align) < 0) {
60 }
61
62 if (pool_width != w || pool_height != h ||
64
70 }
71 }
72
74 }
75
77 {
79
81
84
85 if (!ret)
87
88 return ret;
89 }
This structure describes decoded (raw) audio or video data.
void ff_video_frame_pool_uninit(FFVideoFramePool **pool)
Deallocate the video frame pool.
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
FFVideoFramePool * ff_video_frame_pool_init(AVBufferRef *(*alloc)(int size), int width, int height, enum AVPixelFormat format, int align)
Allocate and initialize a video frame pool.
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
int ff_video_frame_pool_get_config(FFVideoFramePool *pool, int *width, int *height, enum AVPixelFormat *format, int *align)
Get the video frame pool configuration.
A link between two filters.
AVFrame * ff_video_frame_pool_get(FFVideoFramePool *pool)
Allocate a new AVFrame, reussing old buffers from the pool when available.
simple assert() macros that are a bit more flexible than ISO C assert().
#define FF_TPRINTF_START(ctx, func)
int format
agreed upon media format
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)
void * video_frame_pool
A pointer to a FFVideoFramePool struct.
AVBufferRef * av_buffer_allocz(int size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
refcounted data buffer API
AVFilterLink ** outputs
array of pointers to output links
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
AVFilterContext * dst
dest filter
AVPixelFormat
Pixel format.