Repository navigation
Ariadne: video: and audio: widgets; cvcMedia's FFmpeg + SDL3 player (media M5, stacked on #933 + #934) - #935
Merged
Merged
Conversation
added 9 commits
October 30, 2026 22:24
An image: whose src (or bound value, or computed expression) is a URI now
loads that picture: http(s) through the host's network policy, with
auth: NAME sending the host's credential on the http verbs' terms; file://
relative to the document. The media cache (media.h) fetches, decodes,
downscales and fits off the frame on the app's background pool (a step per
drain in a browser build without threads), shares one fetch between boxes,
evicts idle pictures and retries failures. Widgets draw a placeholder of
their box until the picture arrives and a darker one on failure, with the
reason in the tooltip and at an optional status: key.
- cvc::decode_image: PNG/JPEG/GIF/BMP via stb, WebP via libwebp (now linked
directly, optional), TIFF/AVIF/HEIC via ImageMagick with the coder named
from the magic bytes; size caps checked before decoding.
- fit: contain|cover|fill and shape: circle, made by the core so every
backend draws the raster unchanged; size: [w, h] is a box.
- FTXUI half-blocks honour alpha (a transparent half keeps the terminal's
background); Backend::drop_image frees an evicted picture (ImGui deletes
its texture).
- host_get + net_host_access: a host-side GET on the verbs' terms.
- ari/arigl snapshot (and ari test) wait for the pictures a frame drew.
- Tests: ariadne_media_test (decode, fit, cache, widget over a local server
with a credential and a token scan), ari_media_test (the ari binary),
ari_run_media_images_{ftxui,tvision} (tmux), cvcgl_imgui_media.
A window, overlay or group may take background: {src|bind, auth, fit,
opacity, terminal, banner_rows, status} (or a bare URL): a picture by URI
through the media cache, or a published image name, drawn behind the
content. The core brackets the content with the new Backend::begin_backdrop
/ end_backdrop; each backend fits the picture to the area the content takes.
- ImGui: the content goes on a draw-list channel above the picture, which is
drawn (cover/contain/fill UVs, opacity as tint alpha) once the area is
known: a window's inner rect, a group's rect, full width unless size: says
otherwise and at least size:'s height.
- FTXUI and tvision: terminal: behind draws dimmed half-blocks under the
content and turns each cell the content wrote text into readable (the
picture's colour as background, dimmed to <= 40%, the terminal's own
foreground); terminal: banner draws the picture as a row above the
content, in Kitty/Sixel/iTerm pixels once its width is known; none draws
nothing. No background in mono.
- Tests: loader, core bracketing (ariadne_media_test), FTXUI behind/banner
layout, ImGui split/merge and the authored height (cvcgl_imgui_media), and
the tmux test now checks a window background on both terminal backends.
card.ari in the component library: a bordered card (a one-column grid with
an outer border) with an avatar / title / subtitle / timestamp header, a
body text, a media slot and an action row. Its args are state keys, so a
repeat: includes one per item of a feed; a part whose key is empty is not
drawn. Generic: a post, a message, a search hit.
Args only take strings, so units gain slots: a '- slot: NAME' item in a
unit's widget list is replaced by the include site's slots: {NAME: [...]}
widgets (a single widget map works too; an unfilled slot is dropped; the
unit's args are not substituted into the include site's own widgets).
Tests: AriadneModularity.SlotsTakeTheIncludeSitesWidgets; the shipped
components test checks card.ari (an embeddable unit, not a window);
AriMedia card snapshot over a local server (avatar, a 404 attachment's
failed box, the action row); ari_run_media_card_{ftxui,tvision} in tmux;
the card's avatar in ImGui (cvcgl_imgui_media).
…media M4) cvcMedia (src/cvcMedia) is libcvc's GL-free media library, its own package like cvcGL (find_package(cvcMedia), cvc::cvcMedia), so the cvc package's single-target contract and the lean libcvc are untouched. It holds the SDL3 audio output and the auto-pumped stream player that were cvcGL's, now cvc::media::playback (cvc/media/playback/*.h); SDL3 is optional and only its audio subsystem is used. cvcGL links it and keeps the cvc::gl::playback names as aliases, so the conference app and media verbs are unchanged; a standalone cvcGL build (the cvcgl recipe) builds and installs it beside itself, and the recipe ships it. ari-media is the same ari with cvcMedia linked: sound with no window, display, GL, VTK or ImGui (ari-media info lists the playback devices). It is built with cvcGL or -DCVC_BUILD_ARI_MEDIA=ON in-tree, and by the new ari-media recipe from src/ari with -DARI_WITH_MEDIA=ON, which links cvcMedia statically, so the package is bin/ari-media alone (deps: libcvc, sdl3). The lean ari links libcvc only, as before. Test: cvcmedia_audio_output plays through SDL's dummy driver with the video subsystem never initialized and no GL/VTK/ImGui/cvcGL loaded.
…media M5)
video: / audio: take src (a URI or a computed expression), auth, poster,
size/fit, bind (the player's state keys), autoplay, loop and muted. The core
(media_player.h) owns the widget: a picture box (the newest frame, else the
poster, else a placeholder; at most 8 frames/s in a terminal), controls
drawn with every backend's widgets (Play/Pause, a seek slider whose value is
'm:ss / m:ss', Mute, Open), and state keys: state, playing (writable),
position, duration, seek (writable, consumed), muted (writable), error.
A host registers the player behind media::Player. cvcMedia's FFmpeg player
(cvc/media/player.h) fetches the source whole through fetch_bytes (policy,
auth:, file/cvc/state), decodes on its own thread (libavformat/libavcodec),
scales frames to the box (libswscale), resamples to 48 kHz stereo f32
(libswresample) and plays through SDL3 audio, which is the clock (the wall
clock without sound); SDL's device is opened and closed on the frame thread.
FFmpeg is optional and linked shared (ffmpeg-lgpl). ari-media and arigl
register it; the lean ari has none, so its players say unsupported.
Over SSH (SSH_CONNECTION/SSH_CLIENT/SSH_TTY) players say remote and open
nothing; Open runs (open-url URL) where the host has it. --media-play
auto|always|never sets it. Capability tokens media and media.player; ari
info shows the player. A player whose widget a walk did not draw pauses at
once and closes after 5 s; snapshots wait while a player loads.
Tests: MediaPlayer.* (the controller with a fake player: unsupported,
remote, controls, state keys, autoplay, failure, hidden pauses);
cvcmedia_player (FFmpeg on a 2 s VP8/Opus clip and an Opus tone: ready with
a first frame, play, seek, pause, end, replay, failures); AriMedia.* with
ari-media (frames' colours, SSH default, --media-play);
ari_run_media_player_{ftxui,tvision} (tmux); the ImGui frames
(cvcgl_imgui_media).
X11 headers define None, so x11_macro_headers_test failed to compile widget.h. The YAML value stays terminal: none.
transfix
added a commit
to cy-pca/nicotina
that referenced
this pull request
Oct 31, 2026
…layer A card's first video or recording, and each one in a post opened whole, is a video: or audio: (transfix/libcvc#935) with its controls (Play/Pause, seek, Mute), where the host has a player (media.player: ari-media and arigl). Elsewhere, and on a host without the widgets (which warns and draws nothing), they stay rows. The card's picture and video are 192 px wide (24 x 7 cells). The launcher runs ari-media, ari with sound and video, in a terminal where it is installed (bin/nicotina and nicotina.cmd); NICOTINA_ARI still wins. run.sh, on a host with a player: the players are there, the recordings were fetched without the session token, and in tmux Play runs the video to its end; the Tab counts take the players' stops into account. The launcher's dry run picks ari-media from PATH.
added 12 commits
October 31, 2026 00:01
…k tests without FFmpeg A cross build's pkg-config could find the host's FFmpeg for cvcGL's wasm build; the pages use the browser's own media elements instead. On a runner whose cvcMedia has no FFmpeg, ari-media's players say unsupported, so the tmux playback test is not registered and the SSH test skips.
…a reply names image.url holds in every host that loads a picture by URI, so a document for older hosts gates its pictures on (has? "image.url") and keeps its own placeholder elsewhere (an older host prints an unknown URI as text). A picture whose URL a reply puts in state was drawn as its loading placeholder by ari snapshot / arigl --terminal snapshot: no frame had asked for it while the request was out, so the settle loop never waited for it. AppRuntime::settle_and_render settles, draws, and while that frame drew a picture still loading, settles and draws again (within the same 10 s). Test: AriMedia.SnapshotWaitsForAPictureWhoseUrlComesFromAReply.
… the image.background token A text: with color: wraps its row in a colour decorator, which recoloured the backdrop's half-blocks after the text (solid bars in the text's colour). BackdropText now gives a cell that is still the backdrop's own (its character and background) the picture's foreground back. Test: MediaBackground.ColouredTextDoesNotPaintTheBackdropBesideIt. image.background holds where background: draws.
import: entries may be {uri: URI, optional: true}: a library the host may
not have, whose absence is no warning (so ari test passes on older hosts).
A document's own unit with fallback: true stands in only where no import
defines the name, so a document adopts cvc://components/card.ari and keeps
its own card for hosts without it. card.ari gains slots note (above the
header), extra (under the byline) and body (after the body text).
Test: AriadneModularity.OptionalImportsAndFallbackUnits.
transfix
added a commit
to cy-pca/nicotina
that referenced
this pull request
Oct 31, 2026
…13) The home feed is the first screen after signing in, as the web app's home is: Show Following (GET /social/timeline/home) or Everyone (/public), ten posts a page with mode=latest, and Load more by before_id. Each post is a bordered card: the author's avatar, name, full handle and time; the text, wrapped, three lines at most; the first picture inline; attachment rows; the counts; Open, which shows the whole post with its reactions (GET /social/posts/{id}). Pictures show where the host has image.url (transfix/libcvc#931); video and audio play with their controls where it has a player (media.player: ari-media and arigl, transfix/libcvc#935), and are rows elsewhere. The launcher prefers ari-media in a terminal; --start profile opens the profile first. Terminal first: 76 columns by 86% of the screen, scrolling by focus. Tests: a stub feed with pictures, a video, a recording, a PDF, a repost, a paid post and two pages; Open, Load more, Everyone and the 80x24 fit in tmux in both backends; players and pictures where the host has them.
added 3 commits
October 31, 2026 00:14
…rge had interleaved them)
… and audio: The cvcgl package builds cvcMedia beside cvcGL; with ffmpeg-lgpl (shared) in its prefix, cvcMedia has its FFmpeg player. Scoped to linux, macos and windows; the wasm pages use the browser's media elements.
added 2 commits
October 31, 2026 00:51
…image-url # Conflicts: # src/cvc/ariadne/loader.cpp
… clang-format encode() removed its temporary file while the ifstream reading it was still open. Windows refuses to delete an open file, so every MediaDecode/MediaCache/MediaWidget case that encodes a picture threw from std::filesystem::remove there (8 cases in recipe/windows, the same in the three package-windows builds). The stream now closes first. Also the changed lines clang-format 18 reformats: ari_media_test.cpp, the two hosts' snapshot settle calls and two include blocks the master merge touched.
The three MediaBackground cases shared temp/ariadne_media_test_backdrop, and each removed it when done. ctest runs the cases as separate processes at the same time, so one case removed (or rewrote) bg.png while another was still loading it; that picture never reached ready and the case timed out at 5 s. Seen on recipe/ubuntu Debug and Release and on macOS Debug once the stack above added cases and changed which ones run together. The directory now carries the running test's name.
… release bumped them before this one landed)
…dne-media-background
#931's changes are already here from its branch, so this keeps this tree and makes the squash an ancestor, so the branch merges into master.
…t/ariadne-media-card
#932's changes are already here from its branch, so this keeps this tree and makes the squash an ancestor, so the branch merges into master.
…-media-video Their changes are already here from their branches, so this keeps this tree and makes the squashes ancestors, so the branch merges into master.
transfix
added a commit
that referenced
this pull request
Nov 2, 2026
#935's changes are already here from its branch, so this keeps this tree and makes the squash an ancestor, so the branch merges into master.
transfix
added a commit
that referenced
this pull request
Nov 2, 2026
…media M6, stacked on #935) (#936) Media M6: in wasm builds (ari.html, arigl-web) `video:` and `audio:` play through the page's own <video>/<audio> elements (media_browser.cpp, register_browser_player()), so FFmpeg is never compiled to wasm. Play from a click or Enter plays sound without hitting the browser's autoplay block.
transfix
added a commit
that referenced
this pull request
Nov 2, 2026
#935 took docs/ARIADNE.md §5.13 for video and audio; the phone section is now §5.14.
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.
Media M5 from the design (#929). Stacked: this branch merges #933 (which carries #932 and #931) and #934. Review only 24d392a (and the merge commits). It targets master so the full CI runs.
Reference: docs/ARIADNE.md §5.13.
Core (
media_player.h, no deps). The Runtime owns each player widget:m:ss / m:ss(a no-conversion format, which prints as-is in ImGui and FTXUI), Mute, and Open.state(idle|loading|ready|playing|paused|ended|failed|remote|unsupported),playing(writable),position(at most 4 Hz while playing),duration,seek(writable, consumed),muted(writable) anderror.media::Playerfactory. Without one, the widget isunsupportedand offers Open.remoteand nothing is opened. Open runs(open-url URL)where the host has it (Ariadne: sign in with any OpenID Connect provider (oidc-sign-in, open-url; nicotina L7, L9) #916), and the tooltip says anauth:source needs the browser's own sign-in.--media-play auto|always|neveris a new general flag.mediaandmedia.player.ari infoshows the player.cvcMedia's player (
cvc/media/player.h, FFmpeg optional, linked shared: cvcpkg'sffmpeg-lgpl):fetch_bytes, so the policy andauth:hold for http(s) and file/cvc/state work. The cap is 64 MiB, read through an AVIOContext.playstarts over.CVC_MEDIA_FFMPEG_LOG=1turns it back on), because it would corrupt a terminal backend's screen.ari-mediaandariglcallregister_ariadne_player(). The ari-media recipe now depends onffmpeg-lgpl.Tests
MediaPlayer.*(6): the controller with a fake player. It covers the policy and time format, the loader,unsupportedwith Open,remote(nothing opened, the sign-in tooltip), the controls and state keys driving the player (Play button, writes to playing/seek/muted, the seek slider, the Mute checkbox), autoplay, failure, and a hidden widget pausing.cvcmedia_player: FFmpeg on a committed 2 s VP8/Opus WebM (14 KB) and a 1.5 s Opus tone (3 KB). It checksreadywith the first frame scaled into the box, play with new frames and a moving clock, seek, pause (clock stopped), end, replay, sound-only, and failures (a missing file, a PNG as audio).AriMedia.*+3: the lean ari saysunsupported; ari-media shows testsrc's colour bars from decoded frames; over SSH it isremote, and--media-play always|neverand a bad value exit 2.ari_run_media_player_{ftxui,tvision}: ari-media plays underari runin tmux on SDL's dummy driver.cvcgl_imgui_media: ImGui gets 5+ distinct frames and a Pause button while the clip autoplays.Verified locally (GCC 13, Release; system FFmpeg 6.1 headers and libs, cvcpkg SDL3): ctest
Ariadne|Ari|ari_|Media|cvcgl_imgui|cvcgl_ari|cvcgl_*(audio|media|mic)|cvcmedia|x11|Net|Uri|AsyncCallspassed 796/796 (one skip as on master).ffmpeg_player.cppcompiles without FFmpeg. clang-format 18 is clean.Not done here / follow-ups
cvcmedia_playerand the ari-media playback tests skip there, while the controller tests always run.alsa-libbakes its build path in foralsa.conf, so SDL's ALSA backend prints errors at device open. That's a packaging bug in cvcpkg.Since opening:
ffmpeg-lgpl(Joe approved), so a packaged arigl plays video.