[][src]Function stainless_ffmpeg_sys::swr_convert_frame

pub unsafe extern "C" fn swr_convert_frame(
    swr: *mut SwrContext,
    output: *mut AVFrame,
    input: *const AVFrame
) -> c_int

Convert the samples in the input AVFrame and write them to the output AVFrame.

Input and output AVFrames must have channel_layout, sample_rate and format set.

If the output AVFrame does not have the data pointers allocated the nb_samples field will be set using av_frame_get_buffer() is called to allocate the frame.

The output AVFrame can be NULL or have fewer allocated samples than required. In this case, any remaining samples not written to the output will be added to an internal FIFO buffer, to be returned at the next call to this function or to swr_convert().

If converting sample rate, there may be data remaining in the internal resampling delay buffer. swr_get_delay() tells the number of remaining samples. To get this data as output, call this function or swr_convert() with NULL input.

If the SwrContext configuration does not match the output and input AVFrame settings the conversion does not take place and depending on which AVFrame is not matching AVERROR_OUTPUT_CHANGED, AVERROR_INPUT_CHANGED or the result of a bitwise-OR of them is returned.

@see swr_delay() @see swr_convert() @see swr_get_delay()

@param swr audio resample context @param output output AVFrame @param input input AVFrame @return 0 on success, AVERROR on failure or nonmatching configuration.