From 47aa89b4d83c272428dcfc5181e749f8996cb6c7 Mon Sep 17 00:00:00 2001 From: HarveyQue Date: Sun, 13 Sep 2026 01:29:09 +0800 Subject: [PATCH] refactor: remove retired relay provenance --- crates/capturer/src/main.rs | 4 +- crates/mac-capturer/examples/dump.rs | 13 ++- crates/mac-capturer/src/lib.rs | 46 +++++------ crates/mac-capturer/swift/MacCapturer.swift | 90 ++++++++++----------- crates/win-capturer/src/display.rs | 2 +- scripts/dump_view.py | 4 +- scripts/smoke_stream.py | 6 +- scripts/smoke_ws_register.py | 4 +- scripts/smoke_ws_via_nginx.py | 10 +-- 9 files changed, 94 insertions(+), 85 deletions(-) diff --git a/crates/capturer/src/main.rs b/crates/capturer/src/main.rs index 0ac4af3..477244f 100644 --- a/crates/capturer/src/main.rs +++ b/crates/capturer/src/main.rs @@ -1,7 +1,7 @@ //! `scilaxy-capturer`: native screen-capture publisher. //! //! v1: ScreenCaptureKit + VideoToolbox via `scilaxy-relay-mac-capturer` -//! (macOS only). Each H264 NAL unit is forwarded as a single Binary +//! (macOS only). Each HEVC NAL unit is forwarded as a single Binary //! WebSocket frame to the stream server. //! //! Linux/Windows backends will land in this same crate behind cfg flags; @@ -14,7 +14,7 @@ use futures_util::SinkExt; use tokio_tungstenite::tungstenite::Message; #[derive(Debug, Parser)] -#[command(name = "scilaxy-capturer", about = "screen → H264 → scilaxy-stream WS")] +#[command(name = "scilaxy-capturer", about = "screen → HEVC → scilaxy-stream WS")] struct Args { /// Stream peer id (the room name on scilaxy-stream). #[arg(long, env = "SCILAXY_PEER_ID")] diff --git a/crates/mac-capturer/examples/dump.rs b/crates/mac-capturer/examples/dump.rs index 86d99e5..89005e1 100644 --- a/crates/mac-capturer/examples/dump.rs +++ b/crates/mac-capturer/examples/dump.rs @@ -1,14 +1,18 @@ -//! `cargo run -p scilaxy-relay-mac-capturer --example dump > /tmp/native.h264` +//! `cargo run -p scilaxy-relay-mac-capturer --example dump > /tmp/native.h265` //! //! Stream raw NAL bytes from the Swift capturer to stdout for ~3s, then exit. //! Use ffprobe to validate the output afterwards. +#[cfg(target_os = "macos")] use std::io::{self, Write}; +#[cfg(target_os = "macos")] use std::time::{Duration, Instant}; +#[cfg(target_os = "macos")] fn main() { eprintln!("starting native mac capturer (1920x1080 @30fps, 4 Mbps)"); - let rx = scilaxy_relay_mac_capturer::start(1920, 1080, 30, 4000).expect("start mac-capturer"); + let rx = + scilaxy_relay_mac_capturer::start(1920, 1080, 30, 4000, 0).expect("start mac-capturer"); let stdout = io::stdout(); let mut out = stdout.lock(); let deadline = Instant::now() + Duration::from_secs(3); @@ -24,3 +28,8 @@ fn main() { } eprintln!("dumped {nals} NALs, {bytes} bytes"); } + +#[cfg(not(target_os = "macos"))] +fn main() { + eprintln!("the native mac capturer example requires macOS"); +} diff --git a/crates/mac-capturer/src/lib.rs b/crates/mac-capturer/src/lib.rs index 3a98cfa..03e0b14 100644 --- a/crates/mac-capturer/src/lib.rs +++ b/crates/mac-capturer/src/lib.rs @@ -1,6 +1,6 @@ //! macOS-native screen capturer: ScreenCaptureKit + VideoToolbox. //! -//! Replacement for the ffmpeg subprocess pipeline. Streams raw H264 +//! Replacement for the ffmpeg subprocess pipeline. Streams raw HEVC //! Annex-B NAL units back through a callback, one NAL per call. #![cfg(target_os = "macos")] @@ -9,7 +9,7 @@ use std::os::raw::{c_int, c_void}; use std::sync::mpsc; extern "C" { - fn xz_capturer_start( + fn scilaxy_capturer_start( width: i32, height: i32, fps: i32, @@ -18,18 +18,18 @@ extern "C" { ctx: *mut c_void, cb: extern "C" fn(*mut c_void, *const u8, isize, i64), ) -> c_int; - fn xz_capturer_select_display(display_id: u32) -> c_int; - fn xz_capturer_active_display_id() -> u32; - fn xz_capturer_list_displays_json(out: *mut u8, cap: isize) -> isize; - fn xz_capturer_set_bitrate(kbps: i32) -> c_int; - fn xz_capturer_bitrate_kbps() -> i32; - fn xz_capturer_set_fps(fps: i32) -> c_int; - fn xz_capturer_fps() -> i32; - fn xz_capturer_set_resolution(width: i32, height: i32) -> c_int; - fn xz_capturer_resolution() -> i32; + fn scilaxy_capturer_select_display(display_id: u32) -> c_int; + fn scilaxy_capturer_active_display_id() -> u32; + fn scilaxy_capturer_list_displays_json(out: *mut u8, cap: isize) -> isize; + fn scilaxy_capturer_set_bitrate(kbps: i32) -> c_int; + fn scilaxy_capturer_bitrate_kbps() -> i32; + fn scilaxy_capturer_set_fps(fps: i32) -> c_int; + fn scilaxy_capturer_fps() -> i32; + fn scilaxy_capturer_set_resolution(width: i32, height: i32) -> c_int; + fn scilaxy_capturer_resolution() -> i32; } -/// One H264 NAL unit, with the 4-byte Annex-B start code already prepended. +/// One HEVC NAL unit, with the 4-byte Annex-B start code already prepended. #[derive(Debug, Clone)] pub struct Nal { pub data: Vec, @@ -51,7 +51,7 @@ pub fn start( let ctx = Box::into_raw(boxed) as *mut c_void; let rc = unsafe { - xz_capturer_start( + scilaxy_capturer_start( width as i32, height as i32, fps as i32, @@ -63,7 +63,7 @@ pub fn start( }; if rc != 0 { unsafe { drop(Box::from_raw(ctx as *mut mpsc::Sender)) }; - return Err("xz_capturer_start failed"); + return Err("scilaxy_capturer_start failed"); } Ok(rx) } @@ -72,7 +72,7 @@ pub fn start( /// tear down the encoder or WS publisher; just swaps SCKit's content /// filter. The next encoded keyframe will reflect the new display. pub fn select_display(display_id: u32) -> Result<(), &'static str> { - let rc = unsafe { xz_capturer_select_display(display_id) }; + let rc = unsafe { scilaxy_capturer_select_display(display_id) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -82,13 +82,13 @@ pub fn select_display(display_id: u32) -> Result<(), &'static str> { /// Currently active display id, or `0` if no capturer is running. pub fn active_display_id() -> u32 { - unsafe { xz_capturer_active_display_id() } + unsafe { scilaxy_capturer_active_display_id() } } /// Set the encoder's average bitrate ceiling (kbps). Cheap — VT applies /// it on the next frame. pub fn set_bitrate_kbps(kbps: u32) -> Result<(), &'static str> { - let rc = unsafe { xz_capturer_set_bitrate(kbps as i32) }; + let rc = unsafe { scilaxy_capturer_set_bitrate(kbps as i32) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -98,7 +98,7 @@ pub fn set_bitrate_kbps(kbps: u32) -> Result<(), &'static str> { /// Currently configured bitrate (kbps), or 0 if no capturer running. pub fn bitrate_kbps() -> u32 { - let v = unsafe { xz_capturer_bitrate_kbps() }; + let v = unsafe { scilaxy_capturer_bitrate_kbps() }; if v < 0 { 0 } else { @@ -108,7 +108,7 @@ pub fn bitrate_kbps() -> u32 { /// Set the target framerate. Updates SCKit + VT in one shot. pub fn set_fps(fps: u32) -> Result<(), &'static str> { - let rc = unsafe { xz_capturer_set_fps(fps as i32) }; + let rc = unsafe { scilaxy_capturer_set_fps(fps as i32) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -117,7 +117,7 @@ pub fn set_fps(fps: u32) -> Result<(), &'static str> { } pub fn fps() -> u32 { - let v = unsafe { xz_capturer_fps() }; + let v = unsafe { scilaxy_capturer_fps() }; if v < 0 { 0 } else { @@ -128,7 +128,7 @@ pub fn fps() -> u32 { /// Switch output resolution. Briefly freezes the viewer (~200ms) while /// the encoder rebuilds. pub fn set_resolution(width: u32, height: u32) -> Result<(), &'static str> { - let rc = unsafe { xz_capturer_set_resolution(width as i32, height as i32) }; + let rc = unsafe { scilaxy_capturer_set_resolution(width as i32, height as i32) }; match rc { 0 => Ok(()), 1 => Err("capturer not started"), @@ -138,7 +138,7 @@ pub fn set_resolution(width: u32, height: u32) -> Result<(), &'static str> { /// Returns `(width, height)`, or `(0, 0)` if no capturer is running. pub fn resolution() -> (u32, u32) { - let v = unsafe { xz_capturer_resolution() }; + let v = unsafe { scilaxy_capturer_resolution() }; if v <= 0 { return (0, 0); } @@ -163,7 +163,7 @@ pub fn list_displays() -> Vec { // 8 KB is far more than enough for typical setups (a 12-monitor wall // would be ≈ 1 KB). let mut buf = vec![0u8; 8192]; - let n = unsafe { xz_capturer_list_displays_json(buf.as_mut_ptr(), buf.len() as isize) }; + let n = unsafe { scilaxy_capturer_list_displays_json(buf.as_mut_ptr(), buf.len() as isize) }; if n < 0 { return Vec::new(); } diff --git a/crates/mac-capturer/swift/MacCapturer.swift b/crates/mac-capturer/swift/MacCapturer.swift index 26394a5..8b0f666 100644 --- a/crates/mac-capturer/swift/MacCapturer.swift +++ b/crates/mac-capturer/swift/MacCapturer.swift @@ -1,14 +1,14 @@ // MacCapturer.swift // -// Native screen capture + H264 encoding pipeline for xyzen-capturer. +// Native screen capture + HEVC encoding pipeline for scilaxy-capturer. // // ScreenCaptureKit (macOS 12.3+) → CVPixelBuffer -// → VTCompressionSession (H264 baseline 4.0, 30fps, 1s GOP) +// → VTCompressionSession (HEVC Main, 30fps, 1s GOP) // → Annex-B NAL bytes → Rust callback // // The pipeline is intentionally synchronous on a single dispatch queue. // Rust receives a flat byte buffer per NAL unit (with 4-byte start code), -// which is exactly what xyzen-capturer's WebSocket publisher expects. +// which is exactly what scilaxy-capturer's WebSocket publisher expects. // // We expose a small C ABI so build.rs can `swiftc -emit-library` // and Rust can `extern "C"` it with `#[link]`. @@ -23,7 +23,7 @@ import CoreVideo /// One NAL unit, callback-delivered. The buffer is **not** owned by the /// callee — copy out before returning. -public typealias XzNalCallback = @convention(c) ( +public typealias SciLaxyNalCallback = @convention(c) ( _ ctx: UnsafeMutableRawPointer?, _ data: UnsafePointer, _ length: Int, @@ -31,19 +31,19 @@ public typealias XzNalCallback = @convention(c) ( ) -> Void /// One-display-per-process singleton. We hold on to the running -/// MacCapturer so `xz_capturer_select_display` can swap the SCStream's +/// MacCapturer so `scilaxy_capturer_select_display` can swap the SCStream's /// content filter without tearing down the encoder + WS publisher. nonisolated(unsafe) private var sharedCapturer: MacCapturer? -@_cdecl("xz_capturer_start") -public func xz_capturer_start( +@_cdecl("scilaxy_capturer_start") +public func scilaxy_capturer_start( width: Int32, height: Int32, fps: Int32, bitrateKbps: Int32, displayId: UInt32, // 0 = default (first display) ctx: UnsafeMutableRawPointer?, - cb: XzNalCallback + cb: SciLaxyNalCallback ) -> Int32 { let s = MacCapturer( width: Int(width), @@ -57,7 +57,7 @@ public func xz_capturer_start( do { try s.start() } catch { - NSLog("xyzen mac-capturer: start failed: \(error)") + NSLog("scilaxy mac-capturer: start failed: \(error)") return 1 } sharedCapturer = s @@ -67,22 +67,22 @@ public func xz_capturer_start( /// Switch the running capturer to a different display. Returns 0 on /// success, non-zero if no capturer is running or SCKit refused the /// new content filter. -@_cdecl("xz_capturer_select_display") -public func xz_capturer_select_display(displayId: UInt32) -> Int32 { +@_cdecl("scilaxy_capturer_select_display") +public func scilaxy_capturer_select_display(displayId: UInt32) -> Int32 { guard let s = sharedCapturer else { return 1 } do { try s.selectDisplay(CGDirectDisplayID(displayId)) return 0 } catch { - NSLog("xyzen mac-capturer: select_display failed: \(error)") + NSLog("scilaxy mac-capturer: select_display failed: \(error)") return 2 } } /// Snapshot of the currently active display (set after `start` / /// after a successful `select_display`). -@_cdecl("xz_capturer_active_display_id") -public func xz_capturer_active_display_id() -> UInt32 { +@_cdecl("scilaxy_capturer_active_display_id") +public func scilaxy_capturer_active_display_id() -> UInt32 { return sharedCapturer?.currentDisplayId ?? 0 } @@ -91,8 +91,8 @@ public func xz_capturer_active_display_id() -> UInt32 { /// rebuild, no GOP boundary needed. /// /// Returns 0 on success, non-zero if the capturer isn't running. -@_cdecl("xz_capturer_set_bitrate") -public func xz_capturer_set_bitrate(kbps: Int32) -> Int32 { +@_cdecl("scilaxy_capturer_set_bitrate") +public func scilaxy_capturer_set_bitrate(kbps: Int32) -> Int32 { guard let s = sharedCapturer, let enc = s.encoderHandle else { return 1 } // Clamp to a sane range: 100 kbps floor (anything below that is // unusable for screens), 100 Mbps ceiling (above that there's no @@ -110,8 +110,8 @@ public func xz_capturer_set_bitrate(kbps: Int32) -> Int32 { } /// Currently configured bitrate (kbps), or `0` if no capturer running. -@_cdecl("xz_capturer_bitrate_kbps") -public func xz_capturer_bitrate_kbps() -> Int32 { +@_cdecl("scilaxy_capturer_bitrate_kbps") +public func scilaxy_capturer_bitrate_kbps() -> Int32 { return Int32(sharedCapturer?.currentBitrateKbps ?? 0) } @@ -119,22 +119,22 @@ public func xz_capturer_bitrate_kbps() -> Int32 { /// `minimumFrameInterval` and VT's `ExpectedFrameRate` / /// `MaxKeyFrameInterval` so the GOP cadence stays at 1 second. /// Returns 0 on success. -@_cdecl("xz_capturer_set_fps") -public func xz_capturer_set_fps(fps: Int32) -> Int32 { +@_cdecl("scilaxy_capturer_set_fps") +public func scilaxy_capturer_set_fps(fps: Int32) -> Int32 { guard let s = sharedCapturer else { return 1 } let clamped = max(5, min(120, Int(fps))) do { try s.setFps(clamped) return 0 } catch { - NSLog("xyzen mac-capturer: setFps failed: \(error)") + NSLog("scilaxy mac-capturer: setFps failed: \(error)") return 2 } } /// Currently configured fps, or `0` if no capturer running. -@_cdecl("xz_capturer_fps") -public func xz_capturer_fps() -> Int32 { +@_cdecl("scilaxy_capturer_fps") +public func scilaxy_capturer_fps() -> Int32 { return Int32(sharedCapturer?.currentFps ?? 0) } @@ -142,8 +142,8 @@ public func xz_capturer_fps() -> Int32 { /// and brings up a new one at the new size; the SCStream stays running. /// Expect a brief (~100-200ms) freeze on the viewer side as the new /// SPS+PPS+IDR propagate. Returns 0 on success. -@_cdecl("xz_capturer_set_resolution") -public func xz_capturer_set_resolution(width: Int32, height: Int32) -> Int32 { +@_cdecl("scilaxy_capturer_set_resolution") +public func scilaxy_capturer_set_resolution(width: Int32, height: Int32) -> Int32 { guard let s = sharedCapturer else { return 1 } let w = max(160, min(7680, Int(width))) let h = max(120, min(4320, Int(height))) @@ -151,15 +151,15 @@ public func xz_capturer_set_resolution(width: Int32, height: Int32) -> Int32 { try s.setResolution(width: w, height: h) return 0 } catch { - NSLog("xyzen mac-capturer: setResolution failed: \(error)") + NSLog("scilaxy mac-capturer: setResolution failed: \(error)") return 2 } } /// Returns `width << 16 | height` packed into a single Int32 — caller /// extracts the two halves. Cheap to read; avoids a second FFI call. -@_cdecl("xz_capturer_resolution") -public func xz_capturer_resolution() -> Int32 { +@_cdecl("scilaxy_capturer_resolution") +public func scilaxy_capturer_resolution() -> Int32 { guard let s = sharedCapturer else { return 0 } let w = Int32(min(0xFFFF, s.currentWidth)) let h = Int32(min(0xFFFF, s.currentHeight)) @@ -170,8 +170,8 @@ public func xz_capturer_resolution() -> Int32 { /// `[{"id":,"width":,"height":,"is_primary":}, …]`. /// Returns the number of bytes written, or `-1` if `out` is too small /// (caller should retry with `cap` doubled). -@_cdecl("xz_capturer_list_displays_json") -public func xz_capturer_list_displays_json( +@_cdecl("scilaxy_capturer_list_displays_json") +public func scilaxy_capturer_list_displays_json( out: UnsafeMutablePointer, cap: Int ) -> Int { @@ -203,10 +203,10 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked private var height: Int private var fps: Int private let ctx: UnsafeMutableRawPointer? - private let cb: XzNalCallback + private let cb: SciLaxyNalCallback private var stream: SCStream? private var encoder: VTCompressionSession? - private let queue = DispatchQueue(label: "ai.xyzen.capturer", qos: .userInteractive) + private let queue = DispatchQueue(label: "ai.scilaxy.capturer", qos: .userInteractive) private var hasEmittedSpsPps = false /// Caller's preferred display, or `nil` to pick the first one returned @@ -216,8 +216,8 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked /// Display the SCStream is currently filtering on. Reset whenever /// `selectDisplay` swaps the content filter. var currentDisplayId: CGDirectDisplayID = 0 - /// Read-write so `xz_capturer_set_bitrate` can mutate the live encoder. - /// Tracked here so callers can `xz_capturer_bitrate_kbps()` it back + /// Read-write so `scilaxy_capturer_set_bitrate` can mutate the live encoder. + /// Tracked here so callers can `scilaxy_capturer_bitrate_kbps()` it back /// without re-poking VT. var currentBitrateKbps: Int = 0 /// Public accessor for the C ABI bridge — VT properties live on the @@ -226,7 +226,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked var encoderHandle: VTCompressionSession? { encoder } init(width: Int, height: Int, fps: Int, bitrateKbps: Int, - ctx: UnsafeMutableRawPointer?, cb: @escaping XzNalCallback, + ctx: UnsafeMutableRawPointer?, cb: @escaping SciLaxyNalCallback, initialDisplayId: CGDirectDisplayID? = nil) { self.width = width self.height = height @@ -242,12 +242,12 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked var currentFps: Int { fps } func start() throws { - NSLog("xyzen mac-capturer: start()") + NSLog("scilaxy mac-capturer: start()") // Build the encoder before SCKit so we don't drop frames during init. try makeEncoder() - NSLog("xyzen mac-capturer: encoder ready") + NSLog("scilaxy mac-capturer: encoder ready") try startCapture() - NSLog("xyzen mac-capturer: capture session started") + NSLog("scilaxy mac-capturer: capture session started") } private func makeEncoder() throws { @@ -332,7 +332,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked throw NSError(domain: "MacCapturer", code: -1, userInfo: [NSLocalizedDescriptionKey: "no display"]) } - NSLog("xyzen mac-capturer: got display id=%u %dx%d", + NSLog("scilaxy mac-capturer: got display id=%u %dx%d", UInt32(display.displayID), display.width, display.height) self.currentDisplayId = display.displayID @@ -397,7 +397,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked } if let e = updateError { throw e } self.currentDisplayId = id - NSLog("xyzen mac-capturer: switched to display id=%u %dx%d", + NSLog("scilaxy mac-capturer: switched to display id=%u %dx%d", UInt32(id), display.width, display.height) } @@ -448,7 +448,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked value: NSNumber(value: newFps)) } self.fps = newFps - NSLog("xyzen mac-capturer: fps -> %d", newFps) + NSLog("scilaxy mac-capturer: fps -> %d", newFps) } /// Tear down the encoder, rebuild at the new size, and reconfigure @@ -497,7 +497,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked // 3) Build a fresh encoder at the new size with the *current* // bitrate/fps settings preserved. try makeEncoder() - NSLog("xyzen mac-capturer: resolution -> %dx%d", newW, newH) + NSLog("scilaxy mac-capturer: resolution -> %dx%d", newW, newH) } // MARK: SCStreamOutput @@ -527,7 +527,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked } func stream(_ stream: SCStream, didStopWithError error: Error) { - NSLog("xyzen mac-capturer: stream stopped: \(error)") + NSLog("scilaxy mac-capturer: stream stopped: \(error)") } // MARK: encode → annex-b @@ -603,7 +603,7 @@ final class MacCapturer: NSObject, SCStreamDelegate, SCStreamOutput, @unchecked private func emitAnnexBChunk(_ data: Data, ptsUs: Int64) { // Prepend an 8-byte big-endian wallclock microsecond timestamp so // the viewer can compute end-to-end latency. This is OUR header, - // not part of the H264 stream — viewer must strip the first 8 + // not part of the HEVC stream — viewer must strip the first 8 // bytes before passing the NAL to its decoder. // // Wallclock vs PTS: the viewer's clock is independent (different @@ -680,7 +680,7 @@ private func listDisplaysSync() -> [DisplayInfo] { ) } } catch { - NSLog("xyzen mac-capturer: listDisplaysSync failed: \(error)") + NSLog("scilaxy mac-capturer: listDisplaysSync failed: \(error)") return [] } } diff --git a/crates/win-capturer/src/display.rs b/crates/win-capturer/src/display.rs index 561394f..16bb9be 100644 --- a/crates/win-capturer/src/display.rs +++ b/crates/win-capturer/src/display.rs @@ -42,7 +42,7 @@ pub fn list_displays() -> Vec { }; Some(DisplayInfo { // 1-based id so 0 stays reserved for "default - // monitor" in xz_capturer_start, matching the + // monitor" in scilaxy_capturer_start, matching the // mac-capturer convention. id: (idx as u32) + 1, width, diff --git a/scripts/dump_view.py b/scripts/dump_view.py index 18f74b1..7df48df 100644 --- a/scripts/dump_view.py +++ b/scripts/dump_view.py @@ -4,8 +4,8 @@ """ import os, sys, socket, struct, base64, time -HOST = os.environ.get("XYZEN_HOST", "127.0.0.1") -PORT = int(os.environ.get("XYZEN_STREAM_PORT", "21130")) +HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") +PORT = int(os.environ.get("SCILAXY_STREAM_PORT", "21130")) peer = sys.argv[1] if len(sys.argv) > 1 else "test123" secs = float(sys.argv[2]) if len(sys.argv) > 2 else 3.0 out_path = sys.argv[3] if len(sys.argv) > 3 else "/tmp/sample.h264" diff --git a/scripts/smoke_stream.py b/scripts/smoke_stream.py index 687c663..e4bff1d 100644 --- a/scripts/smoke_stream.py +++ b/scripts/smoke_stream.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""End-to-end fan-out smoke test for xyzen-stream. +"""End-to-end fan-out smoke test for scilaxy-stream. Opens one publisher (ws /ws/stream/) and two viewers (ws /ws/view/), sends 5 binary frames from the publisher, expects each viewer to receive all 5 @@ -13,8 +13,8 @@ import threading import time -HOST = os.environ.get("XYZEN_HOST", "127.0.0.1") -PORT = int(os.environ.get("XYZEN_STREAM_PORT", "21130")) +HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") +PORT = int(os.environ.get("SCILAXY_STREAM_PORT", "21130")) def ws_connect(path: str): diff --git a/scripts/smoke_ws_register.py b/scripts/smoke_ws_register.py index 2d61863..f98cc2a 100644 --- a/scripts/smoke_ws_register.py +++ b/scripts/smoke_ws_register.py @@ -13,8 +13,8 @@ import base64 import hashlib -HOST = os.environ.get("XYZEN_HOST", "127.0.0.1") -PORT = int(os.environ.get("XYZEN_WS_PORT", "21118")) +HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") +PORT = int(os.environ.get("SCILAXY_RDV_WS_PORT", "21118")) def varint(n: int) -> bytes: out = bytearray() diff --git a/scripts/smoke_ws_via_nginx.py b/scripts/smoke_ws_via_nginx.py index f823169..fa88e85 100644 --- a/scripts/smoke_ws_via_nginx.py +++ b/scripts/smoke_ws_via_nginx.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -"""Verify that ws://localhost/ws/id reaches xyzen-rendezvous via nginx.""" +"""Verify that ws://localhost/ws/id reaches scilaxy-rendezvous via nginx.""" import os, socket, struct, sys, base64 -HOST = os.environ.get("XYZEN_HOST", "127.0.0.1") -PORT = int(os.environ.get("XYZEN_PORT", "80")) -PATH = os.environ.get("XYZEN_PATH", "/ws/id") +HOST = os.environ.get("SCILAXY_HOST", "127.0.0.1") +PORT = int(os.environ.get("SCILAXY_PORT", "80")) +PATH = os.environ.get("SCILAXY_PATH", "/ws/id") def varint(n): o = bytearray() @@ -70,7 +70,7 @@ def need(n): body = bytes(buf[cur:cur+n]) print(f"got {len(body)} bytes: {body.hex()}", file=sys.stderr) if body[:2] == b"\x3a\x00": - print("OK: nginx → xyzen-rendezvous WebSocket path works", file=sys.stderr) + print("OK: nginx → scilaxy-rendezvous WebSocket path works", file=sys.stderr) sys.exit(0) else: print(f"unexpected body: {body.hex()}", file=sys.stderr)