Membrane Element: FFmpeg SWResample v0.1.0 Membrane.Element.FFmpeg.SWResample.Converter.Native View Source
This module provides nativly implemented converter utilizing library swresample
Link to this section Summary
Functions
Function that converts data according to a native handle
Function creating native handler of converter
Link to this section Types
Link to this section Functions
Function that converts data according to a native handle.
Expects the native handle, created with create/6 and binary data to convert.
Returns converted samples.
When converter is doing sample rate conversion, which requires “future” samples,
samples will be buffered internally. In order to flush them,
invoke convert/2
with an empty binary.
WARNING: Converter won’t flush anything until it has enough samples for conversion to happen, so you won’t be able to resample only a couple of samples. The actual threshold depends on conversion parameters.
Function creating native handler of converter.
Expects sample format (encoded as integer, using
Membrane.Caps.Audio.Raw.Format.serialize/1
), sample rate and number of channels
for input and output data, respectively.
Currently supported formats are u8, s16le, s32le, f32le, f64le and s24le (input only)
Returns {:ok, native_handle} or {:error, reason}.