Initialize the renderer state. Depending on the backend used, this will
access the underlying GPU API and initialize its own objects.
You must free the context with mpv_render_context_free(). Not doing so before
the mpv core is destroyed may result in memory leaks or crashes.
Currently, only at most 1 context can exists per mpv core (it represents the
main video output).
You should pass the following parameters:
- MPV_RENDER_PARAM_API_TYPE to select the underlying backend/GPU API.
- Backend-specific init parameter, like MPV_RENDER_PARAM_OPENGL_INIT_PARAMS.
- Setting MPV_RENDER_PARAM_ADVANCED_CONTROL and following its rules is
strongly recommended.
- If you want to use hwdec, possibly hwdec interop resources.
@param res set to the context (on success) or NULL (on failure). The value
is never read and always overwritten.
@param mpv handle used to get the core (the mpv_render_context won't depend
on this specific handle, only the core referenced by it)
@param params an array of parameters, terminated by type==0. It's left
unspecified what happens with unknown parameters. At least
MPV_RENDER_PARAM_API_TYPE is required, and most backends will
require another backend-specific parameter.
@return error code, including but not limited to:
Initialize the renderer state. Depending on the backend used, this will access the underlying GPU API and initialize its own objects.
You must free the context with mpv_render_context_free(). Not doing so before the mpv core is destroyed may result in memory leaks or crashes.
Currently, only at most 1 context can exists per mpv core (it represents the main video output).
You should pass the following parameters: - MPV_RENDER_PARAM_API_TYPE to select the underlying backend/GPU API. - Backend-specific init parameter, like MPV_RENDER_PARAM_OPENGL_INIT_PARAMS. - Setting MPV_RENDER_PARAM_ADVANCED_CONTROL and following its rules is strongly recommended. - If you want to use hwdec, possibly hwdec interop resources.
@param res set to the context (on success) or NULL (on failure). The value is never read and always overwritten. @param mpv handle used to get the core (the mpv_render_context won't depend on this specific handle, only the core referenced by it) @param params an array of parameters, terminated by type==0. It's left unspecified what happens with unknown parameters. At least MPV_RENDER_PARAM_API_TYPE is required, and most backends will require another backend-specific parameter. @return error code, including but not limited to: