This commit is contained in:
matlabbe
2015-04-23 08:23:10 -04:00
parent e2d71c5999
commit a72ea25eac

View File

@@ -519,17 +519,20 @@ bool CameraOpenNI2::init(const std::string & calibrationFolder)
return false; return false;
} }
if(UFile::getExtension(_deviceId).compare("oni")!=0 && if(UFile::getExtension(_deviceId).compare("oni")==0)
!_device->isImageRegistrationModeSupported(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR))
{ {
UERROR("CameraOpenNI2: Device doesn't support depth/color registration."); if(_device->getPlaybackControl() &&
_device->getPlaybackControl()->setRepeatEnabled(false) != openni::STATUS_OK)
{
UERROR("CameraOpenNI2: Cannot set repeat mode to false.");
_device->close(); _device->close();
openni::OpenNI::shutdown(); openni::OpenNI::shutdown();
return false; return false;
} }
else if(_device->getPlaybackControl() && _device->getPlaybackControl()->setRepeatEnabled(false) != openni::STATUS_OK) }
else if(!_device->isImageRegistrationModeSupported(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR))
{ {
UERROR("CameraOpenNI2: Cannot set repeat mode to false."); UERROR("CameraOpenNI2: Device doesn't support depth/color registration.");
_device->close(); _device->close();
openni::OpenNI::shutdown(); openni::OpenNI::shutdown();
return false; return false;