From db6a4eec0a9a58a342147e526154c46f19e7c303 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 5 Nov 2013 22:06:48 +0100 Subject: vo_opengl: support for vdpau hardware decoding This uses vdpau OpenGL interop to convert a vdpau surface to a texture. Note that this is a bit weak and primitive. Deinterlacing (or any other form of vdpau postprocessing) is not supported. vo_opengl chroma scaling and chroma sample position are not supported. Internally, the vdpau video surfaces are converted to a RGBA surface first, because using the video surfaces directly is too complicated. (These surfaces are always split into separate fields, and the vo_opengl core expects progressive frames or frames with weaved fields.) --- video/out/gl_common.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'video/out/gl_common.c') diff --git a/video/out/gl_common.c b/video/out/gl_common.c index f3e38a2171..0477bb39c9 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -445,6 +445,23 @@ struct gl_functions gl_functions[] = { {0} }, }, + // For gl_hwdec_vdpau.c + // http://www.opengl.org/registry/specs/NV/vdpau_interop.txt + { + .extension = "GL_NV_vdpau_interop", + .provides = MPGL_CAP_VDPAU, + .functions = (struct gl_function[]) { + // (only functions needed by us) + DEF_FN(VDPAUInitNV), + DEF_FN(VDPAUFiniNV), + DEF_FN(VDPAURegisterOutputSurfaceNV), + DEF_FN(VDPAUUnregisterSurfaceNV), + DEF_FN(VDPAUSurfaceAccessNV), + DEF_FN(VDPAUMapSurfacesNV), + DEF_FN(VDPAUUnmapSurfacesNV), + {0} + }, + }, }; #undef FN_OFFS @@ -1010,10 +1027,14 @@ void mp_log_source(struct mp_log *log, int lev, const char *src) } extern const struct gl_hwdec_driver gl_hwdec_vaglx; +extern const struct gl_hwdec_driver gl_hwdec_vdpau; const struct gl_hwdec_driver *mpgl_hwdec_drivers[] = { #if HAVE_VAAPI_GLX &gl_hwdec_vaglx, +#endif +#if HAVE_VDPAU_GL_X11 + &gl_hwdec_vdpau, #endif NULL }; -- cgit v1.2.3