From 571e697a7c557d10bcc9130915c431829981d877 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 4 Nov 2013 00:00:18 +0100 Subject: vo_opengl: add infrastructure for hardware decoding OpenGL interop Most hardware decoding APIs provide some OpenGL interop. This allows using vo_opengl, without having to read the video data back from GPU. This requires adding a backend for each hardware decoding API. (Each backend is an entry in gl_hwdec_vaglx[].) The backends expose video data as a set of OpenGL textures. Add infrastructure to support this. The next commit will add support for VA-API. --- video/out/gl_common.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'video/out/gl_common.c') diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 10e806dc8d..9482f9de55 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -1008,3 +1008,7 @@ void mp_log_source(struct mp_log *log, int lev, const char *src) src = next; } } + +const struct gl_hwdec_driver *mpgl_hwdec_drivers[] = { + NULL +}; -- cgit v1.2.3 From 2d58fb3b8e7e87a939220f50a51294f8efdc51e1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 4 Nov 2013 00:02:21 +0100 Subject: vo_opengl: add support for VA-API OpenGL interop VA-API's OpenGL/GLX interop is pretty bad and perhaps slow (renders a X11 pixmap into a FBO, and has to go over X11, probably involves one or more copies), and this code serves more as an example, rather than for serious use. On the other hand, this might be work much better than vo_vaapi, even if slightly slower. --- video/out/gl_common.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/out/gl_common.c') diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 9482f9de55..3216b0037e 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -1009,6 +1009,11 @@ void mp_log_source(struct mp_log *log, int lev, const char *src) } } +extern const struct gl_hwdec_driver gl_hwdec_vaglx; + const struct gl_hwdec_driver *mpgl_hwdec_drivers[] = { +#if CONFIG_VAAPI_GLX + &gl_hwdec_vaglx, +#endif NULL }; -- cgit v1.2.3