No description
  • Rust 63.3%
  • Dart 28.5%
  • C 2.4%
  • C++ 1.9%
  • CMake 1.8%
  • Other 2.1%
Find a file
tna c501835453 Encoder: libopenh264 software fallback, clearer failure message
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
2026-09-20 15:40:05 +02:00
.cargo Protocol spec, golden vectors and pirror-core (framing, reassembly, sync, SRT) 2026-09-19 20:39:14 +02:00
app Send section: explicit state machine (Idle/Starting/Live/Stopping/Failed), pure transition table, Stopping state 2026-09-20 13:59:49 +02:00
core C ABI (pirror-ffi): receiver and sender handles, external-input sender for mobile, header, C smoke test 2026-09-19 21:52:21 +02:00
ffi Cross-build libpirror_ffi for aarch64 against a Pi sysroot; opt-in rpi feature for Raspberry Pi's ffmpeg 2026-09-20 14:12:20 +02:00
opus Receiver pipeline: presenter, stall tracker, audio ring, OPUS/FLAC decode, link generation; pirror-opus 2026-09-19 21:19:06 +02:00
platform-linux Encoder: libopenh264 software fallback, clearer failure message 2026-09-20 15:40:05 +02:00
scripts Cross-build libpirror_ffi for aarch64 against a Pi sysroot; opt-in rpi feature for Raspberry Pi's ffmpeg 2026-09-20 14:12:20 +02:00
srt Add pirror-srt: vendored libsrt 1.4.2 without encryption behind a thin FFI; core uses it 2026-09-19 21:10:10 +02:00
vectors Receiver pipeline: presenter, stall tracker, audio ring, OPUS/FLAC decode, link generation; pirror-opus 2026-09-19 21:19:06 +02:00
web Fix second start hanging: one long-lived portal runtime; tear down PipeWire capture and portal session on drop; capture before binding ports; cancel-safe start attempts 2026-09-20 01:05:31 +02:00
.gitignore Add AppImage packaging script 2026-09-20 13:26:13 +02:00
Cargo.lock Fix second start hanging: one long-lived portal runtime; tear down PipeWire capture and portal session on drop; capture before binding ports; cancel-safe start attempts 2026-09-20 01:05:31 +02:00
Cargo.toml C ABI (pirror-ffi): receiver and sender handles, external-input sender for mobile, header, C smoke test 2026-09-19 21:52:21 +02:00
CLAUDE.md Linux sender: encoder backends (NVENC, VAAPI/Mesa, software) 2026-09-20 15:35:02 +02:00
LICENSE Add PORTED.md and MIT LICENSE 2026-09-19 20:52:50 +02:00
PORTED.md platform-linux sender: ffmpeg encoder, Wayland/X11 capture, PipeWire/parec audio; pacer hint targets the frame slot 2026-09-19 21:40:38 +02:00
PROTOCOL.md Port WebTransport sink (cert pinning, pairing) and SinkHub; record provenance 2026-09-19 21:02:09 +02:00
README.md Native video texture on Linux: Rust triple-buffered pixel texture, thin C++ shim, Dart Texture widget; ABI v4 2026-09-20 00:29:18 +02:00

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.