History

lavfi/framepool: add audio support

Matthieu Bouron committed 9 years ago

Commit eb336811 parent b1f68f02 files · +144 −1Browse files

Showing the changes to libavfilter/framepool.h (1 of 2 files). Show all

Unified · Split

libavfilter/framepool.h+35−1
@@ -41,7 +41,7 @@ typedef struct FFFramePool FFFramePool; · 40 unmodified lines
4141 * @param height height of each frame in this pool
4242 * @param format format of each frame in this pool
4343 * @param align buffers alignement of each frame in this pool
44− * @return newly created frame pool on success, NULL on error.
44+ * @return newly created video frame pool on success, NULL on error.
4545 */
4646 FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size),
4747 int width,
@@ -49,6 +49,24 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size), · 1 unmodified line
4949 enum AVPixelFormat format,
5050 int align);
5151
52+/**
53+ * Allocate and initialize an audio frame pool.
54+ *
55+ * @param alloc a function that will be used to allocate new frame buffers when
56+ * the pool is empty. May be NULL, then the default allocator will be used
57+ * (av_buffer_alloc()).
58+ * @param channels channels of each frame in this pool
59+ * @param nb_samples number of samples of each frame in this pool
60+ * @param format format of each frame in this pool
61+ * @param align buffers alignement of each frame in this pool
62+ * @return newly created audio frame pool on success, NULL on error.
63+ */
64+FFFramePool *ff_frame_pool_audio_init(AVBufferRef* (*alloc)(int size),
65+ int channels,
66+ int samples,
67+ enum AVSampleFormat format,
68+ int align);
69+
5270 /**
5371 * Deallocate the frame pool. It is safe to call this function while
5472 * some of the allocated frame are still in use.
@@ -72,6 +90,22 @@ int ff_frame_pool_get_video_config(FFFramePool *pool, · 17 unmodified lines
7290 enum AVPixelFormat *format,
7391 int *align);
7492
93+/**
94+ * Get the audio frame pool configuration.
95+ *
96+ * @param channels channels of each frame in this pool
97+ * @param nb_samples number of samples of each frame in this pool
98+ * @param format format of each frame in this pool
99+ * @param align buffers alignement of each frame in this pool
100+ * @return 0 on success, a negative AVERROR otherwise.
101+ */
102+int ff_frame_pool_get_audio_config(FFFramePool *pool,
103+ int *channels,
104+ int *nb_samples,
105+ enum AVSampleFormat *format,
106+ int *align);
107+
108+
75109 /**
76110 * Allocate a new AVFrame, reussing old buffers from the pool when available.
77111 * This function may be called simultaneously from multiple threads.

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