Page 1 of 1

After Shutdown(), WaitForInitialization() fails

Posted: Thu Jan 02, 2014 1:37 pm
by hwang
Please correct me if my understanding of using CameraSDK is wrong.

So, the regular routine to use CameraSDK is:

Code: Select all

#include "cameralibrary.h"
using namespace CameraLibrary;

CameraManager::X().WaitForInitialization();

Camera *camera = CameraManager::X().GetCamera();
if(!camera)
{
  // failure
}

camera->Start();
// ... Do the work
camera->Stop();
camera->Release();
CameraManager::X().Shutdown();
I noticed that, after shut down Camera Library (the last line), if we call "CameraManager::X().WaitForInitialization();" again, error occurs:
"
Unhandled exception at 0xfeeefeee in test.exe: 0xC0000005: Access violation.
"




Also, before calling "CameraManager::X().WaitForInitialization();" (line 3 in above example), "CameraLibrary::CameraManager::X().AreCamerasShutdown()" will return "False".
Logically, shouldn't it return "True"?



Another observation is that, after shut down the camera library (the last line in above example), "CameraLibrary::CameraManager::X().AreCamerasInitialized()" will return "True".
Shouldn't it return "False"?



Any help/info will be appreciated.
Thanks!

Re: After Shutdown(), WaitForInitialization() fails

Posted: Fri Jan 03, 2014 1:24 pm
by beckdo
Currently, there is no way to shutdown the Camera SDK completely mid-process and then reinitialize it. The intent of the shutdown() call is that it is called prior to the process termination as it ensures that the USB kernel driver is shutdown and all cameras are powered down.

Future versions of the Camera SDK will likely allow you to shut the Camera SDK down completely mid-process. We're working towards those improvements.

In the meantime, you can simply turn off the IR ring via SetIntensity(0), and call Stop() to reduce camera power usage.

Re: After Shutdown(), WaitForInitialization() fails

Posted: Tue Jan 28, 2014 11:03 am
by hwang
@ beckdo Thanks for the reply!