Hi. I decided to use Playstation3 Eye camera in my app (optical tracker). I put all the code in place, but managed to get one frame only . After this CLEyeCameraGetFrame returns false all the times :( . I am running under Win32 XP SP3. I have written a separate test app that exposed same problem. here is the listing of the app. Could someone test it and see if it runs. Ideally someone would say “You need to do this and that”
I can run compiled examples that come with the SDK and they run ok as fas as I can tell.
Here is the test code:
#include "stdafx.h"
#include <crtdbg.h>
#ifdef DEBUG
#define VERIFY ASSERT
#else
#define VERIFY
#endif // DEBUG
void TestCam()
{
GUID cameraGUID = CLEyeGetCameraUUID(0);
CLEyeCameraInstance hCamera = CLEyeCreateCamera(cameraGUID, CLEYE_COLOR_RAW, CLEYE_VGA, 60);
ASSERT(hCamera);
// Get camera frame dimensions
int w,h;
VERIFY( CLEyeCameraGetFrameDimensions(hCamera, w, h ) );
PBYTE pCapBuffer = new BYTE[w*h*4];
// Set some camera parameters
VERIFY( CLEyeSetCameraParameter(hCamera, CLEYE_GAIN, 0) );
VERIFY( CLEyeSetCameraParameter(hCamera, CLEYE_EXPOSURE, 511) );
// Start capturing
VERIFY( CLEyeCameraStart(hCamera) );
// image capturing loop
while(GetAsyncKeyState(VK_ESCAPE) >= 0 )
{
// Capture camera images
if( !CLEyeCameraGetFrame(hCamera, pCapBuffer, 2000) )
{
continue;
}
::OutputDebugStr("Frame!\n");
}
VERIFY( CLEyeCameraStop(hCamera) );
// Destroy camera object
VERIFY( CLEyeDestroyCamera(hCamera) );
hCamera = NULL;
// Destroy the allocated image
delete pCapBuffer;
pCapBuffer = NULL;
}
Edit: As a matter of fact the code above does work when firstly started. Strangely if I put a breakpoint at the line
::OutputDebugStr(“Frame!\n”);
and let the debugger wait for couple of seconds the image stream ends and no no more images are received.