diff options
author | wm4 <wm4@nowhere> | 2017-08-10 17:48:33 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-10 21:24:31 +0200 |
commit | c6fafbffaca16959dfa2b4bf1eb97861ad66b5ef (patch) | |
tree | decef889171128c27f3a8cb2fcfb552f1b7297be /video/out/vo_opengl_cb.c | |
parent | b2fb3f1340ed7ceb9b3fc8ba4ddec107e3a41a13 (diff) | |
download | mpv-c6fafbffaca16959dfa2b4bf1eb97861ad66b5ef.tar.bz2 mpv-c6fafbffaca16959dfa2b4bf1eb97861ad66b5ef.tar.xz |
vo_opengl: separate hwdec context and mapping, port it to use ra
This does two separate rather intrusive things:
1. Make the hwdec context (which does initialization, provides the
device to the decoder, and other basic state) and frame mapping
(getting textures from a mp_image) separate. This is more
flexible, and you could map multiple images at once. It will
help removing some hwdec special-casing from video.c.
2. Switch all hwdec API use to ra. Of course all code is still
GL specific, but in theory it would be possible to support other
backends. The most important change is that the hwdec interop
returns ra objects, instead of anything GL specific. This removes
the last dependency on GL-specific header files from video.c.
I'm mixing these separate changes because both requires essentially
rewriting all the glue code, so better do them at once. For the same
reason, this change isn't done incrementally.
hwdec_ios.m is untested, since I can't test it. Apart from superficial
mistakes, this also requires dealing with Apple's texture format
fuckups: they force you to use GL_LUMINANCE[_ALPHA] instead of GL_RED
and GL_RG. We also need to report the correct format via ra_tex to
the renderer, which is done by find_la_variant(). It's unknown whether
this works correctly.
hwdec_rpi.c as well as vo_rpi.c are still broken. (I need to pull my
RPI out of a dusty pile of devices and cables, so, later.)
Diffstat (limited to 'video/out/vo_opengl_cb.c')
-rw-r--r-- | video/out/vo_opengl_cb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c index d9289d16f6..4a9b60d4ff 100644 --- a/video/out/vo_opengl_cb.c +++ b/video/out/vo_opengl_cb.c @@ -90,7 +90,7 @@ struct mpv_opengl_cb_context { GL *gl; struct ra *ra; struct gl_video *renderer; - struct gl_hwdec *hwdec; + struct ra_hwdec *hwdec; struct m_config_cache *vo_opts_cache; struct mp_vo_opts *vo_opts; }; @@ -182,7 +182,7 @@ int mpv_opengl_cb_init_gl(struct mpv_opengl_cb_context *ctx, const char *exts, m_config_cache_update(ctx->vo_opts_cache); ctx->hwdec_devs = hwdec_devices_create(); - ctx->hwdec = gl_hwdec_load(ctx->log, ctx->gl, ctx->global, + ctx->hwdec = ra_hwdec_load(ctx->log, ctx->ra, ctx->global, ctx->hwdec_devs, ctx->vo_opts->gl_hwdec_interop); gl_video_set_hwdec(ctx->renderer, ctx->hwdec); @@ -223,7 +223,7 @@ int mpv_opengl_cb_uninit_gl(struct mpv_opengl_cb_context *ctx) gl_video_uninit(ctx->renderer); ctx->renderer = NULL; - gl_hwdec_uninit(ctx->hwdec); + ra_hwdec_uninit(ctx->hwdec); ctx->hwdec = NULL; hwdec_devices_destroy(ctx->hwdec_devs); ctx->hwdec_devs = NULL; |