mpv.render

Undocumented in source.

Members

Aliases

mpv_render_context_flag
alias mpv_render_context_flag = mpv_render_update_flag
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
mpv_render_update_fn
alias mpv_render_update_fn = void function(void* cb_ctx)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Enums

mpv_render_frame_info_flag
enum mpv_render_frame_info_flag

Flags used in mpv_render_frame_info.flags. Each value represents a bit in it.

mpv_render_param_type
enum mpv_render_param_type

Parameters for mpv_render_param (which is used in a few places such as mpv_render_context_create().

mpv_render_update_flag
enum mpv_render_update_flag

Flags returned by mpv_render_context_update(). Each value represents a bit in the function's return value.

Functions

mpv_render_context_create
int mpv_render_context_create(mpv_render_context** res, mpv_handle* mpv, mpv_render_param* params)

Initialize the renderer state. Depending on the backend used, this will access the underlying GPU API and initialize its own objects.

mpv_render_context_free
void mpv_render_context_free(mpv_render_context* ctx)

Destroy the mpv renderer state.

mpv_render_context_get_info
int mpv_render_context_get_info(mpv_render_context* ctx, mpv_render_param param)

Retrieve information from the render context. This is NOT a counterpart to mpv_render_context_set_parameter(), because you generally can't read parameters set with it, and this function is not meant for this purpose. Instead, this is for communicating information from the renderer back to the user. See mpv_render_param_type; entries which support this function explicitly mention it, and for other entries you can assume it will fail.

mpv_render_context_render
int mpv_render_context_render(mpv_render_context* ctx, mpv_render_param* params)

Render video.

mpv_render_context_report_swap
void mpv_render_context_report_swap(mpv_render_context* ctx)

Tell the renderer that a frame was flipped at the given time. This is optional, but can help the player to achieve better timing.

mpv_render_context_set_parameter
int mpv_render_context_set_parameter(mpv_render_context* ctx, mpv_render_param param)

Attempt to change a single parameter. Not all backends and parameter types support all kinds of changes.

mpv_render_context_set_update_callback
void mpv_render_context_set_update_callback(mpv_render_context* ctx, mpv_render_update_fn callback, void* callback_ctx)

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).

mpv_render_context_update
ulong mpv_render_context_update(mpv_render_context* ctx)

The API user is supposed to call this when the update callback was invoked (like all mpv_render_* functions, this has to happen on the render thread, and _not_ from the update callback itself).

Manifest constants

MPV_RENDER_API_TYPE_OPENGL
enum MPV_RENDER_API_TYPE_OPENGL;

Predefined values for MPV_RENDER_PARAM_API_TYPE.

MPV_RENDER_PARAM_DRM_OSD_SIZE
enum MPV_RENDER_PARAM_DRM_OSD_SIZE;

For backwards compatibility with the old naming of MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE

Structs

mpv_render_context
struct mpv_render_context

Opaque context, returned by mpv_render_context_create().

mpv_render_frame_info
struct mpv_render_frame_info

Information about the next video frame that will be rendered. Can be retrieved with MPV_RENDER_PARAM_NEXT_FRAME_INFO.

mpv_render_param
struct mpv_render_param

Used to pass arbitrary parameters to some mpv_render_* functions. The meaning of the data parameter is determined by the type, and each MPV_RENDER_PARAM_* documents what type the value must point to.

Meta