|
|
@ -445,12 +445,12 @@ class videoDevice{ |
|
|
|
int nFramesForReconnect; |
|
|
|
int nFramesForReconnect; |
|
|
|
unsigned long nFramesRunning; |
|
|
|
unsigned long nFramesRunning; |
|
|
|
int connection; |
|
|
|
int connection; |
|
|
|
int storeConn; |
|
|
|
int storeConn; |
|
|
|
int myID; |
|
|
|
int myID; |
|
|
|
long requestedFrameTime; //ie fps
|
|
|
|
long requestedFrameTime; //ie fps
|
|
|
|
|
|
|
|
|
|
|
|
char nDeviceName[255]; |
|
|
|
char nDeviceName[255]; |
|
|
|
WCHAR wDeviceName[255]; |
|
|
|
WCHAR wDeviceName[255]; |
|
|
|
|
|
|
|
|
|
|
|
unsigned char * pixels; |
|
|
|
unsigned char * pixels; |
|
|
|
char * pBuffer; |
|
|
|
char * pBuffer; |
|
|
@ -643,7 +643,7 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
bufferSetup = false; |
|
|
|
bufferSetup = false; |
|
|
|
newFrame = false; |
|
|
|
newFrame = false; |
|
|
|
latestBufferLength = 0; |
|
|
|
latestBufferLength = 0; |
|
|
|
|
|
|
|
|
|
|
|
hEvent = CreateEvent(NULL, true, false, NULL); |
|
|
|
hEvent = CreateEvent(NULL, true, false, NULL); |
|
|
|
} |
|
|
|
} |
|
|
@ -655,7 +655,7 @@ public: |
|
|
|
DeleteCriticalSection(&critSection); |
|
|
|
DeleteCriticalSection(&critSection); |
|
|
|
CloseHandle(hEvent); |
|
|
|
CloseHandle(hEvent); |
|
|
|
if(bufferSetup){ |
|
|
|
if(bufferSetup){ |
|
|
|
delete pixels; |
|
|
|
delete[] pixels; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -665,11 +665,11 @@ public: |
|
|
|
if(bufferSetup){ |
|
|
|
if(bufferSetup){ |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
numBytes = numBytesIn; |
|
|
|
numBytes = numBytesIn; |
|
|
|
pixels = new unsigned char[numBytes]; |
|
|
|
pixels = new unsigned char[numBytes]; |
|
|
|
bufferSetup = true; |
|
|
|
bufferSetup = true; |
|
|
|
newFrame = false; |
|
|
|
newFrame = false; |
|
|
|
latestBufferLength = 0; |
|
|
|
latestBufferLength = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -796,12 +796,12 @@ void videoDevice::setSize(int w, int h){ |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
width = w; |
|
|
|
width = w; |
|
|
|
height = h; |
|
|
|
height = h; |
|
|
|
videoSize = w*h*3; |
|
|
|
videoSize = w*h*3; |
|
|
|
sizeSet = true; |
|
|
|
sizeSet = true; |
|
|
|
pixels = new unsigned char[videoSize]; |
|
|
|
pixels = new unsigned char[videoSize]; |
|
|
|
pBuffer = new char[videoSize]; |
|
|
|
pBuffer = new char[videoSize]; |
|
|
|
|
|
|
|
|
|
|
|
memset(pixels, 0 , videoSize); |
|
|
|
memset(pixels, 0 , videoSize); |
|
|
|
sgCallback->setupBuffer(videoSize); |
|
|
|
sgCallback->setupBuffer(videoSize); |
|
|
|