{player,video}: remove references to obsolete opengl-cb API

This commit is contained in:
sfan5 2021-11-29 12:39:20 +01:00
parent 0bb15c7a13
commit 72915e8b76
9 changed files with 14 additions and 50 deletions

View File

@ -1677,9 +1677,7 @@ Video
slow hardware. This works only with the following VOs:
- ``gpu``: requires at least OpenGL 4.4 or Vulkan.
(In particular, this can't be made work with ``opengl-cb``, but the libmpv
render API has optional support.)
- ``libmpv``: The libmpv render API has optional support.
Using video filters of any kind that write to the image data (or output
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
FPS value.
For client API users using the render API (or the deprecated ``opengl-cb``
API), this option is interesting, because you can stop the render API
from limiting your FPS (see ``mpv_render_context_render()`` documentation).
This option is interesting for client API users using the render API
because you can stop it from limiting your FPS
(see ``mpv_render_context_render()`` documentation).
This applies only to audio timing modes (e.g. ``--video-sync=audio``). In
other modes (``--video-sync=display-...``), video timing relies on vsync

View File

@ -121,8 +121,7 @@ typedef struct mpv_opengl_init_params {
*/
void *get_proc_address_ctx;
/**
* This should not be used. It is deprecated and will be removed or ignored
* when the opengl_cb API is removed.
* This should not be used. It is deprecated and ignored.
*/
const char *extra_exts;
} mpv_opengl_init_params;

View File

@ -2181,10 +2181,9 @@ mp_client_api_acquire_render_context(struct mp_client_api *ca)
return res;
}
// Emulation of old opengl_cb API.
// Stubs of the old opengl_cb API.
#include "libmpv/opengl_cb.h"
#include "libmpv/render_gl.h"
void mpv_opengl_cb_set_update_callback(mpv_opengl_cb_context *ctx,
mpv_opengl_cb_update_fn callback,

View File

@ -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
// interfaces.
// Note: at least mpv_opengl_cb_uninit_gl() relies on being able to get
// rid of all references to the VO by destroying the VO chain. Thus,
// decoders not linked to vo_chain must not use the hwdec context.
// Note: We rely on being able to get rid of all references to the VO by
// destroying the VO chain. Thus, decoders not linked to vo_chain
// must not use the hwdec context.
if (track->vo_c)
parent = track->vo_c->filter->f;

View File

@ -47,8 +47,8 @@ struct ra {
};
// For passing through windowing system specific parameters and such. The
// names are always internal (except for legacy opengl-cb uses; the libmpv
// render API uses mpv_render_param_type and maps them to names internally).
// names are always internal (the libmpv render API uses mpv_render_param_type
// and maps them to names internally).
// For example, a name="x11" entry has a X11 display as (Display*)data.
struct ra_native_resource {
const char *name;

View File

@ -479,24 +479,6 @@ static const struct gl_functions gl_functions[] = {
{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",
.functions = (const struct gl_function[]) {

View File

@ -242,8 +242,6 @@ struct GL {
void (GLAPIENTRY *DebugMessageCallback)(MP_GLDEBUGPROC callback,
const void *userParam);
void *(GLAPIENTRY *MPGetNativeDisplay)(const char *name);
};
#endif /* MPLAYER_GL_COMMON_H */

View File

@ -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,
init_params->get_proc_address_ctx,
init_params->extra_exts, ctx->log);
NULL, ctx->log);
if (!p->gl->version && !p->gl->es) {
MP_FATAL(ctx, "OpenGL not initialized.\n");
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};
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
// 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
@ -63,18 +63,6 @@ static int init(struct libmpv_gpu_context *ctx, mpv_render_param *params)
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;
}

View File

@ -80,7 +80,7 @@ enum mp_voctrl {
// be updated and redrawn. Optional; emulated if not available.
VOCTRL_REDRAW_FRAME,
// Only used internally in vo_opengl_cb
// Only used internally in vo_libmpv
VOCTRL_PREINIT,
VOCTRL_UNINIT,
VOCTRL_RECONFIG,