session tweak, update docs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Client pipeline data flow — Phase 2
|
||||
// Client pipeline data flow
|
||||
// Sender machine (Wayland, VAAPI GPU)
|
||||
digraph client_pipeline {
|
||||
graph [fontname="monospace" bgcolor="#1e1e2e" rankdir=TB pad="0.6" splines=polyline]
|
||||
@@ -9,43 +9,58 @@ digraph client_pipeline {
|
||||
// Hardware
|
||||
drm [label="/dev/dri/card0\n(KMS scanout)" shape=cylinder fillcolor="#1e3a2f" color="#a6e3a1"]
|
||||
vaapi [label="/dev/dri/renderD128\n(VAAPI)" shape=cylinder fillcolor="#1e3a2f" color="#a6e3a1"]
|
||||
net [label="TCP :4444\nmcrndeb" shape=parallelogram fillcolor="#1e2a3e" color="#89b4fa"]
|
||||
pulse [label="PulseAudio\n─────────────\nmonitor: default_sink.monitor\nmic: default-source" shape=cylinder fillcolor="#1e3a2f" color="#a6e3a1"]
|
||||
net [label="TCP :4447\nmcrndeb" shape=parallelogram fillcolor="#1e2a3e" color="#89b4fa"]
|
||||
|
||||
// Thread boundary
|
||||
subgraph cluster_main {
|
||||
label="main thread (tokio async)" fontcolor="#a6adc8" color="#45475a" fontname="monospace"
|
||||
label="main thread (tokio async)" fontcolor="#a6adc8" color="#45475a" fontname="monospace"
|
||||
|
||||
session_start [label="session_start\ncontrol message" fillcolor="#2d2038" color="#cba6f7"]
|
||||
mux [label="select!\npkt_rx | keepalive | ctrl-c" fillcolor="#2d2038" color="#cba6f7"]
|
||||
keepalive [label="keepalive / 5s" fillcolor="#2d2038" color="#cba6f7"]
|
||||
wait_server [label="wait_for_server\n─────────────\nretry connect / 2s\nCtrl-C to cancel" fillcolor="#2d2038" color="#cba6f7"]
|
||||
session_start [label="session_start\n─────────────\nid: YYYYMMDD_HHMMSS\nvideo + audio params" fillcolor="#2d2038" color="#cba6f7"]
|
||||
mux [label="select!\npkt_rx | keepalive | ctrl-c" fillcolor="#2d2038" color="#cba6f7"]
|
||||
write [label="BufWriter\nwrite_packet()" fillcolor="#1e2d3e" color="#89b4fa"]
|
||||
shutdown [label="Shutdown\n─────────────\npipeline.stop() (5s timeout)\nSessionStop (2s timeout)\nsingle Ctrl-C" fillcolor="#2d2038" color="#cba6f7"]
|
||||
}
|
||||
|
||||
subgraph cluster_pipeline {
|
||||
label="capture-pipeline thread (blocking)" fontcolor="#a6adc8" color="#45475a" fontname="monospace"
|
||||
subgraph cluster_subprocess {
|
||||
label="Subprocess backend (default)" fontcolor="#a6adc8" color="#45475a" fontname="monospace"
|
||||
|
||||
capture [label="KmsCapture\n─────────────────\nffmpeg kmsgrab device\ndecoder: passthrough\noutput: DRM_PRIME frames\n+ hw_frames_ctx (DRM device)"
|
||||
fillcolor="#1e2d3e" color="#89b4fa"]
|
||||
ffmpeg_cli [label="ffmpeg subprocess\n─────────────\nkmsgrab → VAAPI h264\n+ PulseAudio inputs:\n amix(monitor, mic)\noutput: NUT pipe" fillcolor="#1e2d3e" color="#89b4fa"]
|
||||
|
||||
encoder [label="VaapiEncoder\n─────────────────\n[lazy init on frame 1]\nbuffersrc ← hw_frames_ctx\nhwmap derive_device=vaapi\nscale_vaapi NV12 1920×1080\nh264_vaapi QP=20 GOP=30"
|
||||
fillcolor="#1e2d3e" color="#89b4fa"]
|
||||
demux [label="NUT Demuxer\n─────────────\nffmpeg-next in-process\nfinds video + audio streams\nsends EncodedPacket\n { data, pts, media_type }" fillcolor="#1e2d3e" color="#89b4fa"]
|
||||
|
||||
chan [label="mpsc::channel(64)\nEncodedPacket" shape=parallelogram fillcolor="#2d2038" color="#cba6f7"]
|
||||
chan [label="mpsc::channel(64)\nEncodedPacket" shape=parallelogram fillcolor="#2d2038" color="#cba6f7"]
|
||||
}
|
||||
|
||||
// Flow
|
||||
drm -> capture [label="DMA-BUF\n(zero copy)"]
|
||||
vaapi -> encoder [label="hw device\n(derived)" style=dashed color="#a6e3a1"]
|
||||
capture -> encoder [label="AVFrame\nDRM_PRIME"]
|
||||
encoder -> chan [label="EncodedPacket\n{ data, pts, keyframe, … }"]
|
||||
chan -> mux
|
||||
subgraph cluster_direct {
|
||||
label="VaapiDirect backend (experimental)" fontcolor="#6c7086" color="#45475a" fontname="monospace" style=dashed
|
||||
|
||||
capture [label="KmsCapture\n─────────────\nDRM_PRIME frames" fillcolor="#2d1e1e" color="#f38ba8"]
|
||||
encoder [label="VaapiEncoder\n─────────────\nhwmap → scale_vaapi\nh264_vaapi QP=20" fillcolor="#2d1e1e" color="#f38ba8"]
|
||||
}
|
||||
|
||||
// Flow — subprocess
|
||||
drm -> ffmpeg_cli [label="kmsgrab"]
|
||||
vaapi -> ffmpeg_cli [label="h264_vaapi"]
|
||||
pulse -> ffmpeg_cli [label="-f pulse\nmonitor + mic"]
|
||||
ffmpeg_cli -> demux [label="NUT pipe\n(stdout)"]
|
||||
demux -> chan [label="EncodedPacket\n(Video or Audio)"]
|
||||
|
||||
// Flow — direct (dashed, experimental)
|
||||
drm -> capture [style=dashed]
|
||||
vaapi -> encoder [style=dashed]
|
||||
capture -> encoder [style=dashed label="DRM_PRIME"]
|
||||
encoder -> chan [style=dashed]
|
||||
|
||||
// Flow — main
|
||||
chan -> mux
|
||||
wait_server -> session_start
|
||||
session_start -> write
|
||||
mux -> write [label="WirePacket"]
|
||||
mux -> keepalive [style=dashed]
|
||||
keepalive -> write
|
||||
write -> net
|
||||
mux -> write [label="WirePacket\nVideo | Audio"]
|
||||
write -> net
|
||||
mux -> shutdown [label="Ctrl-C or\nchannel closed"]
|
||||
|
||||
// Types note
|
||||
types [label="EncodedPacket\n─────────────\ndata: Vec\<u8\> (H.264 NALUs)\npts / dts: i64\nkeyframe: bool\ntime_base: num/den"
|
||||
types [label="WirePacket types\n─────────────\nVideo: H.264 NALUs + keyframe flag\nAudio: AAC frames\nControl: SessionStart/Stop/Keepalive"
|
||||
shape=note fillcolor="#2a2a3e" color="#585b70"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user