diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 703de2a8..ebba24bb 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -21,6 +21,7 @@ #include "d3d11_state_object.h" #include "d3d11_swapchain.h" #include "d3d11_texture.h" +#include "d3d11_video.h" namespace dxvk { @@ -2490,8 +2491,13 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE D3D11VideoDevice::CreateVideoProcessorEnumerator( const D3D11_VIDEO_PROCESSOR_CONTENT_DESC* pDesc, ID3D11VideoProcessorEnumerator** ppEnum) { - Logger::err("D3D11VideoDevice::CreateVideoProcessorEnumerator: Stub"); - return E_NOTIMPL; + try { + *ppEnum = ref(new D3D11VideoProcessorEnumerator(m_device, *pDesc)); + return S_OK; + } catch (const DxvkError& e) { + Logger::err(e.message()); + return E_FAIL; + } } diff --git a/src/d3d11/d3d11_video.cpp b/src/d3d11/d3d11_video.cpp new file mode 100644 index 00000000..e523a607 --- /dev/null +++ b/src/d3d11/d3d11_video.cpp @@ -0,0 +1,82 @@ +#include "d3d11_context.h" +#include "d3d11_video.h" + +namespace dxvk { + + D3D11VideoProcessorEnumerator::D3D11VideoProcessorEnumerator( + D3D11Device* pDevice, + const D3D11_VIDEO_PROCESSOR_CONTENT_DESC& Desc) + : D3D11DeviceChild(pDevice), + m_desc(Desc) { + + } + + + D3D11VideoProcessorEnumerator::~D3D11VideoProcessorEnumerator() { + + } + + + HRESULT STDMETHODCALLTYPE D3D11VideoProcessorEnumerator::QueryInterface( + REFIID riid, + void** ppvObject) { + if (riid == __uuidof(IUnknown) + || riid == __uuidof(ID3D11DeviceChild) + || riid == __uuidof(ID3D11VideoProcessorEnumerator)) { + *ppvObject = ref(this); + return S_OK; + } + + Logger::warn("D3D11VideoProcessorEnumerator::QueryInterface: Unknown interface query"); + Logger::warn(str::format(riid)); + return E_NOINTERFACE; + } + + + HRESULT STDMETHODCALLTYPE D3D11VideoProcessorEnumerator::GetVideoProcessorContentDesc( + D3D11_VIDEO_PROCESSOR_CONTENT_DESC* pContentDesc) { + *pContentDesc = m_desc; + return S_OK; + } + + + HRESULT STDMETHODCALLTYPE D3D11VideoProcessorEnumerator::CheckVideoProcessorFormat( + DXGI_FORMAT Format, + UINT* pFlags) { + Logger::err("D3D11VideoProcessorEnumerator::CheckVideoProcessorFormat: Stub"); + return E_NOTIMPL; + } + + + HRESULT STDMETHODCALLTYPE D3D11VideoProcessorEnumerator::GetVideoProcessorCaps( + D3D11_VIDEO_PROCESSOR_CAPS* pCaps) { + Logger::err("D3D11VideoProcessorEnumerator::GetVideoProcessorCaps: Stub"); + return E_NOTIMPL; + } + + + HRESULT STDMETHODCALLTYPE D3D11VideoProcessorEnumerator::GetVideoProcessorRateConversionCaps( + UINT TypeIndex, + D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS* pCaps) { + Logger::err("D3D11VideoProcessorEnumerator::GetVideoProcessorRateConversionCaps: Stub"); + return E_NOTIMPL; + } + + + HRESULT STDMETHODCALLTYPE D3D11VideoProcessorEnumerator::GetVideoProcessorCustomRate( + UINT TypeIndex, + UINT CustomRateIndex, + D3D11_VIDEO_PROCESSOR_CUSTOM_RATE* pRate) { + Logger::err("D3D11VideoProcessorEnumerator::GetVideoProcessorCustomRate: Stub"); + return E_NOTIMPL; + } + + + HRESULT STDMETHODCALLTYPE D3D11VideoProcessorEnumerator::GetVideoProcessorFilterRange( + D3D11_VIDEO_PROCESSOR_FILTER Filter, + D3D11_VIDEO_PROCESSOR_FILTER_RANGE* pRange) { + Logger::err("D3D11VideoProcessorEnumerator::GetVideoProcessorFilterRange: Stub"); + return E_NOTIMPL; + } + +} diff --git a/src/d3d11/d3d11_video.h b/src/d3d11/d3d11_video.h new file mode 100644 index 00000000..688d7b8d --- /dev/null +++ b/src/d3d11/d3d11_video.h @@ -0,0 +1,50 @@ +#pragma once + +#include "d3d11_device.h" + +namespace dxvk { + + class D3D11VideoProcessorEnumerator : public D3D11DeviceChild { + + public: + + D3D11VideoProcessorEnumerator( + D3D11Device* pDevice, + const D3D11_VIDEO_PROCESSOR_CONTENT_DESC& Desc); + + ~D3D11VideoProcessorEnumerator(); + + HRESULT STDMETHODCALLTYPE QueryInterface( + REFIID riid, + void** ppvObject); + + HRESULT STDMETHODCALLTYPE GetVideoProcessorContentDesc( + D3D11_VIDEO_PROCESSOR_CONTENT_DESC* pContentDesc); + + HRESULT STDMETHODCALLTYPE CheckVideoProcessorFormat( + DXGI_FORMAT Format, + UINT* pFlags); + + HRESULT STDMETHODCALLTYPE GetVideoProcessorCaps( + D3D11_VIDEO_PROCESSOR_CAPS* pCaps); + + HRESULT STDMETHODCALLTYPE GetVideoProcessorRateConversionCaps( + UINT TypeIndex, + D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS* pCaps); + + HRESULT STDMETHODCALLTYPE GetVideoProcessorCustomRate( + UINT TypeIndex, + UINT CustomRateIndex, + D3D11_VIDEO_PROCESSOR_CUSTOM_RATE* pRate); + + HRESULT STDMETHODCALLTYPE GetVideoProcessorFilterRange( + D3D11_VIDEO_PROCESSOR_FILTER Filter, + D3D11_VIDEO_PROCESSOR_FILTER_RANGE* pRange); + + private: + + D3D11_VIDEO_PROCESSOR_CONTENT_DESC m_desc; + + }; + +} diff --git a/src/d3d11/meson.build b/src/d3d11/meson.build index 239a51cb..ffd1f206 100644 --- a/src/d3d11/meson.build +++ b/src/d3d11/meson.build @@ -52,6 +52,7 @@ d3d11_src = [ 'd3d11_swapchain.cpp', 'd3d11_texture.cpp', 'd3d11_util.cpp', + 'd3d11_video.cpp', 'd3d11_view_dsv.cpp', 'd3d11_view_rtv.cpp', 'd3d11_view_srv.cpp',