[][src]Function libmpv_sys::mpv_render_context_render

pub unsafe extern "C" fn mpv_render_context_render(
    ctx: *mut mpv_render_context,
    params: *mut mpv_render_param
) -> c_int

Render video.

Typically renders the video to a target surface provided via mpv_render_param (the details depend on the backend in use). Options like "panscan" are applied to determine which part of the video should be visible and how the video should be scaled. You can change these options at runtime by using the mpv property API.

The renderer will reconfigure itself every time the target surface configuration (such as size) is changed.

This function implicitly pulls a video frame from the internal queue and renders it. If no new frame is available, the previous frame is redrawn. The update callback set with mpv_render_context_set_update_callback() notifies you when a new frame was added. The details potentially depend on the backends and the provided parameters.

Generally, libmpv will invoke your update callback some time before the video frame should be shown, and then lets this function block until the supposed display time. This will limit your rendering to video FPS. You can prevent this by setting the "video-timing-offset" global option to 0. (This applies only to "audio" video sync mode.)

You should pass the following parameters:

  • Backend-specific target object, such as MPV_RENDER_PARAM_OPENGL_FBO.
  • Possibly transformations, such as MPV_RENDER_PARAM_FLIP_Y.

@param ctx a valid render context @param params an array of parameters, terminated by type==0. Which parameters are required depends on the backend. It's left unspecified what happens with unknown parameters. @return error code