Skip to content

feat(native): replace GStreamer with cross-platform Rust streamer v2 - #776

Draft
zortos293 wants to merge 34 commits into
devfrom
capy/native-streamer-v2
Draft

feat(native): replace GStreamer with cross-platform Rust streamer v2#776
zortos293 wants to merge 34 commits into
devfrom
capy/native-streamer-v2

Conversation

@zortos293

@zortos293 zortos293 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replaces the former GStreamer implementation and checked-in runtime payload with a self-contained Rust 2024 native streamer
  • implements explicit NVST transport with authenticated SRTP, replay protection, ordered packet/frame assembly, bounded queues, H.264 Annex-B delivery, and fail-closed selection without WebRTC media fallback
  • completes the negotiated ICE/DTLS/SCTP bundle path with routable peer handoff, standard data-channel ordering, RFC 3550 receiver metrics, RFC 4585 generic NACK/PLI, retry-safe feedback, channel-close handling, and typed input-handshake timeout
  • adds robust RTSP-over-WebSocket lifecycle handling: CSeq validation, timeout invalidation, health-aware reuse, ping/pong, and idempotent native UDP reservation release
  • ships Linux x64/ARM64 V4L2 and VA-API decode with Vulkan X11/XWayland presentation, PipeWire/ALSA output, and OpenH264/SDL fallback; production and CI now compile the VA-API path
  • adds Windows x64/ARM64 Media Foundation/D3D11/WASAPI support with honest bundled capability probing, proactive default audio-endpoint switching, and software fallback
  • adds macOS VideoToolbox/Metal/CoreAudio failure propagation, keyframe recovery, one-shot OpenH264/SDL fallback, and frontmost-owned overlay ordering
  • removes unsupported runtime bitrate/shortcut/stat contracts, disables external native rendering until OS-level input capture exists, and keeps renderer input pending until native readiness or an explicit unavailable event
  • preserves session-stable state and structurally redacted diagnostics; generated media, authentication state, session secrets, and packaged binaries are excluded

Validation

A fresh authorized explicit-NVST Linux session on the final code established:

  • ICE/DTLS and SCTP completion with stats_channel, reliable input, partially-reliable input, and rtcp_on_sctp_private open
  • authenticated H.264 receive and sustained assembly (611 frames in the observed burst)
  • OpenH264/SDL first-frame presentation
  • recurring receiver reports plus an RFC 4585 PLI on the accepted feedback channel
  • explicit input downgrade after the server sent no protocol handshake; no packets were silently accepted

The live environment did not expose an Opus SSRC and used a dummy SDL audio driver, so it does not prove audio-device output. It also did not produce a live packet-loss event, so NACK interoperability remains covered by frozen wire-layout/reordering tests rather than live loss injection.

The final source passes:

  • cargo fmt --all -- --check
  • cargo test --workspace (147 unit/integration tests plus doc-test targets)
  • Linux backend all-feature tests, including the production VA-API feature chain
  • cargo clippy --workspace --all-targets -- -D warnings
  • release workspace and packaged native-streamer builds
  • Windows platform checks for x86_64-pc-windows-msvc and aarch64-pc-windows-msvc
  • macOS backend host tests plus aarch64-apple-darwin backend type-check/Clippy validation
  • npm run lint (zero warnings)
  • npm run typecheck
  • npm test (726 passing)
  • npm run build
  • npm run native:build
  • git diff --check

Remaining hardware acceptance

Real-device acceptance is still required for Media Foundation/D3D11/WASAPI and endpoint/device-loss behavior on Windows x64 and ARM64, V4L2/VA-API/Vulkan/PipeWire/ALSA device-loss paths on representative Linux systems, and VideoToolbox/Metal/CoreAudio fallback behavior on macOS hardware. Live server delivery of Opus and the proprietary input handshake is also still required before those session capabilities can be called operational; the implementation now reports them unavailable instead of silently claiming success.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@capy-ai capy-ai Bot changed the title refactor(native): replace GStreamer streamer with Rust v2 foundation feat(native): replace GStreamer with Rust streamer v2 Aug 18, 2026
@blacksmith-sh

This comment has been minimized.

Wire Bifrost-shaped x-nv ANNOUNCE ICE credentials and native STUN
binding requests so the explicit NVST path can complete authenticated
UDP hole punching without WebRTC media fallback.
@blacksmith-sh

This comment has been minimized.

let packet = Buffer.concat(parts);
header.writeUInt16BE(packet.length - 20 + 24, 2);
packet = Buffer.concat(parts);
appendStunAttribute(parts, 0x0008, createHmac("sha1", remotePassword).update(packet).digest());
zortos293 and others added 3 commits August 19, 2026 12:09
Match official Bifrost identity and order so ANNOUNCE can arm WebRtcTransport: 4/22 local ICE, V2 remote ufrag, DTLS after ANNOUNCE, and keep hole-punch STUN until the handshake completes.

Co-authored-by: Cursor <cursoragent@cursor.com>
- reserve a dedicated Mjolnir UDP socket for inbound NVST video
- rework RTSP probe/client and CloudMatch session request handling
- thread device identity and signaling through the native streamer path

Co-authored-by: Cursor <cursoragent@cursor.com>
…hannel

The server stops sending video shortly after the keyframe unless the
client reports over the rtcp_on_sctp_private SCTP data channel; open it
with the label the server expects (not rtcp1) and send Receiver
Reports/PLI. Also bundle the streamer as an .app and fix overlay
coordinates so the video window composes on macOS, and add the
GCM-8/AES-256-CM SRTP profiles the official client negotiates.

Co-authored-by: Cursor <cursoragent@cursor.com>
@blacksmith-sh

This comment has been minimized.

@capy-ai capy-ai Bot changed the title feat(native): replace GStreamer with Rust streamer v2 feat(native): replace GStreamer with cross-platform Rust streamer v2 Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants