FFmpeg
|
#include "framepool.h"
#include "libavutil/avassert.h"
#include "libavutil/avutil.h"
#include "libavutil/buffer.h"
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/imgutils_internal.h"
#include "libavutil/mem.h"
#include "libavutil/pixfmt.h"
Go to the source code of this file.
Data Structures | |
struct | FFFramePool |
Frame pool. More... | |
Functions | |
FFFramePool * | ff_frame_pool_video_init (AVBufferRef *(*alloc)(size_t size), int width, int height, enum AVPixelFormat format, int align) |
Allocate and initialize a video frame pool. More... | |
FFFramePool * | ff_frame_pool_audio_init (AVBufferRef *(*alloc)(size_t size), int channels, int nb_samples, enum AVSampleFormat format, int align) |
Allocate and initialize an audio frame pool. More... | |
int | ff_frame_pool_get_video_config (FFFramePool *pool, int *width, int *height, enum AVPixelFormat *format, int *align) |
Get the video frame pool configuration. More... | |
int | ff_frame_pool_get_audio_config (FFFramePool *pool, int *channels, int *nb_samples, enum AVSampleFormat *format, int *align) |
Get the audio frame pool configuration. More... | |
AVFrame * | ff_frame_pool_get (FFFramePool *pool) |
Allocate a new AVFrame, reussing old buffers from the pool when available. More... | |
void | ff_frame_pool_uninit (FFFramePool **pool) |
Deallocate the frame pool. More... | |
FFFramePool* ff_frame_pool_video_init | ( | AVBufferRef *(*)(size_t size) | alloc, |
int | width, | ||
int | height, | ||
enum AVPixelFormat | format, | ||
int | align | ||
) |
Allocate and initialize a video frame pool.
alloc | a function that will be used to allocate new frame buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). |
width | width of each frame in this pool |
height | height of each frame in this pool |
format | format of each frame in this pool |
align | buffers alignement of each frame in this pool |
Definition at line 52 of file framepool.c.
Referenced by ff_default_get_video_buffer2().
FFFramePool* ff_frame_pool_audio_init | ( | AVBufferRef *(*)(size_t size) | alloc, |
int | channels, | ||
int | samples, | ||
enum AVSampleFormat | format, | ||
int | align | ||
) |
Allocate and initialize an audio frame pool.
alloc | a function that will be used to allocate new frame buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). |
channels | channels of each frame in this pool |
nb_samples | number of samples of each frame in this pool |
format | format of each frame in this pool |
align | buffers alignement of each frame in this pool |
Definition at line 115 of file framepool.c.
Referenced by ff_default_get_audio_buffer().
int ff_frame_pool_get_video_config | ( | FFFramePool * | pool, |
int * | width, | ||
int * | height, | ||
enum AVPixelFormat * | format, | ||
int * | align | ||
) |
Get the video frame pool configuration.
width | width of each frame in this pool |
height | height of each frame in this pool |
format | format of each frame in this pool |
align | buffers alignement of each frame in this pool |
Definition at line 153 of file framepool.c.
Referenced by ff_default_get_video_buffer2().
int ff_frame_pool_get_audio_config | ( | FFFramePool * | pool, |
int * | channels, | ||
int * | nb_samples, | ||
enum AVSampleFormat * | format, | ||
int * | align | ||
) |
Get the audio frame pool configuration.
channels | channels of each frame in this pool |
nb_samples | number of samples of each frame in this pool |
format | format of each frame in this pool |
align | buffers alignement of each frame in this pool |
Definition at line 172 of file framepool.c.
Referenced by ff_default_get_audio_buffer().
AVFrame* ff_frame_pool_get | ( | FFFramePool * | pool | ) |
Allocate a new AVFrame, reussing old buffers from the pool when available.
This function may be called simultaneously from multiple threads.
Definition at line 191 of file framepool.c.
Referenced by ff_default_get_audio_buffer(), and ff_default_get_video_buffer2().
void ff_frame_pool_uninit | ( | FFFramePool ** | pool | ) |
Deallocate the frame pool.
It is safe to call this function while some of the allocated frame are still in use.
pool | pointer to the frame pool to be freed. It will be set to NULL. |
Definition at line 279 of file framepool.c.
Referenced by ff_default_get_audio_buffer(), ff_default_get_video_buffer2(), ff_frame_pool_audio_init(), ff_frame_pool_video_init(), and link_free().