libvcamcaptured's nine .inc files and the single libcamfix.m become
separate .m files grouped by subsystem, with private headers for what
crosses a file. Shared symbols are hidden, so neither dylib exports more
than the data plane's vcc_* functions. The Makefile already discovers
them; the data plane test now resolves its header through -I as well.
Fixes found while reading the whole camera path:
- The copyDeviceWithID: and copyStreams hooks return owned objects but
lacked ns_returns_retained, so ARC autoreleased the result and the
caller's release over-released it.
- Captured video sinks are held weakly, so a finished session's graph
is neither kept alive nor fed at 30 Hz forever.
- Viewfinder streams, preview layers and the shm mapping are guarded
against the threads that touch them; the preview timer is created once.
- Moment captures are stashed per uniqueID and removed on commit or
cancel, so back-to-back shutter taps keep their own settings and the
output no longer retains its delegate indefinitely.
- The resolved settings stub assigns ivars with the strong-default
setter instead of an extra manual retain.
- A photo's JPEG and CGImage come from one frame, and the preview drops
the last graph sample once no layer shows it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ports #478 onto the split guest components.
libvcamcaptured:
- Publish one unsynchronized video stream on the synthetic source, so
client devices get ports and sessions build a capture graph.
- Publish a format surface that matches the delivered samples: field of
view, SDR only, and intrinsic matrix delivery.
- Drive the captured video sink nodes at 30 Hz, and deliver viewfinder
samples in the advertised 420v format through the shared data plane.
- Keep pixel format, timestamp and frame index from the shm header, and
refuse truncated planar frames.
libcamfix:
- Route every RGB and sample buffer path through the shared data plane.
- Feed the preview from the sample the capture graph delivered, with the
shm frame as the fallback before the graph runs.
- Deliver samples to AVCaptureVideoDataOutput delegates only while the
graph is not delivering, so delegates never see two streams.
- Log session start state and device input ports.
Both dylibs compile VCamDataPlane. The Makefile discovers each camera
component's sources and headers recursively and resolves headers with -I.
Co-Authored-By: Alec Armbruster <35377827+alectrocute@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>