This commit is contained in:
2026-04-09 18:19:03 -03:00
parent 5921cd6562
commit 5b467ffba8
18 changed files with 1793 additions and 43 deletions

View File

@@ -0,0 +1,230 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 14.1.2 (0)
-->
<!-- Title: server_pipeline Pages: 1 -->
<svg width="1933pt" height="1038pt"
viewBox="0.00 0.00 1933.00 1038.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(43.2 994.44)">
<title>server_pipeline</title>
<polygon fill="#1e1e2e" stroke="none" points="-43.2,43.2 -43.2,-994.44 1890.2,-994.44 1890.2,43.2 -43.2,43.2"/>
<g id="clust1" class="cluster">
<title>cluster_implemented</title>
<polygon fill="#1e1e2e" stroke="#a6e3a1" points="417,-659.65 417,-838.93 667,-838.93 667,-659.65 417,-659.65"/>
<text xml:space="preserve" text-anchor="middle" x="542" y="-821.63" font-family="monospace" font-size="14.00" fill="#a6e3a1">Implemented (Phase 2)</text>
</g>
<g id="clust2" class="cluster">
<title>cluster_planned</title>
<polygon fill="#1e1e2e" stroke="#f38ba8" stroke-dasharray="5,2" points="8,-166.06 8,-624.4 1080,-624.4 1080,-166.06 8,-166.06"/>
<text xml:space="preserve" text-anchor="middle" x="544" y="-607.1" font-family="monospace" font-size="14.00" fill="#f38ba8">Planned</text>
</g>
<!-- net -->
<g id="node1" class="node">
<title>net</title>
<polygon fill="#1e2a3e" stroke="#89b4fa" points="656.3,-951.24 474.47,-951.24 427.7,-882.18 609.53,-882.18 656.3,-951.24"/>
<text xml:space="preserve" text-anchor="middle" x="542" y="-912.03" font-family="monospace" font-size="14.00" fill="#cdd6f4">TCP :4444</text>
</g>
<!-- listener -->
<g id="node3" class="node">
<title>listener</title>
<polygon fill="#1e2d3e" stroke="#89b4fa" points="659,-805.68 425,-805.68 425,-667.65 659,-667.65 659,-805.68"/>
<text xml:space="preserve" text-anchor="middle" x="542" y="-783.74" font-family="monospace" font-size="14.00" fill="#cdd6f4">Listener</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-766.49" font-family="monospace" font-size="14.00" fill="#cdd6f4">─────────────</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-749.24" font-family="monospace" font-size="14.00" fill="#cdd6f4">TCP accept loop</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-731.99" font-family="monospace" font-size="14.00" fill="#cdd6f4">spawns task per client</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-714.74" font-family="monospace" font-size="14.00" fill="#cdd6f4">reads WirePacket headers</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-697.49" font-family="monospace" font-size="14.00" fill="#cdd6f4">counts video/audio pkts</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-680.24" font-family="monospace" font-size="14.00" fill="#cdd6f4">logs keyframes + ts</text>
</g>
<!-- net&#45;&gt;listener -->
<g id="edge1" class="edge">
<title>net&#45;&gt;listener</title>
<path fill="none" stroke="#585b70" d="M542,-881.8C542,-863.5 542,-840.08 542,-817.47"/>
<polygon fill="#585b70" stroke="#585b70" points="545.5,-817.61 542,-807.61 538.5,-817.61 545.5,-817.61"/>
<text xml:space="preserve" text-anchor="middle" x="583.25" y="-850.88" font-family="monospace" font-size="14.00" fill="#a6adc8">WirePacket</text>
</g>
<!-- python -->
<g id="node2" class="node">
<title>python</title>
<polygon fill="#2a2a3e" stroke="#cba6f7" points="609.83,-103.56 291.94,-103.56 210.17,0 528.06,0 609.83,-103.56"/>
<text xml:space="preserve" text-anchor="middle" x="410" y="-55.73" font-family="monospace" font-size="14.00" fill="#cdd6f4">Python app</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-38.48" font-family="monospace" font-size="14.00" fill="#cdd6f4">(stream/manager.py)</text>
</g>
<!-- decoder -->
<g id="node4" class="node">
<title>decoder</title>
<polygon fill="#2d1e1e" stroke="#f38ba8" points="634.25,-591.15 449.75,-591.15 449.75,-504.87 634.25,-504.87 634.25,-591.15"/>
<text xml:space="preserve" text-anchor="middle" x="542" y="-569.21" font-family="monospace" font-size="14.00" fill="#cdd6f4">Decoder &#160;(Phase 3)</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-551.96" font-family="monospace" font-size="14.00" fill="#cdd6f4">─────────────</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-534.71" font-family="monospace" font-size="14.00" fill="#cdd6f4">NVDEC H.264 → NV12</text>
<text xml:space="preserve" text-anchor="middle" x="542" y="-517.46" font-family="monospace" font-size="14.00" fill="#cdd6f4">GPU frames</text>
</g>
<!-- listener&#45;&gt;decoder -->
<g id="edge2" class="edge">
<title>listener&#45;&gt;decoder</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M542,-667.22C542,-646 542,-622.93 542,-602.84"/>
<polygon fill="#585b70" stroke="#585b70" points="545.5,-602.91 542,-592.91 538.5,-602.91 545.5,-602.91"/>
<text xml:space="preserve" text-anchor="middle" x="595.62" y="-636.35" font-family="monospace" font-size="14.00" fill="#a6adc8">H.264 payload</text>
</g>
<!-- scene -->
<g id="node5" class="node">
<title>scene</title>
<polygon fill="#2d1e1e" stroke="#f38ba8" points="266.25,-451.62 15.75,-451.62 15.75,-330.84 266.25,-330.84 266.25,-451.62"/>
<text xml:space="preserve" text-anchor="middle" x="141" y="-429.68" font-family="monospace" font-size="14.00" fill="#cdd6f4">Scene Detector &#160;(Phase 3)</text>
<text xml:space="preserve" text-anchor="middle" x="141" y="-412.43" font-family="monospace" font-size="14.00" fill="#cdd6f4">─────────────</text>
<text xml:space="preserve" text-anchor="middle" x="141" y="-395.18" font-family="monospace" font-size="14.00" fill="#cdd6f4">ffmpeg select filter</text>
<text xml:space="preserve" text-anchor="middle" x="141" y="-377.93" font-family="monospace" font-size="14.00" fill="#cdd6f4">in&#45;process (no subprocess)</text>
<text xml:space="preserve" text-anchor="middle" x="141" y="-360.68" font-family="monospace" font-size="14.00" fill="#cdd6f4">JPEG → frames/</text>
<text xml:space="preserve" text-anchor="middle" x="141" y="-343.43" font-family="monospace" font-size="14.00" fill="#cdd6f4">frames/index.json</text>
</g>
<!-- decoder&#45;&gt;scene -->
<g id="edge3" class="edge">
<title>decoder&#45;&gt;scene</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M449.34,-513.78C384.87,-490.66 306.43,-462.53 277.46,-451.7"/>
<polygon fill="#585b70" stroke="#585b70" points="278.72,-448.43 268.13,-448.08 276.19,-454.96 278.72,-448.43"/>
<text xml:space="preserve" text-anchor="middle" x="410.88" y="-473.57" font-family="monospace" font-size="14.00" fill="#a6adc8">NV12 frame</text>
</g>
<!-- audio -->
<g id="node6" class="node">
<title>audio</title>
<polygon fill="#2d1e1e" stroke="#f38ba8" points="535.25,-434.37 284.75,-434.37 284.75,-348.09 535.25,-348.09 535.25,-434.37"/>
<text xml:space="preserve" text-anchor="middle" x="410" y="-412.43" font-family="monospace" font-size="14.00" fill="#cdd6f4">Audio Extractor &#160;(Phase 4)</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-395.18" font-family="monospace" font-size="14.00" fill="#cdd6f4">─────────────</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-377.93" font-family="monospace" font-size="14.00" fill="#cdd6f4">AAC decode</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-360.68" font-family="monospace" font-size="14.00" fill="#cdd6f4">WAV chunks → audio/</text>
</g>
<!-- decoder&#45;&gt;audio -->
<g id="edge6" class="edge">
<title>decoder&#45;&gt;audio</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M505.93,-504.72C489.77,-485.77 470.58,-463.26 453.62,-443.38"/>
<polygon fill="#585b70" stroke="#585b70" points="456.39,-441.23 447.24,-435.89 451.06,-445.77 456.39,-441.23"/>
<text xml:space="preserve" text-anchor="middle" x="524.95" y="-473.57" font-family="monospace" font-size="14.00" fill="#a6adc8">audio pkt</text>
</g>
<!-- writer -->
<g id="node7" class="node">
<title>writer</title>
<polygon fill="#2d1e1e" stroke="#f38ba8" points="795.12,-434.37 552.88,-434.37 552.88,-348.09 795.12,-348.09 795.12,-434.37"/>
<text xml:space="preserve" text-anchor="middle" x="674" y="-412.43" font-family="monospace" font-size="14.00" fill="#cdd6f4">Segment Writer &#160;(Phase 3)</text>
<text xml:space="preserve" text-anchor="middle" x="674" y="-395.18" font-family="monospace" font-size="14.00" fill="#cdd6f4">─────────────</text>
<text xml:space="preserve" text-anchor="middle" x="674" y="-377.93" font-family="monospace" font-size="14.00" fill="#cdd6f4">fMP4 segments → stream/</text>
<text xml:space="preserve" text-anchor="middle" x="674" y="-360.68" font-family="monospace" font-size="14.00" fill="#cdd6f4">keyframe boundaries</text>
</g>
<!-- decoder&#45;&gt;writer -->
<g id="edge4" class="edge">
<title>decoder&#45;&gt;writer</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M578.07,-504.72C594.23,-485.77 613.42,-463.26 630.38,-443.38"/>
<polygon fill="#585b70" stroke="#585b70" points="632.94,-445.77 636.76,-435.89 627.61,-441.23 632.94,-445.77"/>
<text xml:space="preserve" text-anchor="middle" x="653.38" y="-473.57" font-family="monospace" font-size="14.00" fill="#a6adc8">encoded pkt</text>
</g>
<!-- framebuf -->
<g id="node8" class="node">
<title>framebuf</title>
<polygon fill="#2d1e1e" stroke="#f38ba8" points="1072.38,-442.99 813.62,-442.99 813.62,-339.46 1072.38,-339.46 1072.38,-442.99"/>
<text xml:space="preserve" text-anchor="middle" x="943" y="-421.05" font-family="monospace" font-size="14.00" fill="#cdd6f4">Frame Buffer &#160;(Phase 6)</text>
<text xml:space="preserve" text-anchor="middle" x="943" y="-403.8" font-family="monospace" font-size="14.00" fill="#cdd6f4">─────────────</text>
<text xml:space="preserve" text-anchor="middle" x="943" y="-386.55" font-family="monospace" font-size="14.00" fill="#cdd6f4">GPU ring buffer ~300 frames</text>
<text xml:space="preserve" text-anchor="middle" x="943" y="-369.3" font-family="monospace" font-size="14.00" fill="#cdd6f4">scrub: GPU→CPU on demand</text>
<text xml:space="preserve" text-anchor="middle" x="943" y="-352.05" font-family="monospace" font-size="14.00" fill="#cdd6f4">→ /dev/shm/cht_scrub_frame</text>
</g>
<!-- decoder&#45;&gt;framebuf -->
<g id="edge5" class="edge">
<title>decoder&#45;&gt;framebuf</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M634.74,-513.24C710.11,-485.8 804,-451.62 804,-451.62 804,-451.62 807.23,-450.24 812.71,-447.9"/>
<polygon fill="#585b70" stroke="#585b70" points="813.82,-451.23 821.64,-444.08 811.07,-444.79 813.82,-451.23"/>
<text xml:space="preserve" text-anchor="middle" x="791.01" y="-473.57" font-family="monospace" font-size="14.00" fill="#a6adc8">GPU frame</text>
</g>
<!-- ipc -->
<g id="node9" class="node">
<title>ipc</title>
<polygon fill="#2d1e1e" stroke="#f38ba8" points="576.5,-277.59 243.5,-277.59 243.5,-174.06 576.5,-174.06 576.5,-277.59"/>
<text xml:space="preserve" text-anchor="middle" x="410" y="-255.65" font-family="monospace" font-size="14.00" fill="#cdd6f4">IPC Server &#160;(Phase 5)</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-238.4" font-family="monospace" font-size="14.00" fill="#cdd6f4">─────────────</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-221.15" font-family="monospace" font-size="14.00" fill="#cdd6f4">Unix socket JSON&#45;lines</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-203.9" font-family="monospace" font-size="14.00" fill="#cdd6f4">commands: start/stop/get_frame</text>
<text xml:space="preserve" text-anchor="middle" x="410" y="-186.65" font-family="monospace" font-size="14.00" fill="#cdd6f4">events: frame_detected/audio_chunk/…</text>
</g>
<!-- scene&#45;&gt;ipc -->
<g id="edge7" class="edge">
<title>scene&#45;&gt;ipc</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M235.26,-330.56C265.11,-311.66 290.5,-295.59 290.5,-295.59 290.5,-295.59 298.93,-290.74 311.31,-283.61"/>
<polygon fill="#585b70" stroke="#585b70" points="312.73,-286.84 319.65,-278.81 309.24,-280.77 312.73,-286.84"/>
<text xml:space="preserve" text-anchor="middle" x="348.25" y="-299.54" font-family="monospace" font-size="14.00" fill="#a6adc8">frame_detected</text>
</g>
<!-- frames_dir -->
<g id="node10" class="node">
<title>frames_dir</title>
<polygon fill="#2a2a3e" stroke="#585b70" points="1272.25,-251.72 1269.25,-255.72 1248.25,-255.72 1245.25,-251.72 1087.75,-251.72 1087.75,-199.93 1272.25,-199.93 1272.25,-251.72"/>
<text xml:space="preserve" text-anchor="middle" x="1180" y="-229.77" font-family="monospace" font-size="14.00" fill="#cdd6f4">frames/</text>
<text xml:space="preserve" text-anchor="middle" x="1180" y="-212.52" font-family="monospace" font-size="14.00" fill="#cdd6f4">index.json + *.jpg</text>
</g>
<!-- scene&#45;&gt;frames_dir -->
<g id="edge11" class="edge">
<title>scene&#45;&gt;frames_dir</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M266.72,-334.92C272.54,-332.36 276,-330.84 276,-330.84 276,-330.84 686,-312.84 686,-312.84 686,-312.84 1084,-277.59 1084,-277.59 1084,-277.59 1101.72,-268.22 1121.94,-257.53"/>
<polygon fill="#585b70" stroke="#585b70" points="1123.46,-260.68 1130.66,-252.92 1120.19,-254.5 1123.46,-260.68"/>
</g>
<!-- audio&#45;&gt;ipc -->
<g id="edge8" class="edge">
<title>audio&#45;&gt;ipc</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M410,-347.72C410,-329.86 410,-308.72 410,-289.15"/>
<polygon fill="#585b70" stroke="#585b70" points="413.5,-289.36 410,-279.36 406.5,-289.36 413.5,-289.36"/>
<text xml:space="preserve" text-anchor="middle" x="455.38" y="-299.54" font-family="monospace" font-size="14.00" fill="#a6adc8">audio_chunk</text>
</g>
<!-- audio_dir -->
<g id="node11" class="node">
<title>audio_dir</title>
<polygon fill="#2a2a3e" stroke="#585b70" points="1425.5,-251.72 1422.5,-255.72 1401.5,-255.72 1398.5,-251.72 1290.5,-251.72 1290.5,-199.93 1425.5,-199.93 1425.5,-251.72"/>
<text xml:space="preserve" text-anchor="middle" x="1358" y="-229.77" font-family="monospace" font-size="14.00" fill="#cdd6f4">audio/</text>
<text xml:space="preserve" text-anchor="middle" x="1358" y="-212.52" font-family="monospace" font-size="14.00" fill="#cdd6f4">*.wav chunks</text>
</g>
<!-- audio&#45;&gt;audio_dir -->
<g id="edge12" class="edge">
<title>audio&#45;&gt;audio_dir</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M505.96,-347.7C527.44,-338.18 544,-330.84 544,-330.84 544,-330.84 1194,-312.84 1194,-312.84 1194,-312.84 1281,-277.59 1281,-277.59 1281,-277.59 1294.45,-268.72 1310.11,-258.4"/>
<polygon fill="#585b70" stroke="#585b70" points="1311.81,-261.47 1318.24,-253.04 1307.96,-255.62 1311.81,-261.47"/>
</g>
<!-- writer&#45;&gt;ipc -->
<g id="edge9" class="edge">
<title>writer&#45;&gt;ipc</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M605.33,-347.72C573.77,-328.19 535.88,-304.74 501.9,-283.71"/>
<polygon fill="#585b70" stroke="#585b70" points="504.06,-280.93 493.72,-278.64 500.38,-286.88 504.06,-280.93"/>
<text xml:space="preserve" text-anchor="middle" x="612.12" y="-299.54" font-family="monospace" font-size="14.00" fill="#a6adc8">segment_completed</text>
</g>
<!-- stream_dir -->
<g id="node12" class="node">
<title>stream_dir</title>
<polygon fill="#2a2a3e" stroke="#585b70" points="1594.75,-251.72 1591.75,-255.72 1570.75,-255.72 1567.75,-251.72 1443.25,-251.72 1443.25,-199.93 1594.75,-199.93 1594.75,-251.72"/>
<text xml:space="preserve" text-anchor="middle" x="1519" y="-229.77" font-family="monospace" font-size="14.00" fill="#cdd6f4">stream/</text>
<text xml:space="preserve" text-anchor="middle" x="1519" y="-212.52" font-family="monospace" font-size="14.00" fill="#cdd6f4">*.mp4 segments</text>
</g>
<!-- writer&#45;&gt;stream_dir -->
<g id="edge13" class="edge">
<title>writer&#45;&gt;stream_dir</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M767.81,-347.7C788.81,-338.18 805,-330.84 805,-330.84 805,-330.84 1372,-312.84 1372,-312.84 1372,-312.84 1435,-277.59 1435,-277.59 1435,-277.59 1449.95,-268.55 1467.24,-258.11"/>
<polygon fill="#585b70" stroke="#585b70" points="1468.96,-261.16 1475.7,-252.99 1465.34,-255.17 1468.96,-261.16"/>
</g>
<!-- shm -->
<g id="node13" class="node">
<title>shm</title>
<polygon fill="#2a2a3e" stroke="#585b70" points="1847,-251.72 1844,-255.72 1823,-255.72 1820,-251.72 1613,-251.72 1613,-199.93 1847,-199.93 1847,-251.72"/>
<text xml:space="preserve" text-anchor="middle" x="1730" y="-229.77" font-family="monospace" font-size="14.00" fill="#cdd6f4">/dev/shm/cht_scrub_frame</text>
<text xml:space="preserve" text-anchor="middle" x="1730" y="-212.52" font-family="monospace" font-size="14.00" fill="#cdd6f4">raw RGBA pixels</text>
</g>
<!-- framebuf&#45;&gt;shm -->
<g id="edge14" class="edge">
<title>framebuf&#45;&gt;shm</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M1072.84,-373.2C1246.56,-350.41 1533,-312.84 1533,-312.84 1533,-312.84 1604.65,-281.56 1661.53,-256.72"/>
<polygon fill="#585b70" stroke="#585b70" points="1662.81,-259.98 1670.57,-252.77 1660.01,-253.57 1662.81,-259.98"/>
<text xml:space="preserve" text-anchor="middle" x="1624.31" y="-299.54" font-family="monospace" font-size="14.00" fill="#a6adc8">get_frame cmd</text>
</g>
<!-- ipc&#45;&gt;python -->
<g id="edge10" class="edge">
<title>ipc&#45;&gt;python</title>
<path fill="none" stroke="#585b70" stroke-dasharray="5,2" d="M410,-173.67C410,-155.38 410,-134.55 410,-115.39"/>
<polygon fill="#585b70" stroke="#585b70" points="413.5,-115.55 410,-105.55 406.5,-115.55 413.5,-115.55"/>
<text xml:space="preserve" text-anchor="middle" x="463.62" y="-142.76" font-family="monospace" font-size="14.00" fill="#a6adc8">JSON&#45;lines</text>
<text xml:space="preserve" text-anchor="middle" x="463.62" y="-125.51" font-family="monospace" font-size="14.00" fill="#a6adc8">(Unix socket)</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 18 KiB