|
|
|
@ -55,15 +55,15 @@ |
|
|
|
|
#include <windows.h> |
|
|
|
|
#include <guiddef.h> |
|
|
|
|
#include <mfidl.h> |
|
|
|
|
#include <Mfapi.h> |
|
|
|
|
#include <mfapi.h> |
|
|
|
|
#include <mfplay.h> |
|
|
|
|
#include <mfobjects.h> |
|
|
|
|
#include <tchar.h> |
|
|
|
|
#include <strsafe.h> |
|
|
|
|
#include <Mfreadwrite.h> |
|
|
|
|
#ifdef HAVE_DXVA |
|
|
|
|
#include <D3D11.h> |
|
|
|
|
#include <D3d11_4.h> |
|
|
|
|
#ifdef HAVE_MSMF_DXVA |
|
|
|
|
#include <d3d11.h> |
|
|
|
|
#include <d3d11_4.h> |
|
|
|
|
#endif |
|
|
|
|
#include <new> |
|
|
|
|
#include <map> |
|
|
|
@ -81,7 +81,7 @@ |
|
|
|
|
#pragma comment(lib, "mfuuid") |
|
|
|
|
#pragma comment(lib, "Strmiids") |
|
|
|
|
#pragma comment(lib, "Mfreadwrite") |
|
|
|
|
#ifdef HAVE_DXVA |
|
|
|
|
#ifdef HAVE_MSMF_DXVA |
|
|
|
|
#pragma comment(lib, "d3d11") |
|
|
|
|
// MFCreateDXGIDeviceManager() is available since Win8 only.
|
|
|
|
|
// To avoid OpenCV loading failure on Win7 use dynamic detection of this symbol.
|
|
|
|
@ -710,7 +710,7 @@ protected: |
|
|
|
|
cv::String filename; |
|
|
|
|
int camid; |
|
|
|
|
MSMFCapture_Mode captureMode; |
|
|
|
|
#ifdef HAVE_DXVA |
|
|
|
|
#ifdef HAVE_MSMF_DXVA |
|
|
|
|
_ComPtr<ID3D11Device> D3DDev; |
|
|
|
|
_ComPtr<IMFDXGIDeviceManager> D3DMgr; |
|
|
|
|
#endif |
|
|
|
@ -735,7 +735,7 @@ CvCapture_MSMF::CvCapture_MSMF(): |
|
|
|
|
filename(""), |
|
|
|
|
camid(-1), |
|
|
|
|
captureMode(MODE_SW), |
|
|
|
|
#ifdef HAVE_DXVA |
|
|
|
|
#ifdef HAVE_MSMF_DXVA |
|
|
|
|
D3DDev(NULL), |
|
|
|
|
D3DMgr(NULL), |
|
|
|
|
#endif |
|
|
|
@ -774,7 +774,7 @@ void CvCapture_MSMF::close() |
|
|
|
|
|
|
|
|
|
bool CvCapture_MSMF::configureHW(bool enable) |
|
|
|
|
{ |
|
|
|
|
#ifdef HAVE_DXVA |
|
|
|
|
#ifdef HAVE_MSMF_DXVA |
|
|
|
|
if ((enable && D3DMgr && D3DDev) || (!enable && !D3DMgr && !D3DDev)) |
|
|
|
|
return true; |
|
|
|
|
if (!pMFCreateDXGIDeviceManager_initialized) |
|
|
|
@ -971,7 +971,7 @@ bool CvCapture_MSMF::open(int _index) |
|
|
|
|
SUCCEEDED(srAttr->SetUINT32(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, FALSE)) && |
|
|
|
|
SUCCEEDED(srAttr->SetUINT32(MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING, TRUE))) |
|
|
|
|
{ |
|
|
|
|
#ifdef HAVE_DXVA |
|
|
|
|
#ifdef HAVE_MSMF_DXVA |
|
|
|
|
if (D3DMgr) |
|
|
|
|
srAttr->SetUnknown(MF_SOURCE_READER_D3D_MANAGER, D3DMgr.Get()); |
|
|
|
|
#endif |
|
|
|
@ -1022,7 +1022,7 @@ bool CvCapture_MSMF::open(const cv::String& _filename) |
|
|
|
|
SUCCEEDED(srAttr->SetUINT32(MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING, true)) |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
#ifdef HAVE_DXVA |
|
|
|
|
#ifdef HAVE_MSMF_DXVA |
|
|
|
|
if(D3DMgr) |
|
|
|
|
srAttr->SetUnknown(MF_SOURCE_READER_D3D_MANAGER, D3DMgr.Get()); |
|
|
|
|
#endif |
|
|
|
|