Repository navigation
Releases
Releases · izantech/scrcpy-vscode
0.2.0
What's changed
Highlights
- 🎉 scrcpy 4.x support — Screen mirroring works again after upgrading scrcpy to 4.0 (#9). The extension now supports both scrcpy 3.x and 4.x wire formats.
- 🏗️ Strategy-pattern protocol engines — Wire-protocol parsing moved into version-specific engines (
V3ProtocolEngine,V4ProtocolEngine) selected by a factory. Adding support for a future v5 is a 2-step change: implement the engine, add acase 5:to the factory.
Changed
- scrcpy v4.x protocol support - The extension now supports both scrcpy 3.x and 4.x wire formats. Fixes screen mirroring not displaying after upgrading to scrcpy 4.0 (#9).
- Strategy-pattern protocol engines - Wire-protocol parsing is now encapsulated in
src/protocol/engines (V3ProtocolEngine,V4ProtocolEngine) selected bycreateProtocolEngine(version). Adding support for a future v5 is a 2-step change: implement the engine, add acase 5:to the factory. No edits toScrcpyConnectionrequired. - scrcpy v3.x backwards compatibility - The legacy v3.x wire format (
codec_id + width + heightheader, CONFIG at bit 63) is now explicitly supported viaV3ProtocolEngine. Previously the extension assumed v3 format unconditionally; now it dispatches based on the installed scrcpy version. - Video stream parser rewritten - Implements the new scrcpy v4.x session-packet wire format introduced in PR Genymobile/scrcpy#6159. The initial
codec_idis now followed by a 12-byte SESSION packet (instead of the old 8-bytewidth|heightblock), and mid-stream SESSION packets are emitted on encoder resets (rotation, capture reset, virtual-display resize). - PTS/flags bit positions shifted - In v4.x the new SESSION flag occupies bit 63, pushing CONFIG down to bit 62 and KEY_FRAME down to bit 61 (previously bits 63 and 62). Applies to both video and audio media packets. v3.x engines use the legacy positions.
- Server arg is now version-dependent - The stream-meta arg is
send_stream_metafor v4.x servers,send_codec_metafor v3.x. Each engine exposes the right name viaProtocolEngine.serverStreamMetaArg.
Added
src/protocol/package -ProtocolEngineinterface,CursorBuffer(extracted),V3ProtocolEngine,V4ProtocolEngine, andcreateProtocolEnginefactory.PACKET_FLAG_SESSION/PACKET_FLAG_CONFIG/PACKET_FLAG_KEY_FRAMEconstants exported fromScrcpyProtocol.ts, plus the v4.x control message types (RESET_VIDEO,CAMERA_SET_TORCH,CAMERA_ZOOM_IN/OUT,RESIZE_DISPLAY,SCAN_FILE) for future use.- Protocol engine tests -
test/unit/protocol/covers V3, V4, and factory dispatch in isolation (no socket mocking required). - Clear error for unsupported scrcpy versions - The factory throws
ToolNotFoundErrorwith an upgrade message for scrcpy 2.x and older. Previously these versions silently failed with a blank screen.
Full Changelog: 0.1.4...0.2.0