[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() :
m_options(NULL),
m_initialized(false),
m_dxgiFactory(NULL),
m_device(NULL),
m_deviceContext(NULL),
m_dup(NULL),
m_texture(NULL),
m_dxgiFactory(),
m_device(),
m_deviceContext(),
m_dup(),
m_texture(),
m_pointer(NULL)
{
}
@ -56,10 +56,10 @@ bool DXGI::Initialize(CaptureOptions * options)
}
bool done = false;
CComPtr<IDXGIAdapter1> adapter;
IDXGIAdapter1Ptr adapter;
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++)
{
DXGI_OUTPUT_DESC outputDesc;
@ -233,7 +233,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
return GRAB_STATUS_ERROR;
DXGI_OUTDUPL_FRAME_INFO frameInfo;
CComPtr<IDXGIResource> res;
IDXGIResourcePtr res;
HRESULT status;
bool cursorUpdate = false;
@ -363,7 +363,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
return GRAB_STATUS_ERROR;
}
CComQIPtr<ID3D11Texture2D> src = res;
ID3D11Texture2DPtr src(res);
if (!src)
{
m_dup->ReleaseFrame();
@ -380,7 +380,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
res.Release();
src.Release();
CComQIPtr<IDXGISurface1> surface = m_texture;
IDXGISurface1Ptr surface(m_texture);
if (!surface)
{
DEBUG_ERROR("Failed to get IDXGISurface1");

View File

@ -25,7 +25,19 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <windows.h>
#include <dxgi1_2.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
{
@ -61,13 +73,13 @@ namespace Capture
unsigned int m_width;
unsigned int m_height;
CComPtr<IDXGIFactory1> m_dxgiFactory;
CComPtr<ID3D11Device> m_device;
IDXGIFactory1Ptr m_dxgiFactory;
ID3D11DevicePtr m_device;
D3D_FEATURE_LEVEL m_featureLevel;
CComPtr<ID3D11DeviceContext> m_deviceContext;
CComQIPtr<IDXGIOutput1> m_output;
CComPtr<IDXGIOutputDuplication> m_dup;
CComPtr<ID3D11Texture2D> m_texture;
ID3D11DeviceContextPtr m_deviceContext;
IDXGIOutput1Ptr m_output;
IDXGIOutputDuplicationPtr m_dup;
ID3D11Texture2DPtr m_texture;
BYTE * m_pointer;
UINT m_pointerBufSize;
UINT m_pointerSize;