summaryrefslogtreecommitdiffstats
path: root/video/out/gl_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-05 22:06:48 +0100
committerwm4 <wm4@nowhere>2013-11-05 22:28:15 +0100
commitdb6a4eec0a9a58a342147e526154c46f19e7c303 (patch)
tree673b058f5423592b2a2297a54f54921f3645e42c /video/out/gl_common.c
parent5cca9143abdbf413641dc8a657ca869a9425b5a9 (diff)
downloadmpv-db6a4eec0a9a58a342147e526154c46f19e7c303.tar.bz2
mpv-db6a4eec0a9a58a342147e526154c46f19e7c303.tar.xz
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.)
Diffstat (limited to 'video/out/gl_common.c')
-rw-r--r--video/out/gl_common.c21
1 files changed, 21 insertions, 0 deletions
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
};