#[repr(C)]
pub struct codec_c_interface { pub init: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE, inputSamplesPerSecond: u32, inputBitsPerSample: u8, inputChannels: u8, datacallback: AUDIO_ENCODER_ONENCODEDDATA, pContext: *mut c_void) -> AZACHR>, pub get_format_type: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE, buffer: *mut c_char, buffersize: *mut u64) -> AZACHR>, pub encode: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE, pBuffer: *const u8, bytesToWrite: size_t) -> AZACHR>, pub flush: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE) -> AZACHR>, pub endstream: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE) -> AZACHR>, pub destroy: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE) -> AZACHR>, }

Fields

init: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE, inputSamplesPerSecond: u32, inputBitsPerSample: u8, inputChannels: u8, datacallback: AUDIO_ENCODER_ONENCODEDDATA, pContext: *mut c_void) -> AZACHR>

@param codec codec Object returned by the codec_create call to be initialized @param inputSamplesPerSecond sample rate for the input audio @param inputBitsPerSample bits per sample for the input audio @param inputChannels number of channel of the input audio @param dataCallback An application defined callback. @param pContext A pointer to the application-defined callback context. @return A return code or zero if successful.

get_format_type: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE, buffer: *mut c_char, buffersize: *mut u64) -> AZACHR>

@param codec codec object returned by the codec_create call. @param buffer caller provided buffer to receive the value of the property @param buffersize buffer size. If buffer is passed as null it will return the required buffer size. @return A return code or zero if successful.

encode: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE, pBuffer: *const u8, bytesToWrite: size_t) -> AZACHR>

Encodes raw PCM data. @param codec codec object returned by the codec_create call. @param pBuffer The PCM data. @param bytesToWrite The length pBuffer. @return A return code or zero if successful.

flush: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE) -> AZACHR>

Flushes the encoder. @param codec codec object returned by the codec_create call. @return A return code or zero if successful.

endstream: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE) -> AZACHR>

Terminate the encoded stream immediately @param codec codec object returned by the codec_create call. @return A return code or zero if successful.

destroy: Option<unsafe extern "C" fn(codec: SPXCODECCTYPE) -> AZACHR>

Destroys the encoder. The codec object should not be used anymore after this call. @param codec codec object returned by the codec_create call. @return A return code or zero if successful.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.