feat(streaming): integrate native external streamer MVP#180
Closed
feat(streaming): integrate native external streamer MVP#180
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a native Rust external streamer application (
opennow-streamer) and integrates it into OpenNOW as an alternative streaming backend behind a feature flag. The native app handles WebRTC transport, video/audio decoding via FFmpeg, rendering via SDL2, and local input capture, while the Electron main process retains responsibility for CloudMatch session lifecycle and signaling orchestration.Architecture
opennow-stable/src/main/services/streamerManager.ts): Spawns and manages the externalopennow-streamerprocess via a local control socket. Reuses existingGfnSignalingClientand CloudMatch logic, forwarding session info, offers, and ICE candidates to the native process.opennow-streamer/): A Rust application managing the native peer connection, SDP manipulation (NVST, codec preference, server IP fix), media decode/render pipeline (FFmpeg/Sdl2), and input encoding (mouse/keyboard/controller).opennow-stable/src/renderer/src/App.tsx): Branches between the legacy Chromium WebRTC path and the external streamer path based on the newuseExternalStreamersetting.What’s included
opennow-streamer/native projectwebrtc-rs.sdp.rs) for NVST SDP generation, codec filtering, and server IP fixing.window.rs,input.rs) for keyboard (with modifiers), mouse, and controller, mapped to GFN binary protocol.media.rs) depacketizing H.264/H.265 RTP and decoding via bundled FFmpeg; Opus audio decoded vialibopus.control.rs) for Electron ↔ native control.Electron integration
opennow-stable/src/main/services/streamerManager.ts: Service to spawn the binary, establish the control channel, and proxy signaling.opennow-stable/src/main/index.ts: Register streamer manager IPC handlers and lifecycle hooks.opennow-stable/src/renderer/src/App.tsx: UpdatedhandlePlayGameto select the external path when enabled.opennow-stable/src/renderer/src/components/SettingsPage.tsx: Added "Use External Streamer" toggle with Beta badge.opennow-stable/src/shared/gfn.ts: AddedStreamerStateanduseExternalStreamersetting definitions.opennow-stable/src/preload/index.ts: Exposed streamer control and state APIs to the renderer.Build and packaging
opennow-streamer/Cargo.toml: Rust project manifest with dependencies (webrtc,sdl2,opus,bytes).opennow-stable/scripts/bundle-native-runtime.mjs: Build script to compile the Rust binary and bundle it alongside a sidecar FFmpeg binary intoresources/bin/.opennow-stable/package.json: Updatedbuildscript to run the bundler andextraResourcesconfiguration to includeresources/bin/**.Limitations