diff options
author | wm4 <wm4@nowhere> | 2015-01-22 17:47:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-22 18:18:23 +0100 |
commit | 74581a61064f56b170e555fa72d9cdca161d2307 (patch) | |
tree | 532223eaa3644b01501d443ebca9011ee12af963 /video/hwdec.h | |
parent | e9ac3fc3a1505c4db1773a2a24d35ac41ab69887 (diff) | |
download | mpv-74581a61064f56b170e555fa72d9cdca161d2307.tar.bz2 mpv-74581a61064f56b170e555fa72d9cdca161d2307.tar.xz |
video: handle hwdec screenshots differently
Instead of converting the hw surface to an image in the VO, provide a
generic way to convet hw surfaces, and use this in the screenshot code.
It's all relatively straightforward, except vdpau is being terrible. It
needs a huge chunk of new code, because copying back is not simple.
Diffstat (limited to 'video/hwdec.h')
-rw-r--r-- | video/hwdec.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/video/hwdec.h b/video/hwdec.h index 149cd81bae..a7d2cf8c4b 100644 --- a/video/hwdec.h +++ b/video/hwdec.h @@ -9,6 +9,15 @@ struct mp_hwdec_ctx { // API-specific, not needed by all backends. struct mp_vdpau_ctx *vdpau_ctx; struct mp_vaapi_ctx *vaapi_ctx; + + // Optional. + // Allocates a software image from the pool, downloads the hw image from + // mpi, and returns it. + // pool can be NULL (then just use straight allocation). + // Return NULL on error or if mpi has the wrong format. + struct mp_image *(*download_image)(struct mp_hwdec_ctx *ctx, + struct mp_image *mpi, + struct mp_image_pool *swpool); }; // Used to communicate hardware decoder API handles from VO to video decoder. |