- Rust 63.3%
- Dart 28.5%
- C 2.4%
- C++ 1.9%
- CMake 1.8%
- Other 2.1%
Distros without libx264 (Fedora ffmpeg-free, Asahi) left auto with no encoder, and the error led with the NVENC failure. Software now tries libx264 then libopenh264, and the combined error lists software first. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DKKNbfSM1g5XupPzMqrrR1 |
||
|---|---|---|
| .cargo | ||
| app | ||
| core | ||
| ffi | ||
| opus | ||
| platform-linux | ||
| scripts | ||
| srt | ||
| vectors | ||
| web | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| LICENSE | ||
| PORTED.md | ||
| PROTOCOL.md | ||
| README.md | ||
pirror
One app that sends (mirrors this device's screen and audio) and receives (acts as a sink) over the pirror SRT protocol. Plan and decisions: CLAUDE.md. Wire format: PROTOCOL.md. Where every ported file came from: PORTED.md.
| Path | What |
|---|---|
core/ |
protocol, SRT, reassembly, A/V sync, sender and receiver pipelines, OPUS/FLAC |
srt/, opus/ |
minimal FFI over vendored libsrt (no encryption) and libopus |
platform-linux/ |
ffmpeg H.264, PipeWire/X11 capture, PipeWire/parec audio |
web/ |
WebTransport sink for the browser client (cert pinning, pairing) |
ffi/ |
C ABI (ffi/include/pirror.h) |
app/ |
Flutter UI |
Build and test
cargo test --workspace --features pirror-core/receiver,pirror-core/sender
cargo test -p pirror-ffi --features linux # ABI incl. desktop decode
# Flutter app (needs GTK 3 dev headers on Linux: sudo dnf install gtk3-devel)
cargo build --release -p pirror-ffi --features linux
cd app && flutter test # UI tests
PIRROR_LIB=$PWD/../target/debug/libpirror_ffi.so flutter test test/ffi_integration_test.dart
env -u WAYLAND_DISPLAY flutter test integration_test -d linux # real app window, X11 capture
PIRROR_WAYLAND_TEST=1 flutter test integration_test -d linux # real Wayland capture (approve the dialog)
flutter run -d linux
flutter build linux --release # bundle/ holds the app and lib/libpirror_ffi.so
scripts/build-apk.sh # Android debug APK
Status
Works and tested on Linux: the app sends and receives from one UI over SRT, interoperating with the unmodified pirror-server-linux and pirror-client. Real Wayland capture works through the Send tab, and the Send tab can serve browsers over WebTransport: a real pirror-client-web page in Chrome paired with it and decoded the stream.
Video reaches Flutter as a native pixel-buffer texture on Linux (the receiver delivers frames straight into Rust-side buffers; Dart never touches the pixels); other platforms fall back to a Dart-side image. Known gaps: audio and video sync has been tested in the core but not with real playback in the app; the UI has not been looked at on screen by the person who wrote it. Not built yet: Windows, macOS and iOS platform code, and the Android native capture service and MediaCodec decoder. On a phone the app says so instead of failing.