Skip to content

Commit

Permalink
Merge branch 'master' into subpic
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lt committed Dec 23, 2024
2 parents 8d683c5 + f72a9eb commit 4fd78b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
11 changes: 3 additions & 8 deletions Source/DX11VideoProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,6 @@ HRESULT CDX11VideoProcessor::Init(const HWND hwnd, const bool displayHdrChanged,
}
m_nCurrentAdapter = currentAdapter;

if (m_bDecoderDevice && m_pDXGISwapChain1) {
return S_OK;
}

ReleaseSwapChain();
m_pDXGIFactory2.Release();
ReleaseDevice();
Expand Down Expand Up @@ -623,7 +619,7 @@ HRESULT CDX11VideoProcessor::Init(const HWND hwnd, const bool displayHdrChanged,

DLog(L"CDX11VideoProcessor::Init() : D3D11CreateDevice() successfully with feature level {}.{}", (featurelevel >> 12), (featurelevel >> 8) & 0xF);

hr = SetDevice(pDevice, nullptr, false);
hr = SetDevice(pDevice, nullptr);
pDevice->Release();

if (S_OK == hr) {
Expand Down Expand Up @@ -1155,7 +1151,7 @@ HRESULT CDX11VideoProcessor::MemCopyToTexSrcVideo(const BYTE* srcData, const int
return hr;
}

HRESULT CDX11VideoProcessor::SetDevice(ID3D11Device *pDevice, ID3D11DeviceContext *pContext, const bool bDecoderDevice)
HRESULT CDX11VideoProcessor::SetDevice(ID3D11Device *pDevice, ID3D11DeviceContext *pContext)
{
DLog(L"CDX11VideoProcessor::SetDevice()");

Expand Down Expand Up @@ -1342,10 +1338,9 @@ HRESULT CDX11VideoProcessor::SetDevice(ID3D11Device *pDevice, ID3D11DeviceContex
}
}

m_bDecoderDevice = bDecoderDevice;

m_pFilter->OnDisplayModeChange();
UpdateStatsStatic();
UpdateStatsByWindow();
UpdateStatsByDisplay();

return hr;
Expand Down
3 changes: 1 addition & 2 deletions Source/DX11VideoProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class CDX11VideoProcessor
CD3D11Lines m_Lines;
CD3D11Polyline m_SyncLine;

bool m_bDecoderDevice = false;
bool m_bIsFullscreen = false;

int m_iVPSuperRes = SUPERRES_Disable;
Expand Down Expand Up @@ -224,7 +223,7 @@ class CDX11VideoProcessor
bool HandleHDRToggle();

public:
HRESULT SetDevice(ID3D11Device *pDevice, ID3D11DeviceContext *pContext, const bool bDecoderDevice);
HRESULT SetDevice(ID3D11Device *pDevice, ID3D11DeviceContext *pContext);
HRESULT InitSwapChain(bool bWindowChanged);

BOOL VerifyMediaType(const CMediaType* pmt) override;
Expand Down
2 changes: 1 addition & 1 deletion Source/VideoRendererInputPin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ STDMETHODIMP CVideoRendererInputPin::ActivateD3D11Decoding(ID3D11Device *pDevice
HRESULT hr = E_FAIL;
if (m_pBaseRenderer->m_VideoProcessor->Type() == VP_DX11) {
if (auto pDX11VP = dynamic_cast<CDX11VideoProcessor*>(m_pBaseRenderer->m_VideoProcessor.get())) {
hr = pDX11VP->SetDevice(pDevice, pContext, true);
hr = pDX11VP->SetDevice(pDevice, pContext);
}
}
m_bD3D11 = (hr == S_OK);
Expand Down

0 comments on commit 4fd78b3

Please sign in to comment.