typedef struct AVFilterBufferRefAudioProps {
uint64_t channel_layout; ///< channel layout of audio buffer
int nb_samples; ///< number of audio samples
- int size; ///< audio buffer size
- uint32_t sample_rate; ///< audio buffer sample rate
+ int sample_rate; ///< audio buffer sample rate
int planar; ///< audio buffer - planar or packed
} AVFilterBufferRefAudioProps;
* Input audio pads only.
*/
AVFilterBufferRef *(*get_audio_buffer)(AVFilterLink *link, int perms,
- enum AVSampleFormat sample_fmt, int size,
- uint64_t channel_layout, int planar);
+ int nb_samples);
/**
* Callback called after the slices of a frame are completely sent. If
/** default handler for get_audio_buffer() for audio inputs */
AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms,
- enum AVSampleFormat sample_fmt, int size,
- uint64_t channel_layout, int planar);
+ int nb_samples);
/**
* A helper for query_formats() which sets all links to the same list of
/** get_audio_buffer() handler for filters which simply pass audio along */
AVFilterBufferRef *avfilter_null_get_audio_buffer(AVFilterLink *link, int perms,
- enum AVSampleFormat sample_fmt, int size,
- uint64_t channel_layout, int planar);
+ int nb_samples);
/**
* Filter definition. This defines the pads a filter contains, and all the
AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio
/* These two parameters apply only to audio */
uint64_t channel_layout; ///< channel layout of current buffer (see libavutil/audioconvert.h)
+#if FF_API_SAMPLERATE64
int64_t sample_rate; ///< samples per second
+#else
+ int sample_rate; ///< samples per second
+#endif
int format; ///< agreed upon media format
* @param link the output link to the filter from which the buffer will
* be requested
* @param perms the required access permissions
- * @param sample_fmt the format of each sample in the buffer to allocate
- * @param size the buffer size in bytes
- * @param channel_layout the number and type of channels per sample in the buffer to allocate
- * @param planar audio data layout - planar or packed
+ * @param nb_samples the number of samples per channel
* @return A reference to the samples. This must be unreferenced with
* avfilter_unref_buffer when you are finished with it.
*/
AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,
- enum AVSampleFormat sample_fmt, int size,
- uint64_t channel_layout, int planar);
+ int nb_samples);
+
+/**
+ * Create an audio buffer reference wrapped around an already
+ * allocated samples buffer.
+ *
+ * @param data pointers to the samples plane buffers
+ * @param linesize linesize for the samples plane buffers
+ * @param perms the required access permissions
+ * @param nb_samples number of samples per channel
+ * @param sample_fmt the format of each sample in the buffer to allocate
+ * @param channel_layout the channel layout of the buffer
+ */
+AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
+ int linesize,
+ int perms,
+ int nb_samples,
+ enum AVSampleFormat sample_fmt,
+ uint64_t channel_layout);
/**
* Request an input frame from the filter at the other end of the link.