mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[host] reversed the cropping logic, likely not needed anymore
This commit is contained in:
parent
a61293b551
commit
7f3657e5f0
@ -33,7 +33,7 @@ using namespace Capture;
|
|||||||
|
|
||||||
NvFBC::NvFBC() :
|
NvFBC::NvFBC() :
|
||||||
m_options(NULL),
|
m_options(NULL),
|
||||||
m_optNoCrop(false),
|
m_optCrop(false),
|
||||||
m_optNoWait(false),
|
m_optNoWait(false),
|
||||||
m_initialized(false),
|
m_initialized(false),
|
||||||
m_hDLL(NULL),
|
m_hDLL(NULL),
|
||||||
@ -51,10 +51,10 @@ bool NvFBC::Initialize(CaptureOptions * options)
|
|||||||
DeInitialize();
|
DeInitialize();
|
||||||
|
|
||||||
m_options = options;
|
m_options = options;
|
||||||
m_optNoCrop = false;
|
m_optCrop = false;
|
||||||
for (CaptureOptions::const_iterator it = options->cbegin(); it != options->cend(); ++it)
|
for (CaptureOptions::const_iterator it = options->cbegin(); it != options->cend(); ++it)
|
||||||
{
|
{
|
||||||
if (_strcmpi(*it, "nocrop") == 0) { m_optNoCrop = true; continue; }
|
if (_strcmpi(*it, "crop" ) == 0) { m_optCrop = true; continue; }
|
||||||
if (_strcmpi(*it, "nowait") == 0) { m_optNoWait = true; continue; }
|
if (_strcmpi(*it, "nowait") == 0) { m_optNoWait = true; continue; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,15 +249,7 @@ enum GrabStatus NvFBC::GrabFrame(struct FrameInfo & frame)
|
|||||||
unsigned int dataWidth;
|
unsigned int dataWidth;
|
||||||
unsigned int dataOffset;
|
unsigned int dataOffset;
|
||||||
|
|
||||||
if (m_optNoCrop)
|
if (m_optCrop)
|
||||||
{
|
|
||||||
dataWidth = m_grabInfo.dwWidth * 4;
|
|
||||||
dataOffset = 0;
|
|
||||||
|
|
||||||
frame.width = m_grabInfo.dwWidth;
|
|
||||||
frame.height = m_grabInfo.dwHeight;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
const unsigned int realHeight = min(m_grabInfo.dwHeight, screenHeight);
|
const unsigned int realHeight = min(m_grabInfo.dwHeight, screenHeight);
|
||||||
const unsigned int realWidth = min(m_grabInfo.dwWidth, screenWidth);
|
const unsigned int realWidth = min(m_grabInfo.dwWidth, screenWidth);
|
||||||
@ -269,6 +261,14 @@ enum GrabStatus NvFBC::GrabFrame(struct FrameInfo & frame)
|
|||||||
frame.width = realWidth;
|
frame.width = realWidth;
|
||||||
frame.height = realHeight;
|
frame.height = realHeight;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataWidth = m_grabInfo.dwWidth * 4;
|
||||||
|
dataOffset = 0;
|
||||||
|
|
||||||
|
frame.width = m_grabInfo.dwWidth;
|
||||||
|
frame.height = m_grabInfo.dwHeight;
|
||||||
|
}
|
||||||
|
|
||||||
frame.stride = frame.width;
|
frame.stride = frame.width;
|
||||||
frame.outSize = frame.width * frame.height * 4;
|
frame.outSize = frame.width * frame.height * 4;
|
||||||
|
@ -49,7 +49,7 @@ namespace Capture
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
CaptureOptions * m_options;
|
CaptureOptions * m_options;
|
||||||
bool m_optNoCrop;
|
bool m_optCrop;
|
||||||
bool m_optNoWait;
|
bool m_optNoWait;
|
||||||
|
|
||||||
bool m_initialized;
|
bool m_initialized;
|
||||||
|
Loading…
Reference in New Issue
Block a user