FrameLink — Low-Latency Screen Mirroring Desktop App
High-performance desktop application engineered for ultra-low latency mobile device projection and remote control via native C++ decoding.
Why this was built
Standard screen mirroring utilities often rely on heavy web wrappers or high-overhead network transports, introducing noticeable input lag (150ms+) that ruins interactive app testing and live presentations.
Technical Approach
Bypassed standard Flutter framework overhead by decoding the H.264/raw video stream in native C++ and projecting frames directly into Flutter's rendering canvas through Dart FFI (Foreign Function Interface) memory buffers.
// Dart FFI declaration linking directly to native C++ video decoder
typedef DecodeFrameC = Int32 Function(Pointer<Uint8> buffer, Int32 length);
typedef DecodeFrameDart = int Function(Pointer<Uint8> buffer, int length);
class NativeVideoDecoder {
late final DynamicLibrary _nativeLib;
late final DecodeFrameDart decodeFrame;
NativeVideoDecoder() {
_nativeLib = Platform.isWindows
? DynamicLibrary.open('video_decoder.dll')
: DynamicLibrary.process();
decodeFrame = _nativeLib
.lookup<NativeFunction<DecodeFrameC>>('decode_frame_buffer')
.asFunction();
}
}Key Architectural Features & Outcomes
Hardware-accelerated video decoding with adaptive frame pacing
Bi-directional input event forwarding under 45ms end-to-end latency
Memory-safe buffer pooling to prevent frame drops under high CPU load
Cross-platform compilation across Linux, macOS, and Windows runtimes