[host] added multi-threaded memcopy for high resolutions

This commit is contained in:
Geoffrey McRae
2017-12-21 13:48:57 +11:00
parent a08aad8009
commit 43b096a5e7
8 changed files with 140 additions and 76 deletions

View File

@@ -21,7 +21,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
using namespace Capture;
#include "common/debug.h"
#include "common/memcpySSE.h"
DXGI::DXGI() :
m_options(NULL),
@@ -33,11 +32,11 @@ DXGI::DXGI() :
m_texture(),
m_pointer(NULL)
{
}
DXGI::~DXGI()
{
}
bool DXGI::Initialize(CaptureOptions * options)
@@ -310,7 +309,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
frame.stride = m_mapping.RowPitch / 4;
unsigned int size = m_height * m_mapping.RowPitch;
memcpySSE(frame.buffer, m_mapping.pData, size < frame.bufferSize ? size : frame.bufferSize);
m_memcpy.Copy(frame.buffer, m_mapping.pData, size < frame.bufferSize ? size : frame.bufferSize);
return GRAB_STATUS_OK;
}
@@ -448,7 +447,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
frame.stride = m_mapping.RowPitch / 4;
unsigned int size = m_height * m_mapping.RowPitch;
memcpySSE(frame.buffer, m_mapping.pData, size < frame.bufferSize ? size : frame.bufferSize);
m_memcpy.Copy(frame.buffer, m_mapping.pData, size < frame.bufferSize ? size : frame.bufferSize);
return GRAB_STATUS_OK;
}

View File

@@ -20,6 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#pragma once
#include "ICapture.h"
#include "MultiMemcpy.h"
#define W32_LEAN_AND_MEAN
#include <windows.h>
@@ -75,6 +76,7 @@ namespace Capture
unsigned int m_width;
unsigned int m_height;
MultiMemcpy m_memcpy;
IDXGIFactory1Ptr m_dxgiFactory;
ID3D11DevicePtr m_device;
D3D_FEATURE_LEVEL m_featureLevel;