Skip to content

examples: ariadne_stream — the Phase-3 streaming holy-grail demo (stream as scene quad + stream_view window) - #540

Merged
transfix merged 4 commits into
masterfrom
feat/holy-grail-demo
Oct 2, 2026
Merged

transfix merged 4 commits into
masterfrom
feat/holy-grail-demo

Conversation

@transfix

@transfix transfix commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Holy-grail step (d): one live video stream shown two ways from a single .ari — as the main scene (a type: stream node, a quad textured with the live frames) AND in a draggable/resizable ImGui window (a type: stream_view widget the same stream is routed to). The capstone of the Phase-3 streaming arc (#516–536).

Independent of unmerged work — everything it uses is on master (#532 camera, #536 stream_view, #533/#535 audio family + output, the substrate). The audio half (mic on/off/record/playback via the device source + audio_output) is a planned follow-up.

What it does

  • ariadne_stream.cpp (host): opens one stream at the app root, registers the two sinks (register_stream_node_type + register_stream_view_widget), loads stream.ari, realizes the scene, renders — a navigable window or a one-frame offscreen PNG. Source is a hardware-free synthetic test pattern by default; --camera feeds a real SDL3 camera when present.
  • stream.ari: declares the scene quad + a "Camera" window holding the stream_view widget, both bound to token streams.cam0.
  • Sizes the stream pool for both sinks (expected_subscribers=3) — the pool is fixed-size and refuses rather than under-provisions, so a second sink on one token gets no frames unless budgeted. (Found this while verifying.)

Verification (headless EGL): ariadne_stream stream.ari --offscreen --png renders the live synthetic stream textured onto the scene quad — see the attached capture; the colorful gradient is the moving test pattern mapped through substrate → type: stream node → GPU texture. The stream_view window renders in an interactive session: cvcGL's offscreen path does not composite the ImGui overlay (ariadne_hello hides it in captures for the same reason), so the headless still shows the scene quad only. The widget's pull logic is covered hardware-free by cvcgl_stream_view, and its draw reuses the proven Kind::Image path.

Note: a backend-registered custom widget (stream_view) draws a cosmetic load-time "no registered handler" warning (the loader is backend-neutral); the widget works.

One live video stream shown TWO ways from a single .ari document: as the MAIN
SCENE (a `type: stream` node — a quad textured with the live frames, filling the
viewport) AND in a draggable/resizable ImGui window (a `type: stream_view` widget
the SAME stream is routed to; it also shows a static image when no stream is live).

The source is hardware-free by default (synthetic moving test pattern), so the demo
runs and verifies headless; --camera feeds it from a real SDL3 camera
(cvc::gl::capture) when present. The host (ariadne_stream.cpp) opens one stream at
the app root, registers the two sinks (register_stream_node_type +
register_stream_view_widget), loads stream.ari, realizes the scene, and renders — a
navigable window or a one-frame offscreen PNG. Everything else is the stock cvcGL
Ariadne runner (cf. ariadne_hello).

The stream pool is sized for BOTH sinks (expected_subscribers=3): the pool is
fixed-size and refuses rather than under-provisions, so a second sink on the same
token gets no frames unless budgeted.

Verified: `ariadne_stream stream.ari --offscreen --png` renders the live synthetic
stream textured onto the scene quad (headless EGL). The stream_view window renders
in an INTERACTIVE session; cvcGL's offscreen path does not composite the ImGui
overlay (ariadne_hello hides it in captures for the same reason), and the widget's
pull logic is covered hardware-free by cvcgl_stream_view with its draw reusing the
Kind::Image path.
@transfix
transfix enabled auto-merge October 2, 2026 14:48
@transfix
transfix merged commit d9e9641 into master Oct 2, 2026
13 checks passed
transfix added a commit that referenced this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant