Add composite view capture support for Apple Vision Pro#20
Open
Add composite view capture support for Apple Vision Pro#20
Conversation
Implements continuous real-time composite view capture using ReplayKit, allowing capture of both physical passthrough and digital content. Key changes: - Added com.apple.developer.screen-capture.composite-passthrough entitlement - Created CompositeViewCapture.swift with ReplayKit-based continuous capture - Extended EnterpriseCameraAccessManager.cs with UseCompositeCapture toggle - Added composite texture handling with Metal pipeline (mirrors physical camera) - Updated ConfigureXcodeSettings.cs with NSPhotoLibraryUsageDescription Features: - Toggle between physical camera and composite view capture - Real-time texture updates via getCompositeTexture() - No audio capture (microphone disabled) - Public API: GetCompositeTexture2D() Resolves #16 Co-authored-by: Masahiro Yamaguchi <from2001@users.noreply.github.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
Pull request overview
This pull request adds composite view capture support for Apple Vision Pro, enabling capture of both physical passthrough and digital content using ReplayKit. This addresses issue #16 which requested the ability to capture AR composite views (physical environment + digital elements) rather than just the physical camera feed.
Changes:
- Added
UseCompositeCapturetoggle flag to switch between physical camera and composite view capture modes - Implemented ReplayKit-based continuous capture in new
CompositeViewCapture.swiftfile with Metal pipeline - Extended C# manager with composite capture methods and public API
- Added required entitlements and Info.plist permissions for screen capture
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 20 comments.
| File | Description |
|---|---|
| EnterpriseCameraAccessManager.cs | Added composite capture support with dual-mode operation, new texture management fields, and public GetCompositeTexture2D() API |
| CompositeViewCapture.swift | New ReplayKit-based composite capture implementation with Metal texture processing and pixel format conversion |
| ConfigureXcodeSettings.cs | Added NSPhotoLibraryUsageDescription permission to Info.plist configuration |
| Entitlements.entitlements | Added com.apple.developer.screen-capture.composite-passthrough entitlement for ReplayKit access |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/EnterpriseCameraAccessManager.cs
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/EnterpriseCameraAccessManager.cs
Outdated
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Outdated
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Outdated
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Outdated
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Outdated
Show resolved
Hide resolved
Packages/com.styly.enterprise-camera-access/Runtime/Scripts/CompositeViewCapture.swift
Outdated
Show resolved
Hide resolved
- Remove unused ARKit import - Use explicit .shaderRead Metal texture usage instead of .unknown - Replace force unwraps with guard statements for better error handling - Replace fatalError() with logging for graceful error recovery - Add memory cleanup in OnDisable for textures and render textures - Optimize TryGetCompositeTexture to only recreate texture when pointer changes - Add UpdateExternalTexture call in UpdateCompositeTexture for proper refresh - Add IsCompositeCaptureAvailable() public API method - Add XML documentation for GetCompositeTexture2D - Expand tooltip to explain composite vs physical capture trade-offs - Remove unnecessary NSPhotoLibraryUsageDescription plist entry - Log unsupported pixel formats instead of silently returning Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements continuous real-time composite view capture using ReplayKit, allowing capture of both physical passthrough and digital content.
Key Features
UseCompositeCaptureflagGetCompositeTexture2D()Implementation
com.apple.developer.screen-capture.composite-passthroughentitlementCompositeViewCapture.swiftwith ReplayKit-based continuous captureEnterpriseCameraAccessManager.cswith composite mode supportConfigureXcodeSettings.cswith Info.plist permissionsResolves #16
Generated with Claude Code