A dead-simple MacOS USB Video Class device visualizer.
- Objective-C 49.8%
- Zig 26.5%
- C 17.8%
- Nix 5.9%
| .envrc | ||
| .gitignore | ||
| build.zig | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| main.c | ||
| README.md | ||
| screenshot.png | ||
| shim.h | ||
| shim.m | ||
| UVZ.icns | ||
UVZ
A dead-simple MacOS USB Video Class device visualizer.
MacOS exposes UVC devices as AVCaptureDeviceInputs. AVFoundation provides AVCaptureVideoPreviewLayer to let you render a preview of a capture session onto a UI view layer.
This code is mostly based on Setting up a capture session and AVCaptureVideoPreviewLayer.
The initial idea was to write the whole thing in C. However, the Objective-C runtime API is cumbersome and verbose. In the end, I took the opportunity to refresh my Objective-C knowledge and wrote a shim for the Apple APIs that's called from a C entrypoint.
MacOS packaging is clunky, but it can all be done from a build.zig script if you're not signing & notarizing.
