mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user