From 016eab220971ecd3d4509bb4936cb579e9b4a7c3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 Apr 2016 23:13:24 +0200 Subject: d3d11va, dxva2: simplify decoder selection In particular, this moves the depth test to common code. Should be functionally equivalent, except that for DXVA2, the IDirectXVideoDecoderService_GetDecoderRenderTargets API is called more often potentially. --- video/decode/d3d.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'video/decode/d3d.h') diff --git a/video/decode/d3d.h b/video/decode/d3d.h index bbd6bdfd2a..21b930528a 100644 --- a/video/decode/d3d.h +++ b/video/decode/d3d.h @@ -24,6 +24,13 @@ struct mp_image; struct lavc_ctx; +struct d3d_decoded_format { + DWORD dxfmt; // D3DFORMAT or DXGI_FORMAT + const char *name; // informational string repr. of dxfmt_decoded + int depth; // significant bits (not full size) + int mpfmt; // IMGFMT_ with compatible memory layout and semantics +}; + struct d3d_decoder_fmt { const GUID *guid; int mpfmt_decoded; @@ -31,9 +38,12 @@ struct d3d_decoder_fmt { }; int d3d_probe_codec(const char *codec); + struct d3d_decoder_fmt d3d_select_decoder_mode( struct lavc_ctx *s, const GUID *device_guids, UINT n_guids, - DWORD (*get_dxfmt_cb)(struct lavc_ctx *s, const GUID *guid, int depth)); + const struct d3d_decoded_format *formats, int n_formats, + bool (*test_fmt_cb)(struct lavc_ctx *s, const GUID *guid, + const struct d3d_decoded_format *fmt)); char *d3d_decoder_guid_to_desc_buf(char *buf, size_t buf_size, const GUID *mode_guid); -- cgit v1.2.3