simvx.graphics.streaming.server

WebSocket JPEG streaming server — captures frames from the Vulkan renderer and streams to browsers.

Module Contents

Classes

StreamingServer

WebSocket JPEG streaming server for SimVX.

Data

API

simvx.graphics.streaming.server.log[source]

‘getLogger(…)’

simvx.graphics.streaming.server.__all__

[‘StreamingServer’]

class simvx.graphics.streaming.server.StreamingServer(host: str = '0.0.0.0', port: int = 8080, quality: int = 85, fps: int = 30)[source]

WebSocket JPEG streaming server for SimVX.

Serves a browser client and streams rendered frames as JPEG over WebSocket. Input events from the browser are forwarded to the engine’s Input singleton.

Usage::

server = StreamingServer(host="0.0.0.0", port=8080)
app = App(width=1280, height=720, visible=False)
app.run_streaming(MyGameScene(), server)

Initialization

start(width: int, height: int) None[source]

Start the streaming server in a background thread.

stop() None[source]

Stop the streaming server and close all WebSocket connections.

push_frame(pixels: numpy.ndarray) None[source]

Push a captured frame for streaming. Thread-safe, called from the engine’s main loop.

Drops frame silently if the encoder is behind (non-blocking).

drain_input() list[dict][source]

Drain all queued input events. Called from the main thread.

has_clients() bool[source]

Whether any browser clients are connected.