[][src]Function libmpv_sys::mpv_render_context_set_update_callback

pub unsafe extern "C" fn mpv_render_context_set_update_callback(
    ctx: *mut mpv_render_context,
    callback: mpv_render_update_fn,
    callback_ctx: *mut c_void
)

Set the callback that notifies you when a new video frame is available, or if the video display configuration somehow changed and requires a redraw. Similar to mpv_set_wakeup_callback(), you must not call any mpv API from the callback, and all the other listed restrictions apply (such as not exiting the callback by throwing exceptions).

This can be called from any thread, except from an update callback. In case of the OpenGL backend, no OpenGL state or API is accessed.

Calling this will raise an update callback immediately.

@param callback callback(callback_ctx) is called if the frame should be redrawn @param callback_ctx opaque argument to the callback