@@ -179,7 +179,7 @@ void avfilter_link_free(AVFilterLink **link) | |||||
av_frame_free(&(*link)->partial_buf); | av_frame_free(&(*link)->partial_buf); | ||||
ff_framequeue_free(&(*link)->fifo); | ff_framequeue_free(&(*link)->fifo); | ||||
ff_video_frame_pool_uninit((FFVideoFramePool**)&(*link)->video_frame_pool); | |||||
ff_frame_pool_uninit((FFFramePool**)&(*link)->frame_pool); | |||||
av_freep(link); | av_freep(link); | ||||
} | } | ||||
@@ -531,9 +531,9 @@ struct AVFilterLink { | |||||
int64_t frame_count_in, frame_count_out; | int64_t frame_count_in, frame_count_out; | ||||
/** | /** | ||||
* A pointer to a FFVideoFramePool struct. | |||||
* A pointer to a FFFramePool struct. | |||||
*/ | */ | ||||
void *video_frame_pool; | |||||
void *frame_pool; | |||||
/** | /** | ||||
* True if a frame is currently wanted on the output of this filter. | * True if a frame is currently wanted on the output of this filter. | ||||
@@ -26,7 +26,7 @@ | |||||
#include "libavutil/mem.h" | #include "libavutil/mem.h" | ||||
#include "libavutil/pixfmt.h" | #include "libavutil/pixfmt.h" | ||||
struct FFVideoFramePool { | |||||
struct FFFramePool { | |||||
int width; | int width; | ||||
int height; | int height; | ||||
@@ -37,20 +37,20 @@ struct FFVideoFramePool { | |||||
}; | }; | ||||
FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), | |||||
int width, | |||||
int height, | |||||
enum AVPixelFormat format, | |||||
int align) | |||||
FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size), | |||||
int width, | |||||
int height, | |||||
enum AVPixelFormat format, | |||||
int align) | |||||
{ | { | ||||
int i, ret; | int i, ret; | ||||
FFVideoFramePool *pool; | |||||
FFFramePool *pool; | |||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); | ||||
if (!desc) | if (!desc) | ||||
return NULL; | return NULL; | ||||
pool = av_mallocz(sizeof(FFVideoFramePool)); | |||||
pool = av_mallocz(sizeof(FFFramePool)); | |||||
if (!pool) | if (!pool) | ||||
return NULL; | return NULL; | ||||
@@ -100,11 +100,11 @@ FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), | |||||
return pool; | return pool; | ||||
fail: | fail: | ||||
ff_video_frame_pool_uninit(&pool); | |||||
ff_frame_pool_uninit(&pool); | |||||
return NULL; | return NULL; | ||||
} | } | ||||
int ff_video_frame_pool_get_config(FFVideoFramePool *pool, | |||||
int ff_frame_pool_get_video_config(FFFramePool *pool, | |||||
int *width, | int *width, | ||||
int *height, | int *height, | ||||
enum AVPixelFormat *format, | enum AVPixelFormat *format, | ||||
@@ -122,7 +122,7 @@ int ff_video_frame_pool_get_config(FFVideoFramePool *pool, | |||||
} | } | ||||
AVFrame *ff_video_frame_pool_get(FFVideoFramePool *pool) | |||||
AVFrame *ff_frame_pool_get(FFFramePool *pool) | |||||
{ | { | ||||
int i; | int i; | ||||
AVFrame *frame; | AVFrame *frame; | ||||
@@ -174,7 +174,7 @@ fail: | |||||
return NULL; | return NULL; | ||||
} | } | ||||
void ff_video_frame_pool_uninit(FFVideoFramePool **pool) | |||||
void ff_frame_pool_uninit(FFFramePool **pool) | |||||
{ | { | ||||
int i; | int i; | ||||
@@ -25,11 +25,11 @@ | |||||
#include "libavutil/frame.h" | #include "libavutil/frame.h" | ||||
/** | /** | ||||
* Video frame pool. This structure is opaque and not meant to be accessed | |||||
* directly. It is allocated with ff_video_frame_pool_init() and freed with | |||||
* ff_video_frame_pool_uninit(). | |||||
* Frame pool. This structure is opaque and not meant to be accessed | |||||
* directly. It is allocated with ff_frame_pool_init() and freed with | |||||
* ff_frame_pool_uninit(). | |||||
*/ | */ | ||||
typedef struct FFVideoFramePool FFVideoFramePool; | |||||
typedef struct FFFramePool FFFramePool; | |||||
/** | /** | ||||
* Allocate and initialize a video frame pool. | * Allocate and initialize a video frame pool. | ||||
@@ -41,21 +41,21 @@ typedef struct FFVideoFramePool FFVideoFramePool; | |||||
* @param height height of each frame in this pool | * @param height height of each frame in this pool | ||||
* @param format format of each frame in this pool | * @param format format of each frame in this pool | ||||
* @param align buffers alignement of each frame in this pool | * @param align buffers alignement of each frame in this pool | ||||
* @return newly created video frame pool on success, NULL on error. | |||||
* @return newly created frame pool on success, NULL on error. | |||||
*/ | */ | ||||
FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), | |||||
int width, | |||||
int height, | |||||
enum AVPixelFormat format, | |||||
int align); | |||||
FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size), | |||||
int width, | |||||
int height, | |||||
enum AVPixelFormat format, | |||||
int align); | |||||
/** | /** | ||||
* Deallocate the video frame pool. It is safe to call this function while | |||||
* some of the allocated video frame are still in use. | |||||
* Deallocate the frame pool. It is safe to call this function while | |||||
* some of the allocated frame are still in use. | |||||
* | * | ||||
* @param pool pointer to the video frame pool to be freed. It will be set to NULL. | |||||
* @param pool pointer to the frame pool to be freed. It will be set to NULL. | |||||
*/ | */ | ||||
void ff_video_frame_pool_uninit(FFVideoFramePool **pool); | |||||
void ff_frame_pool_uninit(FFFramePool **pool); | |||||
/** | /** | ||||
* Get the video frame pool configuration. | * Get the video frame pool configuration. | ||||
@@ -66,7 +66,7 @@ void ff_video_frame_pool_uninit(FFVideoFramePool **pool); | |||||
* @param align buffers alignement of each frame in this pool | * @param align buffers alignement of each frame in this pool | ||||
* @return 0 on success, a negative AVERROR otherwise. | * @return 0 on success, a negative AVERROR otherwise. | ||||
*/ | */ | ||||
int ff_video_frame_pool_get_config(FFVideoFramePool *pool, | |||||
int ff_frame_pool_get_video_config(FFFramePool *pool, | |||||
int *width, | int *width, | ||||
int *height, | int *height, | ||||
enum AVPixelFormat *format, | enum AVPixelFormat *format, | ||||
@@ -78,7 +78,7 @@ int ff_video_frame_pool_get_config(FFVideoFramePool *pool, | |||||
* | * | ||||
* @return a new AVFrame on success, NULL on error. | * @return a new AVFrame on success, NULL on error. | ||||
*/ | */ | ||||
AVFrame *ff_video_frame_pool_get(FFVideoFramePool *pool); | |||||
AVFrame *ff_frame_pool_get(FFFramePool *pool); | |||||
#endif /* AVFILTER_FRAMEPOOL_H */ | #endif /* AVFILTER_FRAMEPOOL_H */ |
@@ -47,13 +47,13 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) | |||||
int pool_align = 0; | int pool_align = 0; | ||||
enum AVPixelFormat pool_format = AV_PIX_FMT_NONE; | enum AVPixelFormat pool_format = AV_PIX_FMT_NONE; | ||||
if (!link->video_frame_pool) { | |||||
link->video_frame_pool = ff_video_frame_pool_init(av_buffer_allocz, w, h, | |||||
link->format, BUFFER_ALIGN); | |||||
if (!link->video_frame_pool) | |||||
if (!link->frame_pool) { | |||||
link->frame_pool = ff_frame_pool_video_init(av_buffer_allocz, w, h, | |||||
link->format, BUFFER_ALIGN); | |||||
if (!link->frame_pool) | |||||
return NULL; | return NULL; | ||||
} else { | } else { | ||||
if (ff_video_frame_pool_get_config(link->video_frame_pool, | |||||
if (ff_frame_pool_get_video_config(link->frame_pool, | |||||
&pool_width, &pool_height, | &pool_width, &pool_height, | ||||
&pool_format, &pool_align) < 0) { | &pool_format, &pool_align) < 0) { | ||||
return NULL; | return NULL; | ||||
@@ -62,15 +62,15 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) | |||||
if (pool_width != w || pool_height != h || | if (pool_width != w || pool_height != h || | ||||
pool_format != link->format || pool_align != BUFFER_ALIGN) { | pool_format != link->format || pool_align != BUFFER_ALIGN) { | ||||
ff_video_frame_pool_uninit((FFVideoFramePool **)&link->video_frame_pool); | |||||
link->video_frame_pool = ff_video_frame_pool_init(av_buffer_allocz, w, h, | |||||
link->format, BUFFER_ALIGN); | |||||
if (!link->video_frame_pool) | |||||
ff_frame_pool_uninit((FFFramePool **)&link->frame_pool); | |||||
link->frame_pool = ff_frame_pool_video_init(av_buffer_allocz, w, h, | |||||
link->format, BUFFER_ALIGN); | |||||
if (!link->frame_pool) | |||||
return NULL; | return NULL; | ||||
} | } | ||||
} | } | ||||
return ff_video_frame_pool_get(link->video_frame_pool); | |||||
return ff_frame_pool_get(link->frame_pool); | |||||
} | } | ||||
AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h) | AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h) | ||||