diff options
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 |