CNullVideoRendererInputPin::CNullVideoRendererInputPin(CBaseRenderer* pRenderer, HRESULT* phr, LPCWSTR Name) : CRendererInputPin(pRenderer, phr, Name) , m_hDXVA2Lib(nullptr) , pfDXVA2CreateDirect3DDeviceManager9(nullptr) , pfDXVA2CreateVideoService(nullptr) , m_pD3DDev(nullptr) , m_pD3DDeviceManager(nullptr) , m_nResetToken(0) , m_hDevice(INVALID_HANDLE_VALUE) { CreateSurface(); m_hDXVA2Lib = LoadLibrary(L"dxva2.dll"); if (m_hDXVA2Lib) { pfDXVA2CreateDirect3DDeviceManager9 = reinterpret_cast<PTR_DXVA2CreateDirect3DDeviceManager9>(GetProcAddress(m_hDXVA2Lib, "DXVA2CreateDirect3DDeviceManager9")); pfDXVA2CreateVideoService = reinterpret_cast<PTR_DXVA2CreateVideoService>(GetProcAddress(m_hDXVA2Lib, "DXVA2CreateVideoService")); pfDXVA2CreateDirect3DDeviceManager9(&m_nResetToken, &m_pD3DDeviceManager); } // Initialize Device Manager with DX surface if (m_pD3DDev) { m_pD3DDeviceManager->ResetDevice(m_pD3DDev, m_nResetToken); m_pD3DDeviceManager->OpenDeviceHandle(&m_hDevice); } }
CNullVideoRendererInputPin::CNullVideoRendererInputPin(CBaseRenderer *pRenderer, HRESULT *phr, LPCWSTR Name) : CRendererInputPin(pRenderer, phr, Name) { HMODULE hLib; CreateSurface(); hLib = LoadLibrary (L"dxva2.dll"); pfDXVA2CreateDirect3DDeviceManager9 = hLib ? (PTR_DXVA2CreateDirect3DDeviceManager9) GetProcAddress (hLib, "DXVA2CreateDirect3DDeviceManager9") : NULL; pfDXVA2CreateVideoService = hLib ? (PTR_DXVA2CreateVideoService) GetProcAddress (hLib, "DXVA2CreateVideoService") : NULL; if (hLib != NULL) { pfDXVA2CreateDirect3DDeviceManager9 (&m_nResetTocken, &m_pD3DDeviceManager); } // Initialize Device Manager with DX surface if (m_pD3DDev) { HRESULT hr; hr = m_pD3DDeviceManager->ResetDevice (m_pD3DDev, m_nResetTocken); hr = m_pD3DDeviceManager->OpenDeviceHandle(&m_hDevice); } }