forked from genewildish/Mainline
Add Streaming display backend #26
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add a new "Streaming" display backend that renders to streaming formats (HLS, DASH, or raw frames via WebSocket).
Motivation
Currently Mainline supports:
A "Streaming" display would enable:
Potential Approaches
Context
See existing display implementations in
engine/display/backends/Additional context
From our architecture docs, the Display protocol requires:
init(width, height, reuse=False)show(buffer: list[str], border: bool = False)clear() -> Nonecleanup() -> NoneOptional methods:
is_quit_requested() -> boolclear_quit_request() -> NoneClarification (2026-03-18)
After analyzing the codebase, there's some confusion about the scope of this issue. Let me clarify:
Current State
The existing
WebSocketDisplayinengine/display/backends/websocket.pyalready streams frames to web clients. However, there's a TODO comment indicating it needs optimization:Decision: Focus on WebSocket Optimization
Rather than implementing a new "Streaming" display backend (RTMP/HLS), we should optimize the existing WebSocket display. This will:
Implementation Plan (Option B - Binary Protocol with Compression)
Design binary protocol:
Compression approach:
Backward compatibility:
Dependencies
This optimization enables Issue #33 (Web Editor) by providing efficient real-time updates.
Alternative: RTMP Streaming
If RTMP streaming is still needed, that could be a separate issue. The current scope is just WebSocket optimization.
Should we proceed with this plan?
Completed in Commit
c57617bengine/display/streaming.py- New streaming display backend with:This enables efficient real-time preview for the web editor.