diff options
author | wm4 <wm4@nowhere> | 2016-09-30 13:46:27 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-30 13:46:27 +0200 |
commit | 2aba6972cf9e07fe2817ff072e5e82756d80d795 (patch) | |
tree | 81f1216b5a4f5bb961dfafbd5b7b0af0c1326ee3 /video/out/opengl/hwdec.h | |
parent | 2f1af04745191250cb833704ffa55a47e1ee563b (diff) | |
download | mpv-2aba6972cf9e07fe2817ff072e5e82756d80d795.tar.bz2 mpv-2aba6972cf9e07fe2817ff072e5e82756d80d795.tar.xz |
vo_opengl: allow hwdec interops to support multiple image formats
Diffstat (limited to 'video/out/opengl/hwdec.h')
-rw-r--r-- | video/out/opengl/hwdec.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec.h b/video/out/opengl/hwdec.h index ce59b67e58..6a1bb98bff 100644 --- a/video/out/opengl/hwdec.h +++ b/video/out/opengl/hwdec.h @@ -38,6 +38,7 @@ struct gl_hwdec_driver { // Used to explicitly request a specific API. enum hwdec_type api; // The hardware surface IMGFMT_ that must be passed to map_image later. + // If the test_format callback is set, this field is ignored! int imgfmt; // Create the hwdec device. It must add it to hw->devs, if applicable. int (*create)(struct gl_hwdec *hw); @@ -56,6 +57,9 @@ struct gl_hwdec_driver { void (*destroy)(struct gl_hwdec *hw); + // Optional callback for checking input format support. + bool (*test_format)(struct gl_hwdec *hw, int imgfmt); + // The following functions provide an alternative API. Each gl_hwdec_driver // must have either map_frame or overlay_frame set (not both or none), and // if overlay_frame is set, it operates in overlay mode. In this mode, @@ -79,4 +83,6 @@ struct gl_hwdec *gl_hwdec_load_api(struct mp_log *log, GL *gl, void gl_hwdec_uninit(struct gl_hwdec *hwdec); +bool gl_hwdec_test_format(struct gl_hwdec *hwdec, int imgfmt); + #endif |