Function gifski::c_api::gifski_set_progress_callback
source · #[no_mangle]
pub unsafe extern "C" fn gifski_set_progress_callback(
handle: *const GifskiHandle,
cb: unsafe extern "C" fn(_: *mut c_void) -> c_int,
user_data: *mut c_void
) -> GifskiError
Expand description
Get a callback for frame processed, and abort processing if desired.
The callback is called once per input frame, even if the encoder decides to skip some frames.
It gets arbitrary pointer (user_data
) as an argument. user_data
can be NULL
.
The callback must return 1
to continue processing, or 0
to abort.
The callback must be thread-safe (it will be called from another thread).
It must remain valid at all times, until gifski_finish
completes.
This function must be called before gifski_set_file_output()
to take effect.