DriverHandler::DriverHandler(const char* library, xnl::ErrorLogger& errorLogger)
{
m_valid = false;
xnOSMemSet(&funcs, 0, sizeof(funcs));
XnStatus rc = xnOSLoadLibrary(library, &m_libHandle);
if (rc != XN_STATUS_OK)
{
errorLogger.Append("LibraryHandler: Couldn't load library %s", library);
return;
}
OniGetProcAddress(oniDriverCreate);
OniGetProcAddress(oniDriverDestroy);
OniGetProcAddress(oniDriverInitialize);
OniGetProcAddress(oniDriverTryDevice);
OniGetProcAddress(oniDriverDeviceOpen);
OniGetProcAddress(oniDriverDeviceClose);
OniGetProcAddress(oniDriverDeviceGetSensorInfoList);
OniGetProcAddress(oniDriverDeviceCreateStream);
OniGetProcAddress(oniDriverDeviceDestroyStream);
OniGetProcAddress(oniDriverDeviceSetProperty);
OniGetProcAddress(oniDriverDeviceGetProperty);
OniGetProcAddress(oniDriverDeviceIsPropertySupported);
OniGetProcAddress(oniDriverDeviceSetPropertyChangedCallback);
OniGetProcAddress(oniDriverDeviceNotifyAllProperties);
OniGetProcAddress(oniDriverDeviceInvoke);
OniGetProcAddress(oniDriverDeviceIsCommandSupported);
OniGetProcAddress(oniDriverDeviceIsImageRegistrationModeSupported);
OniGetProcAddress(oniDriverDeviceTryManualTrigger);
OniGetProcAddress(oniDriverStreamSetServices);
OniGetProcAddress(oniDriverStreamSetProperty);
OniGetProcAddress(oniDriverStreamGetProperty);
OniGetProcAddress(oniDriverStreamIsPropertySupported);
OniGetProcAddress(oniDriverStreamSetPropertyChangedCallback);
OniGetProcAddress(oniDriverStreamNotifyAllProperties);
OniGetProcAddress(oniDriverStreamInvoke);
OniGetProcAddress(oniDriverStreamIsCommandSupported);
OniGetProcAddress(oniDriverStreamStart);
OniGetProcAddress(oniDriverStreamStop);
OniGetProcAddress(oniDriverStreamGetRequiredFrameSize);
OniGetProcAddress(oniDriverStreamSetNewFrameCallback);
OniGetProcAddress(oniDriverStreamConvertDepthToColorCoordinates);
OniGetProcAddress(oniDriverEnableFrameSync);
OniGetProcAddress(oniDriverDisableFrameSync);
m_valid = true;
}
{
m_valid = false;
xnOSMemSet(&funcs, 0, sizeof(funcs));
XnStatus rc = xnOSLoadLibrary(library, &m_libHandle);
if (rc != XN_STATUS_OK)
{
errorLogger.Append("LibraryHandler: Couldn't load library %s", library);
return;
}
OniGetProcAddress(oniDriverCreate);
OniGetProcAddress(oniDriverDestroy);
OniGetProcAddress(oniDriverInitialize);
OniGetProcAddress(oniDriverTryDevice);
OniGetProcAddress(oniDriverDeviceOpen);
OniGetProcAddress(oniDriverDeviceClose);
OniGetProcAddress(oniDriverDeviceGetSensorInfoList);
OniGetProcAddress(oniDriverDeviceCreateStream);
OniGetProcAddress(oniDriverDeviceDestroyStream);
OniGetProcAddress(oniDriverDeviceSetProperty);
OniGetProcAddress(oniDriverDeviceGetProperty);
OniGetProcAddress(oniDriverDeviceIsPropertySupported);
OniGetProcAddress(oniDriverDeviceSetPropertyChangedCallback);
OniGetProcAddress(oniDriverDeviceNotifyAllProperties);
OniGetProcAddress(oniDriverDeviceInvoke);
OniGetProcAddress(oniDriverDeviceIsCommandSupported);
OniGetProcAddress(oniDriverDeviceIsImageRegistrationModeSupported);
OniGetProcAddress(oniDriverDeviceTryManualTrigger);
OniGetProcAddress(oniDriverStreamSetServices);
OniGetProcAddress(oniDriverStreamSetProperty);
OniGetProcAddress(oniDriverStreamGetProperty);
OniGetProcAddress(oniDriverStreamIsPropertySupported);
OniGetProcAddress(oniDriverStreamSetPropertyChangedCallback);
OniGetProcAddress(oniDriverStreamNotifyAllProperties);
OniGetProcAddress(oniDriverStreamInvoke);
OniGetProcAddress(oniDriverStreamIsCommandSupported);
OniGetProcAddress(oniDriverStreamStart);
OniGetProcAddress(oniDriverStreamStop);
OniGetProcAddress(oniDriverStreamGetRequiredFrameSize);
OniGetProcAddress(oniDriverStreamSetNewFrameCallback);
OniGetProcAddress(oniDriverStreamConvertDepthToColorCoordinates);
OniGetProcAddress(oniDriverEnableFrameSync);
OniGetProcAddress(oniDriverDisableFrameSync);
m_valid = true;
}