$ show barry-ran/QtScrcpy
QtScrcpy is a cross-platform desktop application for mirroring and controlling Android devices over USB or Wi-Fi, implemented as a C++/Qt reimplementation of scrcpy. The codebase is a conventional Qt Widgets monolith: main.cpp initializes the application and main dialog, the UI drives ADB through QProcess to deploy and run a server component on the device, incoming video is decoded with FFmpeg and rendered with OpenGL or Metal on Apple Silicon, and keyboard/mouse/touch events are forwarded back through the scrcpy control protocol. It also provides custom JSON key mappings, group control for broadcasting input to multiple devices, audio forwarding via a bundled sndcpy APK, system tray integration, single-instance enforcement, dark styling, and translations for Chinese, English, Japanese, and Korean. The most reusable parts of the repository are intentionally small, isolated UI and utility components rather than the main controller logic. KeepRatioWidget preserves a child's aspect ratio, MagneticWidget snaps a toolbar to window edges, MouseTap provides a clean cross-platform abstraction over Win/X11/Cocoa mouse-grabbing APIs, SingleInstance uses a local socket to prevent duplicate launches, and IconHelper loads Font Awesome icon glyphs. The video rendering widget demonstrates hand-written OpenGL shaders for YUV-to-RGB conversion, and the encoder preset registry hints at a factory-style extensibility pattern. Maintenance is active, with recent commits, release tags, and CI workflows for Windows, macOS, and Linux. However, there is measurable technical drift: the code contains many Qt5/Qt6 conditional blocks, deprecated Qt APIs such as QRegExp appear in the UI, the Ubuntu CI container is older (20.04 / Qt 5.15.2), and the README heavily promotes the author's commercial successors. The project is not a data/research repository; it is a practical desktop tool with no data pipelines, notebooks, or analytical artifacts.
The LLM identified 6 files worth highlighting for reuse:
A generic QWidget that preserves the aspect ratio of its child widget by computing the largest centered rectangle that fits the current size. It has no QtScrcpy-specific dependencies and can be dropped into any Qt application that needs fixed-ratio video or image display.
A widget that magnetically snaps itself to the edges of another widget, commonly used for floating toolbars. The behavior is self-contained and reusable in any Qt desktop application needing edge-docking or snap-to-window floating panels.
An abstract MouseTap interface with platform-specific implementations for Windows, X11, and macOS that grab or confine the mouse cursor to a target window. This is a clean platform abstraction pattern that can be extracted and reused in other cross-platform C++ input-capture tools.
Enforces a single running application instance using a local server/socket that detects duplicate launches and exits immediately if another instance owns the name. It is platform-neutral and isolated enough to reuse in any Qt desktop application.
An OpenGL widget that renders YUV video frames to RGB using custom vertex and fragment shaders. The shader-based YUV conversion is a non-trivial rendering pattern that can be reused in Qt video players or image viewers that need low-latency YUV frame display.
A singleton helper that loads a Font Awesome TrueType font and associates icon character codes with QIcon instances for buttons and labels. It is independent of QtScrcpy's application logic and can be reused in any Qt project that wants icon-font styling without per-icon image assets.