After Shutdown(), WaitForInitialization() fails

Post Reply
hwang
Posts: 6
Joined: Thu Jan 02, 2014 1:20 pm

After Shutdown(), WaitForInitialization() fails

Post 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!
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: After Shutdown(), WaitForInitialization() fails

Post 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.
hwang
Posts: 6
Joined: Thu Jan 02, 2014 1:20 pm

Re: After Shutdown(), WaitForInitialization() fails

Post by hwang »

@ beckdo Thanks for the reply!
Post Reply