Function rsmpeg::ffi::av_samples_alloc[][src]

pub unsafe extern "C" fn av_samples_alloc(
    audio_data: *mut *mut u8,
    linesize: *mut i32,
    nb_channels: i32,
    nb_samples: i32,
    sample_fmt: i32,
    align: i32
) -> i32
Expand description

Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly. The allocated samples buffer can be freed by using av_freep(&audio_data[0]) Allocated data will be initialized to silence.

@see enum AVSampleFormat The documentation for AVSampleFormat describes the data layout.

@param[out] audio_data array to be filled with the pointer for each channel @param[out] linesize aligned size for audio buffer(s), may be NULL @param nb_channels number of audio channels @param nb_samples number of samples per channel @param align buffer size alignment (0 = default, 1 = no alignment) @return >=0 on success or a negative error code on failure @todo return the size of the allocated buffer in case of success at the next bump @see av_samples_fill_arrays() @see av_samples_alloc_array_and_samples()