Expose additional AR capabilities

This commit is contained in:
Georg Hagen
2024-07-31 22:22:40 +02:00
parent eb9f4764ca
commit b918dc278b
3 changed files with 10 additions and 4 deletions

View File

@@ -45,16 +45,22 @@ namespace OpenVulkano::AR
ArSessionType sessionType = ArSessionType::NATIVE;
bool uncompressed = true;
bool depthSupported = false;
bool supportsExposureLocking = false;
bool supportsWhitebalanceLocking = false;
bool hasFlashlight = false;
public:
ArSessionCapabilities() = default;
ArSessionCapabilities(const ArType type, const ArSessionType sessionType, const bool uncompressed, const bool depthSupported)
: type(type), sessionType(sessionType), uncompressed(uncompressed), depthSupported(depthSupported)
ArSessionCapabilities(const ArType type, const ArSessionType sessionType, const bool uncompressed, const bool depthSupported, const bool supportsExposureLocking, const bool suppoertWhitebalanceLocking, const bool hasFlash)
: type(type), sessionType(sessionType), uncompressed(uncompressed), depthSupported(depthSupported), supportsExposureLocking(supportsExposureLocking), supportsWhitebalanceLocking(supportsWhitebalanceLocking), hasFlashlight(hasFlash)
{}
[[nodiscard]] bool IsUncompressed() const { return uncompressed; }
[[nodiscard]] bool IsDepthSupported() const { return depthSupported; }
[[nodiscard]] bool IsExposureLockSupported() const { return supportsExposureLocking; }
[[nodiscard]] bool IsWhitebalanceLockSupported() const { return supportsWhitebalanceLocking; }
[[nodiscard]] bool HasFlashlight() const { return hasFlashlight; }
[[nodiscard]] bool IsNative() const { return sessionType == ArSessionType::NATIVE; }
[[nodiscard]] bool IsPlayback() const { return sessionType == ArSessionType::PLAYBACK; }
[[nodiscard]] bool IsStream() const { return sessionType == ArSessionType::NETWORK_STREAM; }

View File

@@ -14,7 +14,7 @@ namespace OpenVulkano::AR::ArKit
ArSessionCapabilities QueryNativeCapabilities()
{
bool supportsDepth = [ARWorldTrackingConfiguration supportsFrameSemantics:ARFrameSemanticSceneDepth];
ArSessionCapabilities capabilities(ArType::AR_KIT, ArSessionType::NATIVE, true, supportsDepth);
ArSessionCapabilities capabilities(ArType::AR_KIT, ArSessionType::NATIVE, true, supportsDepth, true, true, true);
return capabilities;
}
}

View File

@@ -17,7 +17,7 @@ namespace OpenVulkano::AR::Playback
ArSessionPlayback::ArSessionPlayback(const std::string& recordingPath, bool autoAdvance)
: ArSession(ArSessionMetadata(recordingPath)), recordingPath(recordingPath), autoAdvance(autoAdvance), playbackReader(recordingPath)
{
capabilities = ArSessionCapabilities(metadata.type, ArSessionType::PLAYBACK, false, metadata.depthFormat != ArDepthFormat::UNAVAILABLE);
capabilities = ArSessionCapabilities(metadata.type, ArSessionType::PLAYBACK, false, metadata.depthFormat != ArDepthFormat::UNAVAILABLE, false, false, false);
constants = { Math::Matrix4f(1), metadata.confidenceRange };
m_playbackReaderThread = std::thread([this](){ReadWorker();});