summaryrefslogtreecommitdiff
path: root/libavfilter/framepool.h
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2017-01-03 17:44:07 +0100
committerMatthieu Bouron <mbouron@gopro.com>2017-01-12 10:22:52 +0100
commiteb3368178ed9e1b3401e1f71ceebcb510fbbdf52 (patch)
treebde98f32335cc66cf9ed2a4e9da77c2978a9b753 /libavfilter/framepool.h
parentb1f68f00b12a3706f8aabf68ea714eaecc23b295 (diff)
lavfi/framepool: add audio support
Diffstat (limited to 'libavfilter/framepool.h')
-rw-r--r--libavfilter/framepool.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/libavfilter/framepool.h b/libavfilter/framepool.h
index 4824824894..e5560e4c6e 100644
--- a/libavfilter/framepool.h
+++ b/libavfilter/framepool.h
@@ -41,7 +41,7 @@ typedef struct FFFramePool FFFramePool;
* @param height height 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
- * @return newly created frame pool on success, NULL on error.
+ * @return newly created video frame pool on success, NULL on error.
*/
FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size),
int width,
@@ -50,6 +50,24 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size),
int align);
/**
+ * Allocate and initialize an audio frame pool.
+ *
+ * @param 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()).
+ * @param channels channels of each frame in this pool
+ * @param nb_samples number of samples 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
+ * @return newly created audio frame pool on success, NULL on error.
+ */
+FFFramePool *ff_frame_pool_audio_init(AVBufferRef* (*alloc)(int size),
+ int channels,
+ int samples,
+ enum AVSampleFormat format,
+ int align);
+
+/**
* Deallocate the frame pool. It is safe to call this function while
* some of the allocated frame are still in use.
*
@@ -73,6 +91,22 @@ int ff_frame_pool_get_video_config(FFFramePool *pool,
int *align);
/**
+ * Get the audio frame pool configuration.
+ *
+ * @param channels channels of each frame in this pool
+ * @param nb_samples number of samples 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
+ * @return 0 on success, a negative AVERROR otherwise.
+ */
+int ff_frame_pool_get_audio_config(FFFramePool *pool,
+ int *channels,
+ int *nb_samples,
+ enum AVSampleFormat *format,
+ int *align);
+
+
+/**
* Allocate a new AVFrame, reussing old buffers from the pool when available.
* This function may be called simultaneously from multiple threads.
*