Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkasper93 <kasper93@gmail.com>2013-10-18 17:52:10 +0400
committerUnderground78 <underground78@users.sourceforge.net>2013-10-19 20:43:11 +0400
commit52c979aca32e02c65705cb83e9b5235ae540d751 (patch)
tree699217a7ea2aacf5096f22f85b734f2df6e9e5c1 /src
parenta6062f8ede383fd09bd567b3427621a97419a61d (diff)
madVR: Hook DXVA decoder to have status and logging.
Diffstat (limited to 'src')
-rw-r--r--src/mpc-hc/FGManager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mpc-hc/FGManager.cpp b/src/mpc-hc/FGManager.cpp
index c7f517931..1e6ddd72c 100644
--- a/src/mpc-hc/FGManager.cpp
+++ b/src/mpc-hc/FGManager.cpp
@@ -40,6 +40,7 @@
#include <evr.h>
#include <evr9.h>
#include <ksproxy.h>
+#include "IPinHook.h"
#include "moreuuids.h"
//
@@ -837,6 +838,21 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender)
//pMFGS->GetService (MF_WORKQUEUE_SERVICES, IID_IMFWorkQueueServices, (void**)&pMFWQS);
//pMFWQS->BeginRegisterPlatformWorkQueueWithMMCSS(
+ if (pMadVRAllocatorPresenter) {
+ // Hook DXVA to have status and logging.
+ CComPtr<IDirectXVideoDecoderService> pDecoderService;
+ CComPtr<IDirect3DDeviceManager9> pDeviceManager;
+ HANDLE hDevice = INVALID_HANDLE_VALUE;
+
+ if (SUCCEEDED(pMFGS->GetService(MR_VIDEO_ACCELERATION_SERVICE, IID_PPV_ARGS(&pDeviceManager)))
+ && SUCCEEDED(pDeviceManager->OpenDeviceHandle(&hDevice))
+ && SUCCEEDED(pDeviceManager->GetVideoService(hDevice, IID_PPV_ARGS(&pDecoderService)))) {
+ HookDirectXVideoDecoderService(pDecoderService);
+ pDeviceManager->CloseDeviceHandle(hDevice);
+ }
+ pDeviceManager.Release();
+ pDecoderService.Release();
+ }
}
return hr;