[host] remove ATL, mingw doesn't support it

This commit is contained in:
arcnmx 2017-12-14 14:18:31 -05:00
parent 892a3970ff
commit 9a9d84cd1f
2 changed files with 29 additions and 17 deletions

View File

@ -26,11 +26,11 @@ using namespace Capture;
DXGI::DXGI() : DXGI::DXGI() :
m_options(NULL), m_options(NULL),
m_initialized(false), m_initialized(false),
m_dxgiFactory(NULL), m_dxgiFactory(),
m_device(NULL), m_device(),
m_deviceContext(NULL), m_deviceContext(),
m_dup(NULL), m_dup(),
m_texture(NULL), m_texture(),
m_pointer(NULL) m_pointer(NULL)
{ {
} }
@ -56,10 +56,10 @@ bool DXGI::Initialize(CaptureOptions * options)
} }
bool done = false; bool done = false;
CComPtr<IDXGIAdapter1> adapter; IDXGIAdapter1Ptr adapter;
for (int i = 0; m_dxgiFactory->EnumAdapters1(i, &adapter) != DXGI_ERROR_NOT_FOUND; i++) for (int i = 0; m_dxgiFactory->EnumAdapters1(i, &adapter) != DXGI_ERROR_NOT_FOUND; i++)
{ {
CComPtr<IDXGIOutput> output; IDXGIOutputPtr output;
for (int i = 0; adapter->EnumOutputs(i, &output) != DXGI_ERROR_NOT_FOUND; i++) for (int i = 0; adapter->EnumOutputs(i, &output) != DXGI_ERROR_NOT_FOUND; i++)
{ {
DXGI_OUTPUT_DESC outputDesc; DXGI_OUTPUT_DESC outputDesc;
@ -233,7 +233,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
return GRAB_STATUS_ERROR; return GRAB_STATUS_ERROR;
DXGI_OUTDUPL_FRAME_INFO frameInfo; DXGI_OUTDUPL_FRAME_INFO frameInfo;
CComPtr<IDXGIResource> res; IDXGIResourcePtr res;
HRESULT status; HRESULT status;
bool cursorUpdate = false; bool cursorUpdate = false;
@ -363,7 +363,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
return GRAB_STATUS_ERROR; return GRAB_STATUS_ERROR;
} }
CComQIPtr<ID3D11Texture2D> src = res; ID3D11Texture2DPtr src(res);
if (!src) if (!src)
{ {
m_dup->ReleaseFrame(); m_dup->ReleaseFrame();
@ -380,7 +380,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
res.Release(); res.Release();
src.Release(); src.Release();
CComQIPtr<IDXGISurface1> surface = m_texture; IDXGISurface1Ptr surface(m_texture);
if (!surface) if (!surface)
{ {
DEBUG_ERROR("Failed to get IDXGISurface1"); DEBUG_ERROR("Failed to get IDXGISurface1");

View File

@ -25,7 +25,19 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <windows.h> #include <windows.h>
#include <dxgi1_2.h> #include <dxgi1_2.h>
#include <d3d11.h> #include <d3d11.h>
#include <atlbase.h> #include <stdio.h>
#include <comdef.h>
_COM_SMARTPTR_TYPEDEF(IDXGIFactory1, IID_IDXGIFactory1);
_COM_SMARTPTR_TYPEDEF(ID3D11Device, IID_ID3D11Device);
_COM_SMARTPTR_TYPEDEF(ID3D11DeviceContext, IID_ID3D11DeviceContext);
_COM_SMARTPTR_TYPEDEF(IDXGIOutput1, IID_IDXGIOutput1);
_COM_SMARTPTR_TYPEDEF(IDXGIOutput, IID_IDXGIOutput);
_COM_SMARTPTR_TYPEDEF(IDXGIAdapter1, IID_IDXGIAdapter1);
_COM_SMARTPTR_TYPEDEF(IDXGIOutputDuplication, IID_IDXGIOutputDuplication);
_COM_SMARTPTR_TYPEDEF(ID3D11Texture2D, IID_ID3D11Texture2D);
_COM_SMARTPTR_TYPEDEF(IDXGIResource, IID_IDXGIResource);
_COM_SMARTPTR_TYPEDEF(IDXGISurface1, IID_IDXGISurface1);
namespace Capture namespace Capture
{ {
@ -61,13 +73,13 @@ namespace Capture
unsigned int m_width; unsigned int m_width;
unsigned int m_height; unsigned int m_height;
CComPtr<IDXGIFactory1> m_dxgiFactory; IDXGIFactory1Ptr m_dxgiFactory;
CComPtr<ID3D11Device> m_device; ID3D11DevicePtr m_device;
D3D_FEATURE_LEVEL m_featureLevel; D3D_FEATURE_LEVEL m_featureLevel;
CComPtr<ID3D11DeviceContext> m_deviceContext; ID3D11DeviceContextPtr m_deviceContext;
CComQIPtr<IDXGIOutput1> m_output; IDXGIOutput1Ptr m_output;
CComPtr<IDXGIOutputDuplication> m_dup; IDXGIOutputDuplicationPtr m_dup;
CComPtr<ID3D11Texture2D> m_texture; ID3D11Texture2DPtr m_texture;
BYTE * m_pointer; BYTE * m_pointer;
UINT m_pointerBufSize; UINT m_pointerBufSize;
UINT m_pointerSize; UINT m_pointerSize;