summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-30 13:46:27 +0200
committerwm4 <wm4@nowhere>2016-09-30 13:46:27 +0200
commit2aba6972cf9e07fe2817ff072e5e82756d80d795 (patch)
tree81f1216b5a4f5bb961dfafbd5b7b0af0c1326ee3 /video/out/opengl/hwdec.c
parent2f1af04745191250cb833704ffa55a47e1ee563b (diff)
downloadmpv-2aba6972cf9e07fe2817ff072e5e82756d80d795.tar.bz2
mpv-2aba6972cf9e07fe2817ff072e5e82756d80d795.tar.xz
vo_opengl: allow hwdec interops to support multiple image formats
Diffstat (limited to 'video/out/opengl/hwdec.c')
-rw-r--r--video/out/opengl/hwdec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec.c b/video/out/opengl/hwdec.c
index 7d47e152b5..261931a8d4 100644
--- a/video/out/opengl/hwdec.c
+++ b/video/out/opengl/hwdec.c
@@ -116,3 +116,12 @@ void gl_hwdec_uninit(struct gl_hwdec *hwdec)
hwdec->driver->destroy(hwdec);
talloc_free(hwdec);
}
+
+bool gl_hwdec_test_format(struct gl_hwdec *hwdec, int imgfmt)
+{
+ if (!imgfmt)
+ return false;
+ if (hwdec->driver->test_format)
+ return hwdec->driver->test_format(hwdec, imgfmt);
+ return hwdec->driver->imgfmt == imgfmt;
+}