Unified · Split
| @@ -179,7 +179,7 @@ void avfilter_link_free(AVFilterLink **link) · 178 unmodified lines | ||
| 179 | 179 | |
| 180 | 180 | av_frame_free(&(*link)->partial_buf); |
| 181 | 181 | ff_framequeue_free(&(*link)->fifo); |
| 182 | − ff_video_frame_pool_uninit((FFVideoFramePool**)&(*link)->video_frame_pool); | |
| 182 | + ff_frame_pool_uninit((FFFramePool**)&(*link)->frame_pool); | |
| 183 | 183 | |
| 184 | 184 | av_freep(link); |
| 185 | 185 | } |
| @@ -531,9 +531,9 @@ struct AVFilterLink { · 530 unmodified lines | ||
| 531 | 531 | int64_t frame_count_in, frame_count_out; |
| 532 | 532 | |
| 533 | 533 | /** |
| 534 | − * A pointer to a FFVideoFramePool struct. | |
| 534 | + * A pointer to a FFFramePool struct. | |
| 535 | 535 | */ |
| 536 | − void *video_frame_pool; | |
| 536 | + void *frame_pool; | |
| 537 | 537 | |
| 538 | 538 | /** |
| 539 | 539 | * True if a frame is currently wanted on the output of this filter. |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | #include "libavutil/mem.h" |
| 27 | 27 | #include "libavutil/pixfmt.h" |
| 28 | 28 | |
| 29 | −struct FFVideoFramePool { | |
| 29 | +struct FFFramePool { | |
| 30 | 30 | |
| 31 | 31 | int width; |
| 32 | 32 | int height; |
| @@ -37,20 +37,20 @@ struct FFVideoFramePool { · 4 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | }; |
| 39 | 39 | |
| 40 | −FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), | |
| 41 | − int width, | |
| 42 | − int height, | |
| 43 | − enum AVPixelFormat format, | |
| 44 | − int align) | |
| 40 | +FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size), | |
| 41 | + int width, | |
| 42 | + int height, | |
| 43 | + enum AVPixelFormat format, | |
| 44 | + int align) | |
| 45 | 45 | { |
| 46 | 46 | int i, ret; |
| 47 | − FFVideoFramePool *pool; | |
| 47 | + FFFramePool *pool; | |
| 48 | 48 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); |
| 49 | 49 | |
| 50 | 50 | if (!desc) |
| 51 | 51 | return NULL; |
| 52 | 52 | |
| 53 | − pool = av_mallocz(sizeof(FFVideoFramePool)); | |
| 53 | + pool = av_mallocz(sizeof(FFFramePool)); | |
| 54 | 54 | if (!pool) |
| 55 | 55 | return NULL; |
| 56 | 56 | |
| @@ -100,11 +100,11 @@ FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), · 43 unmodified lines | ||
| 100 | 100 | return pool; |
| 101 | 101 | |
| 102 | 102 | fail: |
| 103 | − ff_video_frame_pool_uninit(&pool); | |
| 103 | + ff_frame_pool_uninit(&pool); | |
| 104 | 104 | return NULL; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | −int ff_video_frame_pool_get_config(FFVideoFramePool *pool, | |
| 107 | +int ff_frame_pool_get_video_config(FFFramePool *pool, | |
| 108 | 108 | int *width, |
| 109 | 109 | int *height, |
| 110 | 110 | enum AVPixelFormat *format, |
| @@ -122,7 +122,7 @@ int ff_video_frame_pool_get_config(FFVideoFramePool *pool, · 11 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | −AVFrame *ff_video_frame_pool_get(FFVideoFramePool *pool) | |
| 125 | +AVFrame *ff_frame_pool_get(FFFramePool *pool) | |
| 126 | 126 | { |
| 127 | 127 | int i; |
| 128 | 128 | AVFrame *frame; |
| @@ -174,7 +174,7 @@ fail: · 45 unmodified lines | ||
| 174 | 174 | return NULL; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | −void ff_video_frame_pool_uninit(FFVideoFramePool **pool) | |
| 177 | +void ff_frame_pool_uninit(FFFramePool **pool) | |
| 178 | 178 | { |
| 179 | 179 | int i; |
| 180 | 180 | |
| @@ -25,11 +25,11 @@ · 24 unmodified lines | ||
| 25 | 25 | #include "libavutil/frame.h" |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | − * Video frame pool. This structure is opaque and not meant to be accessed | |
| 29 | − * directly. It is allocated with ff_video_frame_pool_init() and freed with | |
| 30 | − * ff_video_frame_pool_uninit(). | |
| 28 | + * Frame pool. This structure is opaque and not meant to be accessed | |
| 29 | + * directly. It is allocated with ff_frame_pool_init() and freed with | |
| 30 | + * ff_frame_pool_uninit(). | |
| 31 | 31 | */ |
| 32 | −typedef struct FFVideoFramePool FFVideoFramePool; | |
| 32 | +typedef struct FFFramePool FFFramePool; | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Allocate and initialize a video frame pool. |
| @@ -41,21 +41,21 @@ typedef struct FFVideoFramePool FFVideoFramePool; · 5 unmodified lines | ||
| 41 | 41 | * @param height height of each frame in this pool |
| 42 | 42 | * @param format format of each frame in this pool |
| 43 | 43 | * @param align buffers alignement of each frame in this pool |
| 44 | − * @return newly created video frame pool on success, NULL on error. | |
| 44 | + * @return newly created frame pool on success, NULL on error. | |
| 45 | 45 | */ |
| 46 | −FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), | |
| 47 | − int width, | |
| 48 | − int height, | |
| 49 | − enum AVPixelFormat format, | |
| 50 | − int align); | |
| 46 | +FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size), | |
| 47 | + int width, | |
| 48 | + int height, | |
| 49 | + enum AVPixelFormat format, | |
| 50 | + int align); | |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | − * Deallocate the video frame pool. It is safe to call this function while | |
| 54 | − * some of the allocated video frame are still in use. | |
| 53 | + * Deallocate the frame pool. It is safe to call this function while | |
| 54 | + * some of the allocated frame are still in use. | |
| 55 | 55 | * |
| 56 | − * @param pool pointer to the video frame pool to be freed. It will be set to NULL. | |
| 56 | + * @param pool pointer to the frame pool to be freed. It will be set to NULL. | |
| 57 | 57 | */ |
| 58 | −void ff_video_frame_pool_uninit(FFVideoFramePool **pool); | |
| 58 | +void ff_frame_pool_uninit(FFFramePool **pool); | |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Get the video frame pool configuration. |
| @@ -66,7 +66,7 @@ void ff_video_frame_pool_uninit(FFVideoFramePool **pool); · 4 unmodified lines | ||
| 66 | 66 | * @param align buffers alignement of each frame in this pool |
| 67 | 67 | * @return 0 on success, a negative AVERROR otherwise. |
| 68 | 68 | */ |
| 69 | −int ff_video_frame_pool_get_config(FFVideoFramePool *pool, | |
| 69 | +int ff_frame_pool_get_video_config(FFFramePool *pool, | |
| 70 | 70 | int *width, |
| 71 | 71 | int *height, |
| 72 | 72 | enum AVPixelFormat *format, |
| @@ -78,7 +78,7 @@ int ff_video_frame_pool_get_config(FFVideoFramePool *pool, · 5 unmodified lines | ||
| 78 | 78 | * |
| 79 | 79 | * @return a new AVFrame on success, NULL on error. |
| 80 | 80 | */ |
| 81 | −AVFrame *ff_video_frame_pool_get(FFVideoFramePool *pool); | |
| 81 | +AVFrame *ff_frame_pool_get(FFFramePool *pool); | |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | #endif /* AVFILTER_FRAMEPOOL_H */ |
| @@ -47,13 +47,13 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) · 46 unmodified lines | ||
| 47 | 47 | int pool_align = 0; |
| 48 | 48 | enum AVPixelFormat pool_format = AV_PIX_FMT_NONE; |
| 49 | 49 | |
| 50 | − if (!link->video_frame_pool) { | |
| 51 | − link->video_frame_pool = ff_video_frame_pool_init(av_buffer_allocz, w, h, | |
| 52 | − link->format, BUFFER_ALIGN); | |
| 53 | − if (!link->video_frame_pool) | |
| 50 | + if (!link->frame_pool) { | |
| 51 | + link->frame_pool = ff_frame_pool_video_init(av_buffer_allocz, w, h, | |
| 52 | + link->format, BUFFER_ALIGN); | |
| 53 | + if (!link->frame_pool) | |
| 54 | 54 | return NULL; |
| 55 | 55 | } else { |
| 56 | − if (ff_video_frame_pool_get_config(link->video_frame_pool, | |
| 56 | + if (ff_frame_pool_get_video_config(link->frame_pool, | |
| 57 | 57 | &pool_width, &pool_height, |
| 58 | 58 | &pool_format, &pool_align) < 0) { |
| 59 | 59 | return NULL; |
| @@ -62,15 +62,15 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) · 2 unmodified lines | ||
| 62 | 62 | if (pool_width != w || pool_height != h || |
| 63 | 63 | pool_format != link->format || pool_align != BUFFER_ALIGN) { |
| 64 | 64 | |
| 65 | − ff_video_frame_pool_uninit((FFVideoFramePool **)&link->video_frame_pool); | |
| 66 | − link->video_frame_pool = ff_video_frame_pool_init(av_buffer_allocz, w, h, | |
| 67 | − link->format, BUFFER_ALIGN); | |
| 68 | − if (!link->video_frame_pool) | |
| 65 | + ff_frame_pool_uninit((FFFramePool **)&link->frame_pool); | |
| 66 | + link->frame_pool = ff_frame_pool_video_init(av_buffer_allocz, w, h, | |
| 67 | + link->format, BUFFER_ALIGN); | |
| 68 | + if (!link->frame_pool) | |
| 69 | 69 | return NULL; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | − return ff_video_frame_pool_get(link->video_frame_pool); | |
| 73 | + return ff_frame_pool_get(link->frame_pool); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h) |