diff --git a/impl/ocean/devices/arkit/AKDevice.mm b/impl/ocean/devices/arkit/AKDevice.mm index 0f0245ca5..381c27c55 100644 --- a/impl/ocean/devices/arkit/AKDevice.mm +++ b/impl/ocean/devices/arkit/AKDevice.mm @@ -99,16 +99,16 @@ - (bool)restart:(AKDevice*)device withMedium:(const Media::LiveVideoRef&)inputLi return false; } -#ifdef OCEAN_DEBUG + const ScopedLock scopedLock(lock_); + + AKDevice::TrackerCapabilities necessaryTrackerCapabilities = device->trackerCapabilities(); + for (AKDevice::DeviceMap::const_iterator iDevice = deviceMap_.cbegin(); iDevice != deviceMap_.cend(); ++iDevice) { ocean_assert(iDevice->first == device || iDevice->first->name() != device->name()); - } -#endif - - const AKDevice::TrackerCapabilities necessaryTrackerCapabilities = device->trackerCapabilities(); - const ScopedLock scopedLock(lock_); + necessaryTrackerCapabilities = AKDevice::TrackerCapabilities(necessaryTrackerCapabilities | iDevice->first->trackerCapabilities()); + } if (inputLiveVideo_ && &*inputLiveVideo_ != &*inputLiveVideo) { @@ -265,7 +265,11 @@ - (bool)restart:(AKDevice*)device withMedium:(const Media::LiveVideoRef&)inputLi } } - if (!sceneReconstructionActivated) + if (sceneReconstructionActivated) + { + trackerCapabilities_ = Devices::ARKit::AKDevice::TrackerCapabilities(trackerCapabilities_ | Devices::ARKit::AKDevice::TC_MESH_RECONSTRUCTION); + } + else { Log::warning() << "The devices does not support ARKit's scene reconstruction"; } @@ -278,6 +282,8 @@ - (bool)restart:(AKDevice*)device withMedium:(const Media::LiveVideoRef&)inputLi if ([ARWorldTrackingConfiguration supportsFrameSemantics:ARFrameSemanticSceneDepth]) { arWorldTrackingConfiguration.frameSemantics = ARFrameSemanticSceneDepth; + + trackerCapabilities_ = Devices::ARKit::AKDevice::TrackerCapabilities(trackerCapabilities_ | Devices::ARKit::AKDevice::TC_DEPTH); } } } @@ -289,6 +295,8 @@ - (bool)restart:(AKDevice*)device withMedium:(const Media::LiveVideoRef&)inputLi if (ARWorldTrackingConfiguration.supportsUserFaceTracking) { arWorldTrackingConfiguration.userFaceTrackingEnabled = true; + + trackerCapabilities_ = Devices::ARKit::AKDevice::TrackerCapabilities(trackerCapabilities_ | Devices::ARKit::AKDevice::TC_FACE); } else { @@ -331,6 +339,8 @@ - (bool)restart:(AKDevice*)device withMedium:(const Media::LiveVideoRef&)inputLi } } + trackerCapabilities_ = Devices::ARKit::AKDevice::TrackerCapabilities(trackerCapabilities_ | Devices::ARKit::AKDevice::TC_FACE); + arConfiguration_ = arFaceTrackingConfiguration; }