From 5d67a906b50628fc48b84ad2da08f53d993631e2 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Thu, 23 Jan 2025 23:19:17 +0100 Subject: [PATCH] Remove all true depth APIs temporarily --- .../AR/Provider/ArKit/ArFrameArKit.mm | 25 ------------------- .../Provider/ArKit/ArSessionArKitInternal.mm | 10 ++------ 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm b/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm index 3adfa61..2c3d32d 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm +++ b/openVulkanoCpp/AR/Provider/ArKit/ArFrameArKit.mm @@ -42,10 +42,6 @@ namespace OpenVulkano::AR::ArKit { return GetSize(arKitFrame.smoothedSceneDepth.depthMap); } - if(arKitFrame.capturedDepthData) - { - return GetSize(arKitFrame.capturedDepthData.depthDataMap); - } } return { -1, -1 }; } @@ -117,15 +113,6 @@ namespace OpenVulkano::AR::ArKit m_depthImage.format = ArDepthFormat::METER_FP32; m_depthImage.confidence.resolution = m_depthImage.depth.resolution; } - else if (m_arKitFrame.capturedDepthData) - { - auto depthFormat = arKitFrame.capturedDepthData.depthDataType; - if (arKitFrame.capturedDepthData.depthDataType == kCVPixelFormatType_DepthFloat32) m_depthImage.format = ArDepthFormat::METER_FP32; - else if (arKitFrame.capturedDepthData.depthDataType == kCVPixelFormatType_DepthFloat16) m_depthImage.format = ArDepthFormat::METER_FP16; - else Logger::AR->info("Received depth frame with unsuported format: {} ({})", - depthFormat == kCVPixelFormatType_DisparityFloat16 ? "DisparityFloat16" : (depthFormat == kCVPixelFormatType_DisparityFloat32 ? "DisparityFloat32" : "Unknown"), depthFormat); - m_depthImage.confidence.resolution = { 1, 1 }; - } m_depthImage.intrinsic = frameMetadata.intrinsic.GetForResolution(m_depthImage.depth.resolution); } @@ -147,10 +134,6 @@ namespace OpenVulkano::AR::ArKit CVPixelBufferUnlockBaseAddress(m_arKitFrame.smoothedSceneDepth.depthMap, kCVPixelBufferLock_ReadOnly); CVPixelBufferUnlockBaseAddress(m_arKitFrame.smoothedSceneDepth.confidenceMap, kCVPixelBufferLock_ReadOnly); } - else - { - CVPixelBufferUnlockBaseAddress(m_arKitFrame.capturedDepthData.depthDataMap, kCVPixelBufferLock_ReadOnly); - } } [m_arKitFrame release]; } @@ -201,14 +184,6 @@ namespace OpenVulkano::AR::ArKit m_depthImage.confidence.data = CVPixelBufferGetBaseAddress(m_arKitFrame.smoothedSceneDepth.confidenceMap); m_lockedDepth = true; } - else if(m_arKitFrame.capturedDepthData) - { - CVPixelBufferLockBaseAddress(m_arKitFrame.capturedDepthData.depthDataMap, kCVPixelBufferLock_ReadOnly); - m_depthImage.depth.data = CVPixelBufferGetBaseAddress(m_arKitFrame.capturedDepthData.depthDataMap); - m_frameDepthQuality = static_cast(m_arKitFrame.capturedDepthData.depthDataQuality) + static_cast(m_arKitFrame.capturedDepthData.depthDataAccuracy); - m_depthImage.confidence.data = &m_frameDepthQuality; - m_lockedDepth = true; - } } } return m_depthImage; diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm index df09743..48dd3c0 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm +++ b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm @@ -35,7 +35,7 @@ namespace OpenVulkano::AR::ArKit std::string SupportedVideoFormatsToString(bool frontCam) { std::stringstream ss("[ "); - auto vidFormats = frontCam ? [ARFaceTrackingConfiguration supportedVideoFormats] : [ARWorldTrackingConfiguration supportedVideoFormats]; + auto vidFormats = [ARWorldTrackingConfiguration supportedVideoFormats]; for (ARVideoFormat* format: vidFormats) { if (ss.tellp() > std::streampos(5)) ss << ", "; @@ -69,13 +69,7 @@ namespace OpenVulkano::AR::ArKit : m_frameId(0) { m_arKitDelegate = [[ArKitDelegate alloc] initWithFrameHandler:this]; - if (config.useFrontCamera) - { - ARFaceTrackingConfiguration* arConfig = [ARFaceTrackingConfiguration new]; - arConfig.worldTrackingEnabled = true; - m_arConfig = arConfig; - } - else + { ARWorldTrackingConfiguration* arConfig = [ARWorldTrackingConfiguration new]; if (config.enableDepth)