mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-29 18:16:29 +00:00
[c-host] nvfbc: do not send frames that have not changed
This commit is contained in:
parent
60acc3ef44
commit
fc6681306e
@ -46,6 +46,7 @@ struct iface
|
|||||||
unsigned int width , height;
|
unsigned int width , height;
|
||||||
|
|
||||||
uint8_t * frameBuffer;
|
uint8_t * frameBuffer;
|
||||||
|
uint8_t * diffMap;
|
||||||
|
|
||||||
NvFBCFrameGrabInfo grabInfo;
|
NvFBCFrameGrabInfo grabInfo;
|
||||||
|
|
||||||
@ -168,10 +169,10 @@ static bool nvfbc_init()
|
|||||||
BUFFER_FMT_ARGB,
|
BUFFER_FMT_ARGB,
|
||||||
!this->seperateCursor,
|
!this->seperateCursor,
|
||||||
this->seperateCursor,
|
this->seperateCursor,
|
||||||
false,
|
true,
|
||||||
0,
|
DIFFMAP_BLOCKSIZE_128X128,
|
||||||
(void **)&this->frameBuffer,
|
(void **)&this->frameBuffer,
|
||||||
NULL,
|
(void **)&this->diffMap,
|
||||||
&event
|
&event
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
@ -256,6 +257,18 @@ static CaptureResult nvfbc_capture()
|
|||||||
if (result != CAPTURE_RESULT_OK)
|
if (result != CAPTURE_RESULT_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
for(unsigned int y = 0; y < this->height / 128; ++y)
|
||||||
|
for(unsigned int x = 0; x < this->width / 128; ++x)
|
||||||
|
if (this->diffMap[x*y])
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!changed)
|
||||||
|
return CAPTURE_RESULT_TIMEOUT;
|
||||||
|
|
||||||
memcpy(&this->grabInfo, &grabInfo, sizeof(grabInfo));
|
memcpy(&this->grabInfo, &grabInfo, sizeof(grabInfo));
|
||||||
lgSignalEvent(this->frameEvent);
|
lgSignalEvent(this->frameEvent);
|
||||||
return CAPTURE_RESULT_OK;
|
return CAPTURE_RESULT_OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user