From: Yuxuan Shui yshui@codeweavers.com
--- dlls/d3d11/d3d11_private.h | 1 + dlls/d3d11/device.c | 224 +++++++++++++++++++++++++++++++++++++ 2 files changed, 225 insertions(+)
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 20ed7c349fe..ef9ba5e8afb 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -552,6 +552,7 @@ struct d3d_device ID3D10Device1 ID3D10Device1_iface; ID3D10Multithread ID3D10Multithread_iface; IWineDXGIDeviceParent IWineDXGIDeviceParent_iface; + ID3D11VideoDevice1 ID3D11VideoDevice1_iface; IUnknown *outer_unk; LONG refcount;
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 061fd57fe09..bdd80e90416 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -4605,6 +4605,10 @@ static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface { *out = &device->IWineDXGIDeviceParent_iface; } + else if (IsEqualGUID(riid, &IID_ID3D11VideoDevice) || IsEqualGUID(riid, &IID_ID3D11VideoDevice1)) + { + *out = &device->ID3D11VideoDevice1_iface; + } else { WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); @@ -6776,6 +6780,225 @@ static const struct ID3D10MultithreadVtbl d3d10_multithread_vtbl = d3d10_multithread_GetMultithreadProtected, };
+static struct d3d_device *impl_from_ID3D11VideoDevice1(ID3D11VideoDevice1 *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_device, ID3D11VideoDevice1_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_QueryInterface(ID3D11VideoDevice1 *iface, + REFIID iid, void **out) +{ + struct d3d_device *device = impl_from_ID3D11VideoDevice1(iface); + return IUnknown_QueryInterface(device->outer_unk, iid, out); +} + +static ULONG STDMETHODCALLTYPE d3d11_video_device_AddRef(ID3D11VideoDevice1 *iface) +{ + struct d3d_device *device = impl_from_ID3D11VideoDevice1(iface); + return IUnknown_AddRef(device->outer_unk); +} + +static ULONG STDMETHODCALLTYPE d3d11_video_device_Release(ID3D11VideoDevice1 *iface) +{ + struct d3d_device *device = impl_from_ID3D11VideoDevice1(iface); + return IUnknown_Release(device->outer_unk); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoDecoder(ID3D11VideoDevice1 *iface, + const D3D11_VIDEO_DECODER_DESC *desc, const D3D11_VIDEO_DECODER_CONFIG *config, ID3D11VideoDecoder **decoder) +{ + FIXME("iface %p, desc %p, config %p, decoder %p, stub!\n", iface, desc, config, decoder); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoProcessor(ID3D11VideoDevice1 *iface, + ID3D11VideoProcessorEnumerator *enumerator, UINT rate_conversion_index, ID3D11VideoProcessor **processor) +{ + FIXME("iface %p, enumerator %p, rate_conversion_index %u, processor %p, stub!\n", + iface, enumerator, rate_conversion_index, processor); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateAuthenticatedChannel(ID3D11VideoDevice1 *iface, + D3D11_AUTHENTICATED_CHANNEL_TYPE type, ID3D11AuthenticatedChannel **channel) +{ + FIXME("iface %p, type %#x, channel %p, stub!\n", iface, type, channel); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateCryptoSession(ID3D11VideoDevice1 *iface, + const GUID *encryption_type, const GUID *profile, const GUID *key_exchange_type, + ID3D11CryptoSession **session) +{ + FIXME("iface %p, encryption_type %s, profile %s, key_exchange_type %s, session %p, stub!\n", + iface, debugstr_guid(encryption_type), debugstr_guid(profile), debugstr_guid(key_exchange_type), session); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoDecoderOutputView(ID3D11VideoDevice1 *iface, + ID3D11Resource *resource, const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *desc, ID3D11VideoDecoderOutputView **view) +{ + FIXME("iface %p, resource %p, desc %p, view %p, stub!\n", iface, resource, desc, view); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoProcessorInputView( + ID3D11VideoDevice1 *iface, ID3D11Resource *resource, ID3D11VideoProcessorEnumerator *enumerator, + const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *desc, ID3D11VideoProcessorInputView **view) +{ + FIXME("iface %p, resource %p, enumerator %p, desc %p, view %p, stub!\n", iface, resource, enumerator, desc, view); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoProcessorOutputView( + ID3D11VideoDevice1 *iface, ID3D11Resource *resource, ID3D11VideoProcessorEnumerator *enumerator, + const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *desc, ID3D11VideoProcessorOutputView **view) +{ + FIXME("iface %p, resource %p, enumerator %p, desc %p, view %p, stub!\n", iface, resource, enumerator, desc, view); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoProcessorEnumerator(ID3D11VideoDevice1 *iface, + const D3D11_VIDEO_PROCESSOR_CONTENT_DESC *desc, ID3D11VideoProcessorEnumerator **enumerator) +{ + FIXME("iface %p, desc %p, enumerator %p, stub!\n", iface, desc, enumerator); + return E_NOTIMPL; +} + +static UINT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderProfileCount(ID3D11VideoDevice1 *iface) +{ + FIXME("iface %p, stub!\n", iface); + return 0; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderProfile( + ID3D11VideoDevice1 *iface, UINT index, GUID *profile) +{ + FIXME("iface %p, index %u, profile %p, stub!\n", iface, index, profile); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CheckVideoDecoderFormat( + ID3D11VideoDevice1 *iface, const GUID *profile, DXGI_FORMAT format, BOOL *supported) +{ + FIXME("iface %p, profile %s, format %#x, supported %p, stub!\n", iface, debugstr_guid(profile), format, supported); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderConfigCount(ID3D11VideoDevice1 *iface, + const D3D11_VIDEO_DECODER_DESC *desc, UINT *count) +{ + FIXME("iface %p, desc %p, count %p, stub!\n", iface, desc, count); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderConfig(ID3D11VideoDevice1 *iface, + const D3D11_VIDEO_DECODER_DESC *desc, UINT index, D3D11_VIDEO_DECODER_CONFIG *config) +{ + FIXME("iface %p, desc %p, index %u, config %p, stub!\n", iface, desc, index, config); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetContentProtectionCaps(ID3D11VideoDevice1 *iface, + const GUID *encryption_type, const GUID *profile, D3D11_VIDEO_CONTENT_PROTECTION_CAPS *caps) +{ + FIXME("iface %p, encryption_type %s, profile %s, caps %p, stub!\n", + iface, debugstr_guid(encryption_type), debugstr_guid(profile), caps); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CheckCryptoKeyExchange(ID3D11VideoDevice1 *iface, + const GUID *encryption_type, const GUID *profile, UINT index, GUID *key_exchange_type) +{ + FIXME("iface %p, encryption_type %s, profile %s, index %u, key_exchange_type %p, stub!\n", + iface, debugstr_guid(encryption_type), debugstr_guid(profile), index, key_exchange_type); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_SetPrivateData( + ID3D11VideoDevice1 *iface, REFGUID guid, UINT size, const void *data) +{ + TRACE("iface %p, guid %s, size %u, data %p.\n", iface, debugstr_guid(guid), size, data); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_SetPrivateDataInterface( + ID3D11VideoDevice1 *iface, REFGUID guid, const IUnknown *data) +{ + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetCryptoSessionPrivateDataSize( + ID3D11VideoDevice1 *iface, const GUID *encryption_type, const GUID *profile, + const GUID *key_exchange_type, UINT *input_size, UINT *output_size) +{ + FIXME("iface %p, encryption_type %s, profile %s, key_exchange_type %s, input_size %p, output_size %p, stub!\n", + iface, debugstr_guid(encryption_type), debugstr_guid(profile), + debugstr_guid(key_exchange_type), input_size, output_size); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderCaps( + ID3D11VideoDevice1 *iface, const GUID *profile, UINT width, UINT height, + const DXGI_RATIONAL *framerate, UINT bitrate, const GUID *encryption_type, UINT *caps) +{ + TRACE("iface %p, profile %s, width %u, height %u, framerate %u/%u, bitrate %u, encryption_type %s, caps %p, stub!\n", + iface, debugstr_guid(profile), width, height, framerate->Numerator, framerate->Denominator, + bitrate, debugstr_guid(encryption_type), caps); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_CheckVideoDecoderDownsampling(ID3D11VideoDevice1 *iface, + const D3D11_VIDEO_DECODER_DESC *input_desc, DXGI_COLOR_SPACE_TYPE input_colour_space, + const D3D11_VIDEO_DECODER_CONFIG *config, const DXGI_RATIONAL *framerate, + const D3D11_VIDEO_SAMPLE_DESC *output_desc, BOOL *supported, BOOL *real_time_hint) +{ + TRACE("iface %p, input_desc %p, input_colour_space %#x, config %p," + " framerate %u/%u, output_desc %p, supported %p, real_time_hint %p, stub!\n", + iface, input_desc, input_colour_space, config, + framerate->Numerator, framerate->Denominator, output_desc, supported, real_time_hint); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_device_RecommendVideoDecoderDownsampleParameters(ID3D11VideoDevice1 *iface, + const D3D11_VIDEO_DECODER_DESC *input_desc, DXGI_COLOR_SPACE_TYPE input_colour_space, + const D3D11_VIDEO_DECODER_CONFIG *config, const DXGI_RATIONAL *framerate, + D3D11_VIDEO_SAMPLE_DESC *output_desc) +{ + TRACE("iface %p, input_desc %p, input_colour_space %#x, config %p, framerate %u/%u, output_desc %p, stub!\n", + iface, input_desc, input_colour_space, config, framerate->Numerator, framerate->Denominator, output_desc); + return E_NOTIMPL; +} + +static const struct ID3D11VideoDevice1Vtbl d3d11_video_device1_vtbl = +{ + d3d11_video_device_QueryInterface, + d3d11_video_device_AddRef, + d3d11_video_device_Release, + d3d11_video_device_CreateVideoDecoder, + d3d11_video_device_CreateVideoProcessor, + d3d11_video_device_CreateAuthenticatedChannel, + d3d11_video_device_CreateCryptoSession, + d3d11_video_device_CreateVideoDecoderOutputView, + d3d11_video_device_CreateVideoProcessorInputView, + d3d11_video_device_CreateVideoProcessorOutputView, + d3d11_video_device_CreateVideoProcessorEnumerator, + d3d11_video_device_GetVideoDecoderProfileCount, + d3d11_video_device_GetVideoDecoderProfile, + d3d11_video_device_CheckVideoDecoderFormat, + d3d11_video_device_GetVideoDecoderConfigCount, + d3d11_video_device_GetVideoDecoderConfig, + d3d11_video_device_GetContentProtectionCaps, + d3d11_video_device_CheckCryptoKeyExchange, + d3d11_video_device_SetPrivateData, + d3d11_video_device_SetPrivateDataInterface, + d3d11_video_device_GetCryptoSessionPrivateDataSize, + d3d11_video_device_GetVideoDecoderCaps, + d3d11_video_device_CheckVideoDecoderDownsampling, + d3d11_video_device_RecommendVideoDecoderDownsampleParameters, +}; + /* IWineDXGIDeviceParent IUnknown methods */
static inline struct d3d_device *device_from_dxgi_device_parent(IWineDXGIDeviceParent *iface) @@ -6969,6 +7192,7 @@ void d3d_device_init(struct d3d_device *device, void *outer_unknown) device->ID3D11Device2_iface.lpVtbl = &d3d11_device_vtbl; device->ID3D10Device1_iface.lpVtbl = &d3d10_device1_vtbl; device->ID3D10Multithread_iface.lpVtbl = &d3d10_multithread_vtbl; + device->ID3D11VideoDevice1_iface.lpVtbl = &d3d11_video_device1_vtbl; device->IWineDXGIDeviceParent_iface.lpVtbl = &d3d_dxgi_device_parent_vtbl; device->device_parent.ops = &d3d_wined3d_device_parent_ops; device->refcount = 1;
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/d3d11/Makefile.in | 1 + dlls/d3d11/d3d11_private.h | 12 +++ dlls/d3d11/decoder.c | 160 +++++++++++++++++++++++++++++++++++++ dlls/d3d11/device.c | 11 ++- 4 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 dlls/d3d11/decoder.c
diff --git a/dlls/d3d11/Makefile.in b/dlls/d3d11/Makefile.in index 83f49602a46..27db1f637f2 100644 --- a/dlls/d3d11/Makefile.in +++ b/dlls/d3d11/Makefile.in @@ -7,6 +7,7 @@ SOURCES = \ async.c \ buffer.c \ d3d11_main.c \ + decoder.c \ device.c \ inputlayout.c \ shader.c \ diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index ef9ba5e8afb..57ed210a282 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -601,6 +601,18 @@ static inline struct d3d_device *impl_from_ID3D10Device(ID3D10Device1 *iface)
void d3d_device_init(struct d3d_device *device, void *outer_unknown);
+struct d3d_video_decoder +{ + ID3D11VideoDecoder ID3D11VideoDecoder_iface; + LONG refcount; + + struct wined3d_private_store private_store; + struct d3d_device *device; +}; + +HRESULT d3d_video_decoder_create(struct d3d_device *device, const D3D11_VIDEO_DECODER_DESC *desc, + const D3D11_VIDEO_DECODER_CONFIG *config, struct d3d_video_decoder **decoder); + /* Layered device */ enum dxgi_device_layer_id { diff --git a/dlls/d3d11/decoder.c b/dlls/d3d11/decoder.c new file mode 100644 index 00000000000..5caf7b66c93 --- /dev/null +++ b/dlls/d3d11/decoder.c @@ -0,0 +1,160 @@ +/* + * Copyright 2024 Elizabeth Figura for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "d3d11_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d11); + +static struct d3d_video_decoder *impl_from_ID3D11VideoDecoder(ID3D11VideoDecoder *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_video_decoder, ID3D11VideoDecoder_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_QueryInterface(ID3D11VideoDecoder *iface, + REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11VideoDecoder) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) + || IsEqualGUID(riid, &IID_IUnknown)) + { + ID3D11VideoDecoder_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d11_video_decoder_AddRef(ID3D11VideoDecoder *iface) +{ + struct d3d_video_decoder *decoder = impl_from_ID3D11VideoDecoder(iface); + ULONG refcount = InterlockedIncrement(&decoder->refcount); + + TRACE("%p increasing refcount to %lu.\n", decoder, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d11_video_decoder_Release(ID3D11VideoDecoder *iface) +{ + struct d3d_video_decoder *decoder = impl_from_ID3D11VideoDecoder(iface); + ULONG refcount = InterlockedDecrement(&decoder->refcount); + + TRACE("%p decreasing refcount to %lu.\n", decoder, refcount); + + if (!refcount) + { + ID3D11Device2_Release(&decoder->device->ID3D11Device2_iface); + wined3d_private_store_cleanup(&decoder->private_store); + free(decoder); + } + + return refcount; +} + +static void STDMETHODCALLTYPE d3d11_video_decoder_GetDevice(ID3D11VideoDecoder *iface, ID3D11Device **device) +{ + struct d3d_video_decoder *decoder = impl_from_ID3D11VideoDecoder(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = (ID3D11Device *)decoder->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_GetPrivateData(ID3D11VideoDecoder *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_video_decoder *decoder = impl_from_ID3D11VideoDecoder(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&decoder->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_SetPrivateData(ID3D11VideoDecoder *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_video_decoder *decoder = impl_from_ID3D11VideoDecoder(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&decoder->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_SetPrivateDataInterface(ID3D11VideoDecoder *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_video_decoder *decoder = impl_from_ID3D11VideoDecoder(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&decoder->private_store, guid, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_GetCreationParameters(ID3D11VideoDecoder *iface, + D3D11_VIDEO_DECODER_DESC *desc, D3D11_VIDEO_DECODER_CONFIG *config) +{ + FIXME("iface %p, desc %p, config %p, stub!\n", iface, desc, config); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_GetDriverHandle(ID3D11VideoDecoder *iface, HANDLE *handle) +{ + FIXME("iface %p, handle %p, stub!\n", iface, handle); + return E_NOTIMPL; +} + +static const struct ID3D11VideoDecoderVtbl d3d11_video_decoder_vtbl = +{ + d3d11_video_decoder_QueryInterface, + d3d11_video_decoder_AddRef, + d3d11_video_decoder_Release, + d3d11_video_decoder_GetDevice, + d3d11_video_decoder_GetPrivateData, + d3d11_video_decoder_SetPrivateData, + d3d11_video_decoder_SetPrivateDataInterface, + d3d11_video_decoder_GetCreationParameters, + d3d11_video_decoder_GetDriverHandle, +}; + +HRESULT d3d_video_decoder_create(struct d3d_device *device, const D3D11_VIDEO_DECODER_DESC *desc, + const D3D11_VIDEO_DECODER_CONFIG *config, struct d3d_video_decoder **decoder) +{ + struct d3d_video_decoder *object; + + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + object->ID3D11VideoDecoder_iface.lpVtbl = &d3d11_video_decoder_vtbl; + object->refcount = 1; + + wined3d_private_store_init(&object->private_store); + object->device = device; + ID3D11Device2_AddRef(&device->ID3D11Device2_iface); + + TRACE("Created video decoder %p.\n", object); + *decoder = object; + return S_OK; +} diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index bdd80e90416..540fbfc7894 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -6807,8 +6807,17 @@ static ULONG STDMETHODCALLTYPE d3d11_video_device_Release(ID3D11VideoDevice1 *if static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoDecoder(ID3D11VideoDevice1 *iface, const D3D11_VIDEO_DECODER_DESC *desc, const D3D11_VIDEO_DECODER_CONFIG *config, ID3D11VideoDecoder **decoder) { + struct d3d_device *device = impl_from_ID3D11VideoDevice1(iface); + struct d3d_video_decoder *object; + HRESULT hr; + FIXME("iface %p, desc %p, config %p, decoder %p, stub!\n", iface, desc, config, decoder); - return E_NOTIMPL; + + if (FAILED(hr = d3d_video_decoder_create(device, desc, config, &object))) + return hr; + + *decoder = &object->ID3D11VideoDecoder_iface; + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoProcessor(ID3D11VideoDevice1 *iface,
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/d3d11/d3d11_private.h | 14 +++ dlls/d3d11/device.c | 19 ++++- dlls/d3d11/view.c | 169 +++++++++++++++++++++++++++++++++++++ 3 files changed, 200 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 57ed210a282..bd9e82efd9a 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -267,6 +267,20 @@ HRESULT d3d11_unordered_access_view_create(struct d3d_device *device, ID3D11Reso struct d3d11_unordered_access_view *unsafe_impl_from_ID3D11UnorderedAccessView( ID3D11UnorderedAccessView *iface);
+struct d3d_video_decoder_output_view +{ + ID3D11VideoDecoderOutputView ID3D11VideoDecoderOutputView_iface; + LONG refcount; + + struct wined3d_private_store private_store; + D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC desc; + ID3D11Resource *resource; + struct d3d_device *device; +}; + +HRESULT d3d_video_decoder_output_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *desc, struct d3d_video_decoder_output_view **view); + /* ID3D11InputLayout, ID3D10InputLayout */ struct d3d_input_layout { diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 540fbfc7894..d1dc676e8f8 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -6847,8 +6847,23 @@ static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateCryptoSession(ID3D11Vi static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoDecoderOutputView(ID3D11VideoDevice1 *iface, ID3D11Resource *resource, const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *desc, ID3D11VideoDecoderOutputView **view) { - FIXME("iface %p, resource %p, desc %p, view %p, stub!\n", iface, resource, desc, view); - return E_NOTIMPL; + struct d3d_device *device = impl_from_ID3D11VideoDevice1(iface); + struct d3d_video_decoder_output_view *object; + HRESULT hr; + + TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); + + *view = NULL; + + if (!resource) + return E_INVALIDARG; + + if (FAILED(hr = d3d_video_decoder_output_view_create(device, resource, desc, &object))) + return hr; + + *view = &object->ID3D11VideoDecoderOutputView_iface; + + return S_OK; }
static HRESULT STDMETHODCALLTYPE d3d11_video_device_CreateVideoProcessorInputView( diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c index 228bed0ed66..449a365362a 100644 --- a/dlls/d3d11/view.c +++ b/dlls/d3d11/view.c @@ -2580,3 +2580,172 @@ struct d3d11_unordered_access_view *unsafe_impl_from_ID3D11UnorderedAccessView(I
return impl_from_ID3D11UnorderedAccessView(iface); } + +static struct d3d_video_decoder_output_view *impl_from_ID3D11VideoDecoderOutputView(ID3D11VideoDecoderOutputView *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_video_decoder_output_view, ID3D11VideoDecoderOutputView_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_output_view_QueryInterface(ID3D11VideoDecoderOutputView *iface, + REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11VideoDecoderOutputView) + || IsEqualGUID(riid, &IID_ID3D11View) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) + || IsEqualGUID(riid, &IID_IUnknown)) + { + ID3D11VideoDecoderOutputView_AddRef(*object = iface); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d11_video_decoder_output_view_AddRef(ID3D11VideoDecoderOutputView *iface) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + ULONG refcount = InterlockedIncrement(&view->refcount); + + TRACE("%p increasing refcount to %lu.\n", view, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d11_video_decoder_output_view_Release(ID3D11VideoDecoderOutputView *iface) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + ULONG refcount = InterlockedDecrement(&view->refcount); + + TRACE("%p decreasing refcount to %lu.\n", view, refcount); + + if (!refcount) + { + ID3D11Device2_Release(&view->device->ID3D11Device2_iface); + wined3d_private_store_cleanup(&view->private_store); + free(view); + } + + return refcount; +} + +static void STDMETHODCALLTYPE d3d11_video_decoder_output_view_GetDevice(ID3D11VideoDecoderOutputView *iface, + ID3D11Device **device) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + ID3D11Device_AddRef(*device = (ID3D11Device *)view->device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_output_view_GetPrivateData( + ID3D11VideoDecoderOutputView *iface, REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_output_view_SetPrivateData( + ID3D11VideoDecoderOutputView *iface, REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_decoder_output_view_SetPrivateDataInterface( + ID3D11VideoDecoderOutputView *iface, REFGUID guid, const IUnknown *data) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&view->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_video_decoder_output_view_GetResource( + ID3D11VideoDecoderOutputView *iface, ID3D11Resource **resource) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + + TRACE("iface %p, resource %p.\n", iface, resource); + + ID3D11Resource_AddRef(*resource = view->resource); +} + +static void STDMETHODCALLTYPE d3d11_video_decoder_output_view_GetDesc( + ID3D11VideoDecoderOutputView *iface, D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *desc) +{ + struct d3d_video_decoder_output_view *view = impl_from_ID3D11VideoDecoderOutputView(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = view->desc; +} + +static const struct ID3D11VideoDecoderOutputViewVtbl d3d11_video_decoder_output_view_vtbl = +{ + /* IUnknown methods */ + d3d11_video_decoder_output_view_QueryInterface, + d3d11_video_decoder_output_view_AddRef, + d3d11_video_decoder_output_view_Release, + /* ID3D11DeviceChild methods */ + d3d11_video_decoder_output_view_GetDevice, + d3d11_video_decoder_output_view_GetPrivateData, + d3d11_video_decoder_output_view_SetPrivateData, + d3d11_video_decoder_output_view_SetPrivateDataInterface, + /* ID3D11View methods */ + d3d11_video_decoder_output_view_GetResource, + /* ID3D11VideoDecoderOutputView methods */ + d3d11_video_decoder_output_view_GetDesc, +}; + +static HRESULT d3d_video_decoder_output_view_init(struct d3d_video_decoder_output_view *view, + struct d3d_device *device, ID3D11Resource *resource, const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *desc) +{ + view->ID3D11VideoDecoderOutputView_iface.lpVtbl = &d3d11_video_decoder_output_view_vtbl; + view->refcount = 1; + + wined3d_mutex_lock(); + wined3d_private_store_init(&view->private_store); + wined3d_mutex_unlock(); + view->resource = resource; + view->device = device; + ID3D11Device2_AddRef(&device->ID3D11Device2_iface); + + return S_OK; +} + +HRESULT d3d_video_decoder_output_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *desc, struct d3d_video_decoder_output_view **view) +{ + struct d3d_video_decoder_output_view *object; + HRESULT hr; + + TRACE("profile %s, slice %u.\n", debugstr_guid(&desc->DecodeProfile), desc->u.Texture2D.ArraySlice); + + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_video_decoder_output_view_init(object, device, resource, desc))) + { + WARN("Failed to initialise video decoder output view, hr %#lx.\n", hr); + free(object); + return hr; + } + + TRACE("Created video decoder output view %p.\n", object); + *view = object; + + return S_OK; +}
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/d3d11/d3d11_private.h | 1 + dlls/d3d11/device.c | 543 +++++++++++++++++++++++++++++++++++++ 2 files changed, 544 insertions(+)
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index bd9e82efd9a..68745e3b815 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -548,6 +548,7 @@ struct d3d11_device_context { ID3D11DeviceContext1 ID3D11DeviceContext1_iface; ID3D11Multithread ID3D11Multithread_iface; + ID3D11VideoContext ID3D11VideoContext_iface; ID3DUserDefinedAnnotation ID3DUserDefinedAnnotation_iface; LONG refcount;
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index d1dc676e8f8..2c6e4f4654c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -484,6 +484,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_QueryInterface(ID3D11Devic { *out = &context->ID3D11Multithread_iface; } + else if (context->type == D3D11_DEVICE_CONTEXT_IMMEDIATE && IsEqualGUID(iid, &IID_ID3D11VideoContext)) + { + *out = &context->ID3D11VideoContext_iface; + } else if (IsEqualGUID(iid, &IID_ID3DUserDefinedAnnotation)) { *out = &context->ID3DUserDefinedAnnotation_iface; @@ -3108,6 +3112,544 @@ static const struct ID3D11DeviceContext1Vtbl d3d11_device_context_vtbl = d3d11_device_context_DiscardView1, };
+static struct d3d11_device_context *impl_from_ID3D11VideoContext(ID3D11VideoContext *iface) +{ + return CONTAINING_RECORD(iface, struct d3d11_device_context, ID3D11VideoContext_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_QueryInterface(ID3D11VideoContext *iface, + REFIID iid, void **out) +{ + struct d3d11_device_context *context = impl_from_ID3D11VideoContext(iface); + + return d3d11_device_context_QueryInterface(&context->ID3D11DeviceContext1_iface, iid, out); +} + +static ULONG STDMETHODCALLTYPE d3d11_video_context_AddRef(ID3D11VideoContext *iface) +{ + struct d3d11_device_context *context = impl_from_ID3D11VideoContext(iface); + + return d3d11_device_context_AddRef(&context->ID3D11DeviceContext1_iface); +} + +static ULONG STDMETHODCALLTYPE d3d11_video_context_Release(ID3D11VideoContext *iface) +{ + struct d3d11_device_context *context = impl_from_ID3D11VideoContext(iface); + + return d3d11_device_context_Release(&context->ID3D11DeviceContext1_iface); +} + +static void STDMETHODCALLTYPE d3d11_video_context_GetDevice(ID3D11VideoContext *iface, ID3D11Device **device) +{ + struct d3d11_device_context *context = impl_from_ID3D11VideoContext(iface); + + return d3d11_device_context_GetDevice(&context->ID3D11DeviceContext1_iface, device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_GetPrivateData( + ID3D11VideoContext *iface, REFGUID guid, UINT *size, void *data) +{ + struct d3d11_device_context *context = impl_from_ID3D11VideoContext(iface); + + return d3d11_device_context_GetPrivateData(&context->ID3D11DeviceContext1_iface, guid, size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_SetPrivateData( + ID3D11VideoContext *iface, REFGUID guid, UINT size, const void *data) +{ + struct d3d11_device_context *context = impl_from_ID3D11VideoContext(iface); + + return d3d11_device_context_SetPrivateData(&context->ID3D11DeviceContext1_iface, guid, size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_SetPrivateDataInterface( + ID3D11VideoContext *iface, REFGUID guid, const IUnknown *data) +{ + struct d3d11_device_context *context = impl_from_ID3D11VideoContext(iface); + + return d3d11_device_context_SetPrivateDataInterface(&context->ID3D11DeviceContext1_iface, guid, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_GetDecoderBuffer(ID3D11VideoContext *iface, + ID3D11VideoDecoder *decoder, D3D11_VIDEO_DECODER_BUFFER_TYPE type, UINT *size, void **buffer) +{ + FIXME("iface %p, decoder %p, type %#x, size %p, buffer %p, stub!\n", iface, decoder, type, size, buffer); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_ReleaseDecoderBuffer(ID3D11VideoContext *iface, + ID3D11VideoDecoder *decoder, D3D11_VIDEO_DECODER_BUFFER_TYPE type) +{ + FIXME("iface %p, decoder %p, type %#x, stub!\n", iface, decoder, type); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_DecoderBeginFrame(ID3D11VideoContext *iface, + ID3D11VideoDecoder *decoder, ID3D11VideoDecoderOutputView *view, UINT key_size, const void *key) +{ + FIXME("iface %p, decoder %p, view %p, key_size %u, key %p, stub!\n", iface, decoder, view, key_size, key); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_DecoderEndFrame( + ID3D11VideoContext *iface, ID3D11VideoDecoder *decoder) +{ + FIXME("iface %p, decoder %p, stub!\n", iface, decoder); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_SubmitDecoderBuffers(ID3D11VideoContext *iface, + ID3D11VideoDecoder *decoder, UINT count, const D3D11_VIDEO_DECODER_BUFFER_DESC *buffers) +{ + FIXME("iface %p, decoder %p, count %u, buffers %p, stub!\n", iface, decoder, count, buffers); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_DecoderExtension(ID3D11VideoContext *iface, + ID3D11VideoDecoder *decoder, const D3D11_VIDEO_DECODER_EXTENSION *extension) +{ + FIXME("iface %p, decoder %p, extension %p, stub!\n", iface, decoder, extension); + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetOutputTargetRect( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL enable, const RECT *rect) +{ + FIXME("iface %p, processor %p, enable %d, rect %s, stub!\n", iface, processor, enable, wine_dbgstr_rect(rect)); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetOutputBackgroundColor( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL yuv, const D3D11_VIDEO_COLOR *color) +{ + FIXME("iface %p, processor %p, yuv %d, color {%.8e, %.8e, %.8e, %.8e}, stub!\n", + iface, processor, yuv, color->u.RGBA.R, color->u.RGBA.G, color->u.RGBA.B, color->u.RGBA.A); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetOutputColorSpace(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *space) +{ + FIXME("iface %p, processor %p, space %p, stub!\n", iface, processor, space); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetOutputAlphaFillMode(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE mode, UINT stream_idx) +{ + FIXME("iface %p, processor %p, mode %#x, stream_idx %u, stub!\n", iface, processor, mode, stream_idx); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetOutputConstriction( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL enable, SIZE size) +{ + FIXME("iface %p, processor %p, enable %d, size (%lux%lu), stub!\n", iface, processor, enable, size.cx, size.cy); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetOutputStereoMode( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL enable) +{ + FIXME("iface %p, processor %p, enable %d, stub!\n", iface, processor, enable); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetOutputExtension(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, const GUID *guid, UINT size, void *data) +{ + FIXME("iface %p, processor %p, guid %s, size %u, data %p, stub!\n", + iface, processor, debugstr_guid(guid), size, data); + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetOutputTargetRect( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL *enabled, RECT *rect) +{ + FIXME("iface %p, processor %p, enabled %p, rect %p, stub!\n", iface, processor, enabled, rect); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetOutputBackgroundColor( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL *yuv, D3D11_VIDEO_COLOR *color) +{ + FIXME("iface %p, processor %p, yuv %p, color %p, stub!\n", iface, processor, yuv, color); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetOutputColorSpace( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, D3D11_VIDEO_PROCESSOR_COLOR_SPACE *space) +{ + FIXME("iface %p, processor %p, space %p, stub!\n", iface, processor, space); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetOutputAlphaFillMode(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE *mode, UINT *stream_idx) +{ + FIXME("iface %p, processor %p, mode %p, stream_idx %p, stub!\n", iface, processor, mode, stream_idx); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetOutputConstriction( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL *enabled, SIZE *size) +{ + FIXME("iface %p, processor %p, enabled %p, size %p, stub!\n", iface, processor, enabled, size); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetOutputStereoMode( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, BOOL *enabled) +{ + FIXME("iface %p, processor %p, enabled %p, stub!\n", iface, processor, enabled); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetOutputExtension( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, const GUID *guid, UINT size, void *data) +{ + FIXME("iface %p, processor %p, guid %s, size %u, data %p, stub!\n", + iface, processor, debugstr_guid(guid), size, data); + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamFrameFormat(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, D3D11_VIDEO_FRAME_FORMAT format) +{ + FIXME("iface %p, processor %p, stream_idx %u, format %#x, stub!\n", iface, processor, stream_idx, format); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamColorSpace(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *space) +{ + FIXME("iface %p, processor %p, stream_idx %u, space %p, stub!\n", iface, processor, stream_idx, space); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamOutputRate( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, + D3D11_VIDEO_PROCESSOR_OUTPUT_RATE rate, BOOL repeat, const DXGI_RATIONAL *custom_rate) +{ + FIXME("iface %p, processor %p, stream_idx %u, rate %#x, repeat %d, custom_rate %u/%u, stub!\n", + iface, processor, stream_idx, rate, repeat, custom_rate->Numerator, custom_rate->Denominator); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamSourceRect(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL enable, const RECT *rect) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, rect %s, stub!\n", + iface, processor, stream_idx, enable, wine_dbgstr_rect(rect)); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamDestRect(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL enable, const RECT *rect) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, rect %s, stub!\n", + iface, processor, stream_idx, enable, wine_dbgstr_rect(rect)); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamAlpha(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL enable, float alpha) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, alpha %.8e, stub!\n", + iface, processor, stream_idx, enable, alpha); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamPalette(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, UINT entry_count, const UINT *entries) +{ + FIXME("iface %p, processor %p, stream_idx %u, entry_count %u, entries %p, stub!\n", + iface, processor, stream_idx, entry_count, entries); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamPixelAspectRatio( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, + BOOL enable, const DXGI_RATIONAL *src_ratio, const DXGI_RATIONAL *dst_ratio) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, src_ratio %u/%u, dst_ratio %u/%u stub!\n", + iface, processor, stream_idx, enable, src_ratio->Numerator, src_ratio->Denominator, + dst_ratio->Numerator, dst_ratio->Denominator); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamLumaKey(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL enable, float lower, float upper) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, lower %.8e, upper %.8e, stub!\n", + iface, processor, stream_idx, enable, lower, upper); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamStereoFormat(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL enable, D3D11_VIDEO_PROCESSOR_STEREO_FORMAT format, + BOOL left_view_frame0, BOOL base_view_frame0, D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE flip_mode, int mono_offset) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, format %#x," + " left_view_frame0 %d, base_view_frame0 %d, flip_mode %#x, mono_offset %d, stub!\n", + iface, processor, stream_idx, enable, format, left_view_frame0, base_view_frame0, flip_mode, mono_offset); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamAutoProcessingMode( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, BOOL enable) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, stub!\n", iface, processor, stream_idx, enable); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamFilter(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, D3D11_VIDEO_PROCESSOR_FILTER filter, BOOL enable, int level) +{ + FIXME("iface %p, processor %p, stream_idx %u, filter %#x, enable %d, level %d, stub!\n", + iface, processor, stream_idx, filter, enable, level); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamExtension(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, const GUID *guid, UINT size, void *data) +{ + FIXME("iface %p, processor %p, stream_idx %u, guid %s, size %u, data %p, stub!\n", + iface, processor, stream_idx, debugstr_guid(guid), size, data); + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamFrameFormat(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, D3D11_VIDEO_FRAME_FORMAT *format) +{ + FIXME("iface %p, processor %p, stream_idx %u, format %p, stub!\n", iface, processor, stream_idx, format); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamColorSpace(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, D3D11_VIDEO_PROCESSOR_COLOR_SPACE *space) +{ + FIXME("iface %p, processor %p, stream_idx %u, space %p, stub!\n", iface, processor, stream_idx, space); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamOutputRate( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, + D3D11_VIDEO_PROCESSOR_OUTPUT_RATE *rate, BOOL *repeat, DXGI_RATIONAL *custom_rate) +{ + FIXME("iface %p, processor %p, stream_idx %u, rate %p, repeat %p, custom_rate %p, stub!\n", + iface, processor, stream_idx, rate, repeat, custom_rate); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamSourceRect(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL *enabled, RECT *rect) +{ + FIXME("iface %p, processor %p, stream_idx %u, enabled %p, rect %p, stub!\n", + iface, processor, stream_idx, enabled, rect); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamDestRect(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL *enabled, RECT *rect) +{ + FIXME("iface %p, processor %p, stream_idx %u, enabled %p, rect %p, stub!\n", + iface, processor, stream_idx, enabled, rect); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamAlpha(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL *enabled, float *alpha) +{ + FIXME("iface %p, processor %p, stream_idx %u, enabled %p, alpha %p, stub!\n", + iface, processor, stream_idx, enabled, alpha); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamPalette(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, UINT count, UINT *entries) +{ + FIXME("iface %p, processor %p, stream_idx %u, count %u, entries %p, stub!\n", + iface, processor, stream_idx, count, entries); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamPixelAspectRatio( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, + BOOL *enabled, DXGI_RATIONAL *src_ratio, DXGI_RATIONAL *dst_ratio) +{ + FIXME("iface %p, processor %p, stream_idx %u, enabled %p, src_ratio %p, dst_ratio %p, stub!\n", + iface, processor, stream_idx, enabled, src_ratio, dst_ratio); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamLumaKey(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL *enabled, float *lower, float *upper) +{ + FIXME("iface %p, processor %p, stream_idx %u, enabled %p, lower %p, upper %p, stub!\n", + iface, processor, stream_idx, enabled, lower, upper); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamStereoFormat( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, BOOL *enabled, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT *format, BOOL *left_view_frame0, + BOOL *base_view_frame0, D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE *flip_mode, int *mono_offset) +{ + FIXME("iface %p, processor %p, stream_idx %u, enabled %p, format %p, left_view_frame0 %p," + " base_view_frame0 %p flip_mode %p, mono_offset %p, stub!\n", + iface, processor, stream_idx, enabled, format, left_view_frame0, base_view_frame0, flip_mode, mono_offset); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamAutoProcessingMode( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, BOOL *enabled) +{ + FIXME("iface %p, processor %p, stream_idx %u, enabled %p, stub!\n", iface, processor, stream_idx, enabled); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamFilter( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, UINT stream_idx, + D3D11_VIDEO_PROCESSOR_FILTER filter, BOOL *enabled, int *level) +{ + FIXME("iface %p, processor %p, stream_idx %u, filter %#x, enabled %p, level %p, stub!\n", + iface, processor, stream_idx, filter, enabled, level); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamExtension(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, const GUID *guid, UINT size, void *data) +{ + FIXME("iface %p, processor %p, stream_idx %u, guid %s, size %u, data %p, stub!\n", + iface, processor, stream_idx, debugstr_guid(guid), size, data); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_VideoProcessorBlt( + ID3D11VideoContext *iface, ID3D11VideoProcessor *processor, ID3D11VideoProcessorOutputView *view, + UINT frame_idx, UINT stream_count, const D3D11_VIDEO_PROCESSOR_STREAM *streams) +{ + FIXME("iface %p, processor %p, view %p, frame_idx %u, stream_count %u, streams %p, stub!\n", + iface, processor, view, frame_idx, stream_count, streams); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_NegotiateCryptoSessionKeyExchange( + ID3D11VideoContext *iface, ID3D11CryptoSession *session, UINT size, void *data) +{ + FIXME("iface %p, session %p, size %u, data %p, stub!\n", iface, session, size, data); + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_video_context_EncryptionBlt( + ID3D11VideoContext *iface, ID3D11CryptoSession *session, + ID3D11Texture2D *src_surface, ID3D11Texture2D *dst_surface, UINT iv_size, void *iv) +{ + FIXME("iface %p, session %p, src_surface %p, dst_surface %p, iv_size %u, iv %p, stub!\n", + iface, session, src_surface, dst_surface, iv_size, iv); +} + +static void STDMETHODCALLTYPE d3d11_video_context_DecryptionBlt(ID3D11VideoContext *iface, + ID3D11CryptoSession *session, ID3D11Texture2D *src_surface, ID3D11Texture2D *dst_surface, + D3D11_ENCRYPTED_BLOCK_INFO *block_info, UINT key_size, const void *key, UINT iv_size, void *iv) +{ + FIXME("iface %p, session %p, src_surface %p, dst_surface %p, block_info %p," + " key_size %u, key %p, iv_size %u, iv %p, stub!\n", + iface, session, src_surface, dst_surface, block_info, key_size, key, iv_size, iv); +} + +static void STDMETHODCALLTYPE d3d11_video_context_StartSessionKeyRefresh(ID3D11VideoContext *iface, + ID3D11CryptoSession *session, UINT random_number_size, void *random_number) +{ + FIXME("iface %p, session %p, random_number_size %u, random_number %p, stub!\n", + iface, session, random_number_size, random_number); +} + +static void STDMETHODCALLTYPE d3d11_video_context_FinishSessionKeyRefresh( + ID3D11VideoContext *iface, ID3D11CryptoSession *session) +{ + FIXME("iface %p, session %p, stub!\n", iface, session); +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_GetEncryptionBltKey( + ID3D11VideoContext *iface, ID3D11CryptoSession *session, UINT size, void *key) +{ + FIXME("iface %p, session %p, size %u, key %p, stub!\n", iface, session, size, key); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_NegotiateAuthenticatedChannelKeyExchange( + ID3D11VideoContext *iface, ID3D11AuthenticatedChannel *channel, UINT size, void *data) +{ + FIXME("iface %p, channel %p, size %u, data %p, stub!\n", iface, channel, size, data); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_QueryAuthenticatedChannel(ID3D11VideoContext *iface, + ID3D11AuthenticatedChannel *channel, UINT input_size, const void *input, UINT output_size, void *output) +{ + FIXME("iface %p, channel %p, input_size %u, input %p, output_size %u, output %p stub!\n", + iface, channel, input_size, input, output_size, output); + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_video_context_ConfigureAuthenticatedChannel( + ID3D11VideoContext *iface, ID3D11AuthenticatedChannel *channel, + UINT input_size, const void *input, D3D11_AUTHENTICATED_CONFIGURE_OUTPUT *output) +{ + FIXME("iface %p, channel %p, input_size %u, input %p, output %p, stub!\n", + iface, channel, input_size, input, output); + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorSetStreamRotation(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL enable, D3D11_VIDEO_PROCESSOR_ROTATION rotation) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %d, rotation %#x, stub!\n", + iface, processor, stream_idx, enable, rotation); +} + +static void STDMETHODCALLTYPE d3d11_video_context_VideoProcessorGetStreamRotation(ID3D11VideoContext *iface, + ID3D11VideoProcessor *processor, UINT stream_idx, BOOL *enable, D3D11_VIDEO_PROCESSOR_ROTATION *rotation) +{ + FIXME("iface %p, processor %p, stream_idx %u, enable %p, rotation %p, stub!\n", + iface, processor, stream_idx, enable, rotation); +} + +static const ID3D11VideoContextVtbl d3d11_video_context_vtbl = +{ + d3d11_video_context_QueryInterface, + d3d11_video_context_AddRef, + d3d11_video_context_Release, + d3d11_video_context_GetDevice, + d3d11_video_context_GetPrivateData, + d3d11_video_context_SetPrivateData, + d3d11_video_context_SetPrivateDataInterface, + d3d11_video_context_GetDecoderBuffer, + d3d11_video_context_ReleaseDecoderBuffer, + d3d11_video_context_DecoderBeginFrame, + d3d11_video_context_DecoderEndFrame, + d3d11_video_context_SubmitDecoderBuffers, + d3d11_video_context_DecoderExtension, + d3d11_video_context_VideoProcessorSetOutputTargetRect, + d3d11_video_context_VideoProcessorSetOutputBackgroundColor, + d3d11_video_context_VideoProcessorSetOutputColorSpace, + d3d11_video_context_VideoProcessorSetOutputAlphaFillMode, + d3d11_video_context_VideoProcessorSetOutputConstriction, + d3d11_video_context_VideoProcessorSetOutputStereoMode, + d3d11_video_context_VideoProcessorSetOutputExtension, + d3d11_video_context_VideoProcessorGetOutputTargetRect, + d3d11_video_context_VideoProcessorGetOutputBackgroundColor, + d3d11_video_context_VideoProcessorGetOutputColorSpace, + d3d11_video_context_VideoProcessorGetOutputAlphaFillMode, + d3d11_video_context_VideoProcessorGetOutputConstriction, + d3d11_video_context_VideoProcessorGetOutputStereoMode, + d3d11_video_context_VideoProcessorGetOutputExtension, + d3d11_video_context_VideoProcessorSetStreamFrameFormat, + d3d11_video_context_VideoProcessorSetStreamColorSpace, + d3d11_video_context_VideoProcessorSetStreamOutputRate, + d3d11_video_context_VideoProcessorSetStreamSourceRect, + d3d11_video_context_VideoProcessorSetStreamDestRect, + d3d11_video_context_VideoProcessorSetStreamAlpha, + d3d11_video_context_VideoProcessorSetStreamPalette, + d3d11_video_context_VideoProcessorSetStreamPixelAspectRatio, + d3d11_video_context_VideoProcessorSetStreamLumaKey, + d3d11_video_context_VideoProcessorSetStreamStereoFormat, + d3d11_video_context_VideoProcessorSetStreamAutoProcessingMode, + d3d11_video_context_VideoProcessorSetStreamFilter, + d3d11_video_context_VideoProcessorSetStreamExtension, + d3d11_video_context_VideoProcessorGetStreamFrameFormat, + d3d11_video_context_VideoProcessorGetStreamColorSpace, + d3d11_video_context_VideoProcessorGetStreamOutputRate, + d3d11_video_context_VideoProcessorGetStreamSourceRect, + d3d11_video_context_VideoProcessorGetStreamDestRect, + d3d11_video_context_VideoProcessorGetStreamAlpha, + d3d11_video_context_VideoProcessorGetStreamPalette, + d3d11_video_context_VideoProcessorGetStreamPixelAspectRatio, + d3d11_video_context_VideoProcessorGetStreamLumaKey, + d3d11_video_context_VideoProcessorGetStreamStereoFormat, + d3d11_video_context_VideoProcessorGetStreamAutoProcessingMode, + d3d11_video_context_VideoProcessorGetStreamFilter, + d3d11_video_context_VideoProcessorGetStreamExtension, + d3d11_video_context_VideoProcessorBlt, + d3d11_video_context_NegotiateCryptoSessionKeyExchange, + d3d11_video_context_EncryptionBlt, + d3d11_video_context_DecryptionBlt, + d3d11_video_context_StartSessionKeyRefresh, + d3d11_video_context_FinishSessionKeyRefresh, + d3d11_video_context_GetEncryptionBltKey, + d3d11_video_context_NegotiateAuthenticatedChannelKeyExchange, + d3d11_video_context_QueryAuthenticatedChannel, + d3d11_video_context_ConfigureAuthenticatedChannel, + d3d11_video_context_VideoProcessorSetStreamRotation, + d3d11_video_context_VideoProcessorGetStreamRotation, +}; + /* ID3D11Multithread methods */
static inline struct d3d11_device_context *impl_from_ID3D11Multithread(ID3D11Multithread *iface) @@ -3262,6 +3804,7 @@ static void d3d11_device_context_init(struct d3d11_device_context *context, stru { context->ID3D11DeviceContext1_iface.lpVtbl = &d3d11_device_context_vtbl; context->ID3D11Multithread_iface.lpVtbl = &d3d11_multithread_vtbl; + context->ID3D11VideoContext_iface.lpVtbl = &d3d11_video_context_vtbl; context->ID3DUserDefinedAnnotation_iface.lpVtbl = &d3d11_user_defined_annotation_vtbl; context->refcount = 1; context->type = type;
This merge request was approved by Elizabeth Figura.
This merge request was approved by Jan Sikorski.