[][src]Constant libmpv_sys::mpv_render_param_type_MPV_RENDER_PARAM_ADVANCED_CONTROL

pub const mpv_render_param_type_MPV_RENDER_PARAM_ADVANCED_CONTROL: mpv_render_param_type = 10;

Better control about rendering and enabling some advanced features. Valid for mpv_render_context_create().

This conflates multiple requirements the API user promises to abide if this option is enabled:

  • The API user's render thread, which is calling the mpv_render_*() functions, never waits for the core. Otherwise deadlocks can happen. See "Threading" section.
  • The callback set with mpv_render_context_set_update_callback() can now be called even if there is no new frame. The API user should call the mpv_render_context_update() function, and interpret the return value for whether a new frame should be rendered.
  • Correct functionality is impossible if the update callback is not set, or not set soon enough after mpv_render_context_create() (the core can block while waiting for you to call mpv_render_context_update(), and if the update callback is not correctly set, it will deadlock, or block for too long).

In general, setting this option will enable the following features (and possibly more):

  • "Direct rendering", which means the player decodes directly to a texture, which saves a copy per video frame ("vd-lavc-dr" option needs to be enabled, and the rendering backend as well as the underlying GPU API/driver needs to have support for it).
  • Rendering screenshots with the GPU API if supported by the backend (instead of using a suboptimal software fallback via libswscale).

Warning: do not just add this without reading the "Threading" section above, and then wondering that deadlocks happen. The requirements are tricky. But also note that even if advanced control is disabled, not adhering to the rules will lead to playback problems. Enabling advanced controls simply makes violating these rules fatal.

Type: int*: 0 for disable (default), 1 for enable