mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
{player,video}: remove references to obsolete opengl-cb API
This commit is contained in:
@@ -1677,9 +1677,7 @@ Video
|
|||||||
slow hardware. This works only with the following VOs:
|
slow hardware. This works only with the following VOs:
|
||||||
|
|
||||||
- ``gpu``: requires at least OpenGL 4.4 or Vulkan.
|
- ``gpu``: requires at least OpenGL 4.4 or Vulkan.
|
||||||
|
- ``libmpv``: The libmpv render API has optional support.
|
||||||
(In particular, this can't be made work with ``opengl-cb``, but the libmpv
|
|
||||||
render API has optional support.)
|
|
||||||
|
|
||||||
Using video filters of any kind that write to the image data (or output
|
Using video filters of any kind that write to the image data (or output
|
||||||
newly allocated frames) will silently disable the DR code path.
|
newly allocated frames) will silently disable the DR code path.
|
||||||
@@ -6666,9 +6664,9 @@ Miscellaneous
|
|||||||
other hand, setting a too high value can reduce responsiveness with low
|
other hand, setting a too high value can reduce responsiveness with low
|
||||||
FPS value.
|
FPS value.
|
||||||
|
|
||||||
For client API users using the render API (or the deprecated ``opengl-cb``
|
This option is interesting for client API users using the render API
|
||||||
API), this option is interesting, because you can stop the render API
|
because you can stop it from limiting your FPS
|
||||||
from limiting your FPS (see ``mpv_render_context_render()`` documentation).
|
(see ``mpv_render_context_render()`` documentation).
|
||||||
|
|
||||||
This applies only to audio timing modes (e.g. ``--video-sync=audio``). In
|
This applies only to audio timing modes (e.g. ``--video-sync=audio``). In
|
||||||
other modes (``--video-sync=display-...``), video timing relies on vsync
|
other modes (``--video-sync=display-...``), video timing relies on vsync
|
||||||
|
|||||||
@@ -121,8 +121,7 @@ typedef struct mpv_opengl_init_params {
|
|||||||
*/
|
*/
|
||||||
void *get_proc_address_ctx;
|
void *get_proc_address_ctx;
|
||||||
/**
|
/**
|
||||||
* This should not be used. It is deprecated and will be removed or ignored
|
* This should not be used. It is deprecated and ignored.
|
||||||
* when the opengl_cb API is removed.
|
|
||||||
*/
|
*/
|
||||||
const char *extra_exts;
|
const char *extra_exts;
|
||||||
} mpv_opengl_init_params;
|
} mpv_opengl_init_params;
|
||||||
|
|||||||
@@ -2181,10 +2181,9 @@ mp_client_api_acquire_render_context(struct mp_client_api *ca)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emulation of old opengl_cb API.
|
// Stubs of the old opengl_cb API.
|
||||||
|
|
||||||
#include "libmpv/opengl_cb.h"
|
#include "libmpv/opengl_cb.h"
|
||||||
#include "libmpv/render_gl.h"
|
|
||||||
|
|
||||||
void mpv_opengl_cb_set_update_callback(mpv_opengl_cb_context *ctx,
|
void mpv_opengl_cb_set_update_callback(mpv_opengl_cb_context *ctx,
|
||||||
mpv_opengl_cb_update_fn callback,
|
mpv_opengl_cb_update_fn callback,
|
||||||
|
|||||||
@@ -176,9 +176,9 @@ int init_video_decoder(struct MPContext *mpctx, struct track *track)
|
|||||||
|
|
||||||
// If possible, set this as parent so the decoder gets the hwdec and DR
|
// If possible, set this as parent so the decoder gets the hwdec and DR
|
||||||
// interfaces.
|
// interfaces.
|
||||||
// Note: at least mpv_opengl_cb_uninit_gl() relies on being able to get
|
// Note: We rely on being able to get rid of all references to the VO by
|
||||||
// rid of all references to the VO by destroying the VO chain. Thus,
|
// destroying the VO chain. Thus, decoders not linked to vo_chain
|
||||||
// decoders not linked to vo_chain must not use the hwdec context.
|
// must not use the hwdec context.
|
||||||
if (track->vo_c)
|
if (track->vo_c)
|
||||||
parent = track->vo_c->filter->f;
|
parent = track->vo_c->filter->f;
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ struct ra {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// For passing through windowing system specific parameters and such. The
|
// For passing through windowing system specific parameters and such. The
|
||||||
// names are always internal (except for legacy opengl-cb uses; the libmpv
|
// names are always internal (the libmpv render API uses mpv_render_param_type
|
||||||
// render API uses mpv_render_param_type and maps them to names internally).
|
// and maps them to names internally).
|
||||||
// For example, a name="x11" entry has a X11 display as (Display*)data.
|
// For example, a name="x11" entry has a X11 display as (Display*)data.
|
||||||
struct ra_native_resource {
|
struct ra_native_resource {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|||||||
@@ -479,24 +479,6 @@ static const struct gl_functions gl_functions[] = {
|
|||||||
{0}
|
{0}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// These don't exist - they are for the sake of mpv internals, and libmpv
|
|
||||||
// interaction (see libmpv/opengl_cb.h).
|
|
||||||
// This is not used by the render API, only the deprecated opengl-cb API.
|
|
||||||
{
|
|
||||||
.extension = "GL_MP_MPGetNativeDisplay",
|
|
||||||
.functions = (const struct gl_function[]) {
|
|
||||||
DEF_FN(MPGetNativeDisplay),
|
|
||||||
{0}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// Same, but using the old name.
|
|
||||||
{
|
|
||||||
.extension = "GL_MP_D3D_interfaces",
|
|
||||||
.functions = (const struct gl_function[]) {
|
|
||||||
DEF_FN_NAME(MPGetNativeDisplay, "glMPGetD3DInterface"),
|
|
||||||
{0}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.extension = "GL_ANGLE_translated_shader_source",
|
.extension = "GL_ANGLE_translated_shader_source",
|
||||||
.functions = (const struct gl_function[]) {
|
.functions = (const struct gl_function[]) {
|
||||||
|
|||||||
@@ -242,8 +242,6 @@ struct GL {
|
|||||||
|
|
||||||
void (GLAPIENTRY *DebugMessageCallback)(MP_GLDEBUGPROC callback,
|
void (GLAPIENTRY *DebugMessageCallback)(MP_GLDEBUGPROC callback,
|
||||||
const void *userParam);
|
const void *userParam);
|
||||||
|
|
||||||
void *(GLAPIENTRY *MPGetNativeDisplay)(const char *name);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MPLAYER_GL_COMMON_H */
|
#endif /* MPLAYER_GL_COMMON_H */
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ static int init(struct libmpv_gpu_context *ctx, mpv_render_param *params)
|
|||||||
|
|
||||||
mpgl_load_functions2(p->gl, init_params->get_proc_address,
|
mpgl_load_functions2(p->gl, init_params->get_proc_address,
|
||||||
init_params->get_proc_address_ctx,
|
init_params->get_proc_address_ctx,
|
||||||
init_params->extra_exts, ctx->log);
|
NULL, ctx->log);
|
||||||
if (!p->gl->version && !p->gl->es) {
|
if (!p->gl->version && !p->gl->es) {
|
||||||
MP_FATAL(ctx, "OpenGL not initialized.\n");
|
MP_FATAL(ctx, "OpenGL not initialized.\n");
|
||||||
return MPV_ERROR_UNSUPPORTED;
|
return MPV_ERROR_UNSUPPORTED;
|
||||||
@@ -42,7 +42,7 @@ static int init(struct libmpv_gpu_context *ctx, mpv_render_param *params)
|
|||||||
|
|
||||||
static const struct ra_swapchain_fns empty_swapchain_fns = {0};
|
static const struct ra_swapchain_fns empty_swapchain_fns = {0};
|
||||||
struct ra_gl_ctx_params gl_params = {
|
struct ra_gl_ctx_params gl_params = {
|
||||||
// vo_opengl_cb is essentially like a gigantic external swapchain where
|
// vo_libmpv is essentially like a gigantic external swapchain where
|
||||||
// the user is in charge of presentation / swapping etc. But we don't
|
// the user is in charge of presentation / swapping etc. But we don't
|
||||||
// actually need to provide any of these functions, since we can just
|
// actually need to provide any of these functions, since we can just
|
||||||
// not call them to begin with - so just set it to an empty object to
|
// not call them to begin with - so just set it to an empty object to
|
||||||
@@ -63,18 +63,6 @@ static int init(struct libmpv_gpu_context *ctx, mpv_render_param *params)
|
|||||||
|
|
||||||
ctx->ra = p->ra_ctx->ra;
|
ctx->ra = p->ra_ctx->ra;
|
||||||
|
|
||||||
// Legacy API user loading for opengl-cb. Explicitly inactive for render API.
|
|
||||||
if (get_mpv_render_param(params, (mpv_render_param_type)-1, NULL) ==
|
|
||||||
ctx->global && p->gl->MPGetNativeDisplay)
|
|
||||||
{
|
|
||||||
void *x11 = p->gl->MPGetNativeDisplay("x11");
|
|
||||||
if (x11)
|
|
||||||
ra_add_native_resource(ctx->ra, "x11", x11);
|
|
||||||
void *wl = p->gl->MPGetNativeDisplay("wl");
|
|
||||||
if (wl)
|
|
||||||
ra_add_native_resource(ctx->ra, "wl", wl);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ enum mp_voctrl {
|
|||||||
// be updated and redrawn. Optional; emulated if not available.
|
// be updated and redrawn. Optional; emulated if not available.
|
||||||
VOCTRL_REDRAW_FRAME,
|
VOCTRL_REDRAW_FRAME,
|
||||||
|
|
||||||
// Only used internally in vo_opengl_cb
|
// Only used internally in vo_libmpv
|
||||||
VOCTRL_PREINIT,
|
VOCTRL_PREINIT,
|
||||||
VOCTRL_UNINIT,
|
VOCTRL_UNINIT,
|
||||||
VOCTRL_RECONFIG,
|
VOCTRL_RECONFIG,
|
||||||
|
|||||||
Reference in New Issue
Block a user