mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-02-23 11:51:22 +00:00
[host] fixed incorrect checking of difference map
This commit is contained in:
parent
2d5b633397
commit
51bc7631ab
2 changed files with 12 additions and 8 deletions
|
@ -140,6 +140,7 @@ bool NvFBC::Initialize(CaptureOptions * options)
|
||||||
setupParams.eMode = NVFBC_TOSYS_ARGB;
|
setupParams.eMode = NVFBC_TOSYS_ARGB;
|
||||||
setupParams.bWithHWCursor = TRUE;
|
setupParams.bWithHWCursor = TRUE;
|
||||||
setupParams.bDiffMap = TRUE;
|
setupParams.bDiffMap = TRUE;
|
||||||
|
setupParams.eDiffMapBlockSize = (NvU32)NVFBC_TOSYS_DIFFMAP_BLOCKSIZE_128X128;
|
||||||
setupParams.ppBuffer = (void **)&m_frameBuffer;
|
setupParams.ppBuffer = (void **)&m_frameBuffer;
|
||||||
setupParams.ppDiffMap = (void **)&m_diffMap;
|
setupParams.ppDiffMap = (void **)&m_diffMap;
|
||||||
|
|
||||||
|
@ -226,9 +227,12 @@ bool NvFBC::GrabFrame(struct FrameInfo & frame)
|
||||||
|
|
||||||
if (status == NVFBC_SUCCESS)
|
if (status == NVFBC_SUCCESS)
|
||||||
{
|
{
|
||||||
|
const int diffW = (m_grabInfo.dwWidth + 0x7F) >> 7;
|
||||||
|
const int diffH = (m_grabInfo.dwHeight + 0x7F) >> 7;
|
||||||
bool hasDiff = false;
|
bool hasDiff = false;
|
||||||
for (int r = (m_grabInfo.dwWidth * m_grabInfo.dwHeight) / (128 * 128); r >= 0; --r)
|
for(int y = 0; y < diffH && !hasDiff; ++y)
|
||||||
if (*((uint8_t*)m_diffMap + r))
|
for (int x = 0; x < diffW; ++x)
|
||||||
|
if (m_diffMap[y * diffW + x])
|
||||||
{
|
{
|
||||||
hasDiff = true;
|
hasDiff = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -57,8 +57,8 @@ namespace Capture
|
||||||
|
|
||||||
DWORD m_maxCaptureWidth, m_maxCaptureHeight;
|
DWORD m_maxCaptureWidth, m_maxCaptureHeight;
|
||||||
NvFBCToSys * m_nvFBC;
|
NvFBCToSys * m_nvFBC;
|
||||||
void * m_frameBuffer;
|
uint8_t * m_frameBuffer;
|
||||||
void * m_diffMap;
|
uint8_t * m_diffMap;
|
||||||
NvFBCFrameGrabInfo m_grabInfo;
|
NvFBCFrameGrabInfo m_grabInfo;
|
||||||
NVFBC_TOSYS_GRAB_FRAME_PARAMS m_grabFrameParams;
|
NVFBC_TOSYS_GRAB_FRAME_PARAMS m_grabFrameParams;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue