Function avcodec_fill_audio_frame
pub unsafe extern "C" fn avcodec_fill_audio_frame(
frame: *mut AVFrame,
nb_channels: i32,
sample_fmt: i32,
buf: *const u8,
buf_size: i32,
align: i32,
) -> i32
Expand description
Fill AVFrame audio data and linesize pointers.
The buffer buf must be a preallocated buffer with a size big enough to contain the specified samples amount. The filled AVFrame data pointers will point to this buffer.
AVFrame extended_data channel pointers are allocated if necessary for planar audio.
@param frame the AVFrame frame->nb_samples must be set prior to calling the function. This function fills in frame->data, frame->extended_data, frame->linesize[0]. @param nb_channels channel count @param sample_fmt sample format @param buf buffer to use for frame data @param buf_size size of buffer @param align plane size sample alignment (0 = default) @return >=0 on success, negative error code on failure @todo return the size in bytes required to store the samples in case of success, at the next libavutil bump