feat(preview): MJPEG loopback stream server for single-surface playback (#64, #142)#153
Open
cuic19053-hue wants to merge 1 commit into
Open
feat(preview): MJPEG loopback stream server for single-surface playback (#64, #142)#153cuic19053-hue wants to merge 1 commit into
cuic19053-hue wants to merge 1 commit into
Conversation
…ck (appergb#64, appergb#142) - New src-tauri/src/playback.rs: axum HTTP server on 127.0.0.1:0 random port, /stream endpoint returns multipart/x-mixed-replace MJPEG stream. Broadcast channel (cap 2) feeds JPEG frames to connected <img> clients. - render.rs: composite_frame pushes JPEG (q75) to broadcast sender when active subscribers exist (receiver_count > 0 guard avoids wasted CPU). - lib.rs: register playback module + get_preview_endpoint command, start PreviewServer in setup hook via block_on, manage as Tauri state. - tauri.conf.json: set explicit CSP with img-src/connect-src allowing http://127.0.0.1:* for the MJPEG stream. - web/api.ts: add getPreviewEndpoint() wrapping invoke('get_preview_endpoint'). - web/Preview.tsx: playing state renders MJPEG <img> when previewEndpoint is available; paused/scrub retains existing composite PNG path. This is the transport layer for issue appergb#142's single-surface model: Rust composite frames flow through MJPEG to a single <img>, making play/pause/seek a state switch on one render surface. The current frame source is composite_frame (per-call GPU render); appergb#53's streaming decode engine will replace it later.
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.
fixes #64
refs #142
问题
issue #142(P0 剪辑套件大面积失效)要求时间轴播放/预览按上游 palmier-pro 1:1 重写为单渲染面模型。当前预览是双面拼接(播放=DOM
修复
#64(MJPEG 回环传输)是 #142 忠实复刻路线的核心传输层:Rust 合成帧 → axum MJPEG 流 → 前端单
,让 play/pause/seek/scrub 变成单面状态切换。
后端
eceiver_count() > 0 守卫,无订阅时不编码(避免浪费 CPU)。
前端
不在本 PR 范围
验证
安全