History

lavfi/framepool: rename FFVideoFramePool to FFFramePool

Matthieu Bouron committed 10 years ago

Commit b1f68f01 parent e71b8115 files · +41 −41Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t