Skip to content

Add simulator movie recording and on-demand host capture - #9

Merged
dautovri merged 3 commits into
dautovri:mainfrom
ntdkhang:simulator-movie-recording
Oct 20, 2026
Merged

dautovri merged 3 commits into
dautovri:mainfrom
ntdkhang:simulator-movie-recording

Conversation

@ntdkhang

@ntdkhang ntdkhang commented Oct 17, 2026 •

Copy link
Copy Markdown

Evidence

Synthetic preview-layer output and decoded recorded frames were generated and inspected locally. The labeled four-corner fixture remained upright for the normal portrait request, and all eight rotation/mirroring cases passed.

Screenshot attachment upload was blocked by GitHub CLI's requirement for write access to the upstream repository. The images can be reproduced with SimulatorInjection/Tests/run-orientation-probe.sh as documented in the test README.

Summary

AI-generated reference: This entire PR—including the implementation, tests, and this write-up—was generated with Astra. I haven't independently reviewed the code quality. Please treat it as a reference implementation to evaluate or adapt, rather than a human-reviewed endorsement of the implementation.

This lets a Simulator app record and replay webcam video with microphone audio through its existing AVCaptureMovieFileOutput calls.

  • Add H.264/AAC movie writing, recording state/delegates, distinct audio/video connections, and cancellation/finalization handling.
  • Keep webcam preview and recordings upright while honoring requested rotation/mirroring; fix preview attachment and connection teardown issues encountered in a real SwiftUI app.
  • Add an optional socket lease protocol for external host supervisors, plus stdin-EOF shutdown for supervised host feeds. The downstream supervisor itself is outside this PR.
  • Include public-API probes, decoded-media checks, orientation fixtures, and an optional unchanged-caller integration harness.

Verification

Agent-run checks on Apple Silicon, macOS 26.6.2, Xcode 26.5, iOS Simulator 26.5:

  • bash SimulatorInjection/Tests/run-probe.sh "$DEVICE" — 14 scenarios passed, with decoded audio/video checks.
  • bash SimulatorInjection/Tests/run-orientation-probe.sh "$DEVICE" "$EVIDENCE" — all 8 rotation/mirroring cases passed for preview pixels and decoded movie frames.
  • xcodebuild -project SimulatorCamera.xcodeproj -scheme SimulatorCamera -destination 'platform=macOS' -derivedDataPath build/MacTests -only-testing:SimulatorCameraTests CODE_SIGNING_ALLOWED=NO test — 20 existing tests passed.
  • Our downstream app: two real webcam/microphone UI journeys passed, including save/replay/relaunch, repeat recording, and capture-process cleanup after app exit. Additional live checks covered Simulator shutdown and forced supervisor death. The saved movie decoded to changing upright video frames and nonzero microphone samples.
  • git diff --check passed.

Reproduction details: SimulatorInjection/Tests/README.md. The microphone bridge example uses an existing BlackHole route and requires matching host devices/permissions.

Limitations: precise physical lip-sync and perceptual audio quality were not evaluated; x86_64 was compiled but not runtime-tested. Signed companion-app/system-extension activation was not verified because of the local signing/provisioning setup. swiftformat and swiftlint were unavailable on this machine. These checks are agent-run evidence, not an independent human code-quality review.

@dautovri
dautovri merged commit 4b63bde into dautovri:main Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants