1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-11 04:29:15 +01:00

[d3d11] Add ID3D11VideoProcessor stub

This commit is contained in:
Philip Rebohle 2021-05-04 17:42:41 +02:00
parent bdb7eef874
commit 09cf2cd11e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 83 additions and 2 deletions

View File

@ -2436,8 +2436,14 @@ namespace dxvk {
ID3D11VideoProcessorEnumerator* pEnum,
UINT RateConversionIndex,
ID3D11VideoProcessor** ppVideoProcessor) {
Logger::err("D3D11VideoDevice::CreateVideoProcessor: Stub");
return E_NOTIMPL;
try {
auto enumerator = static_cast<D3D11VideoProcessorEnumerator*>(pEnum);
*ppVideoProcessor = ref(new D3D11VideoProcessor(m_device, enumerator, RateConversionIndex));
return S_OK;
} catch (const DxvkError& e) {
Logger::err(e.message());
return E_FAIL;
}
}

View File

@ -79,4 +79,49 @@ namespace dxvk {
return E_NOTIMPL;
}
D3D11VideoProcessor::D3D11VideoProcessor(
D3D11Device* pDevice,
D3D11VideoProcessorEnumerator* pEnumerator,
UINT RateConversionIndex)
: D3D11DeviceChild<ID3D11VideoProcessor>(pDevice),
m_enumerator(pEnumerator), m_rateConversionIndex(RateConversionIndex) {
}
D3D11VideoProcessor::~D3D11VideoProcessor() {
}
HRESULT STDMETHODCALLTYPE D3D11VideoProcessor::QueryInterface(
REFIID riid,
void** ppvObject) {
if (riid == __uuidof(IUnknown)
|| riid == __uuidof(ID3D11DeviceChild)
|| riid == __uuidof(ID3D11VideoProcessor)) {
*ppvObject = ref(this);
return S_OK;
}
Logger::warn("D3D11VideoProcessor::QueryInterface: Unknown interface query");
Logger::warn(str::format(riid));
return E_NOINTERFACE;
}
void STDMETHODCALLTYPE D3D11VideoProcessor::GetContentDesc(
D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc) {
m_enumerator->GetVideoProcessorContentDesc(pDesc);
}
void STDMETHODCALLTYPE D3D11VideoProcessor::GetRateConversionCaps(
D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps) {
m_enumerator->GetVideoProcessorRateConversionCaps(m_rateConversionIndex, pCaps);
}
}

View File

@ -47,4 +47,34 @@ namespace dxvk {
};
class D3D11VideoProcessor : public D3D11DeviceChild<ID3D11VideoProcessor> {
public:
D3D11VideoProcessor(
D3D11Device* pDevice,
D3D11VideoProcessorEnumerator* pEnumerator,
UINT RateConversionIndex);
~D3D11VideoProcessor();
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject);
void STDMETHODCALLTYPE GetContentDesc(
D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc);
void STDMETHODCALLTYPE GetRateConversionCaps(
D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps);
private:
D3D11VideoProcessorEnumerator* m_enumerator;
uint32_t m_rateConversionIndex;
};
}