[host] removed MTMemcpy, overheads negate performance gains

This commit is contained in:
Geoffrey McRae 2017-11-15 18:12:13 +11:00
parent 5899508a5b
commit fcf0976081
4 changed files with 2 additions and 27 deletions

View File

@ -163,12 +163,6 @@ bool DXGI::Initialize()
DeInitialize();
return false;
}
if (!m_memcpy.Initialize())
{
DEBUG_ERROR("Failed to initialize memcpy");
return false;
}
m_initialized = true;
return true;
@ -176,8 +170,6 @@ bool DXGI::Initialize()
void DXGI::DeInitialize()
{
m_memcpy.DeInitialize();
if (m_pointer)
{
delete[] m_pointer;
@ -358,7 +350,7 @@ bool DXGI::GrabFrame(FrameInfo & frame)
frame.stride = rect.Pitch / 4;
frame.outSize = min(frame.bufferSize, m_height * rect.Pitch);
m_memcpy.Copy(frame.buffer, rect.pBits, frame.outSize);
memcpy_s(frame.buffer, frame.bufferSize, rect.pBits, frame.outSize);
status = surface->Unmap();
// if we have a mouse update

View File

@ -19,7 +19,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#pragma once
#include "ICapture.h"
#include "MTMemcpy.h"
#define W32_LEAN_AND_MEAN
#include <windows.h>
@ -45,7 +44,6 @@ namespace Capture
bool ReInitialize();
bool m_initialized;
MTMemcpy m_memcpy;
unsigned int m_width;
unsigned int m_height;

View File

@ -150,21 +150,12 @@ bool NvFBC::Initialize()
m_grabFrameParams.eGMode = NVFBC_TOSYS_SOURCEMODE_SCALE;
m_grabFrameParams.pNvFBCFrameGrabInfo = &m_grabInfo;
if (!m_memcpy.Initialize())
{
DEBUG_ERROR("Failed to initialize MTMemcpy");
DeInitialize();
return false;
}
m_initialized = true;
return true;
}
void NvFBC::DeInitialize()
{
m_memcpy.DeInitialize();
m_frameBuffer = NULL;
if (m_nvFBC)
@ -233,11 +224,7 @@ bool NvFBC::GrabFrame(struct FrameInfo & frame)
frame.height = m_grabInfo.dwHeight;
frame.stride = m_grabInfo.dwBufferWidth;
frame.outSize = m_grabInfo.dwBufferWidth * m_grabInfo.dwHeight * 3;
if (!m_memcpy.Copy(frame.buffer, m_frameBuffer, frame.outSize))
{
DEBUG_ERROR("Memory copy failed");
return false;
}
memcpy_s(frame.buffer, frame.bufferSize, m_frameBuffer, frame.outSize);
return true;
}

View File

@ -18,7 +18,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#pragma once
#include "ICapture.h"
#include "MTMemcpy.h"
#define W32_LEAN_AND_MEAN
#include <Windows.h>
@ -44,7 +43,6 @@ namespace Capture
private:
bool m_initialized;
HMODULE m_hDLL;
MTMemcpy m_memcpy;
NvFBC_CreateFunctionExType m_fnCreateEx;
NvFBC_SetGlobalFlagsType m_fnSetGlobalFlags;