Merge the development branch: share menu, codec order, segmentation

Brings in the Share button's menu (Share screen / Stream Studio) and the
removal of the separate Stream Studio button from the headers, the
codecs every TeamSpeak client decodes ahead of H.264, the portal fix
and person segmentation.

The phone header keeps this branch's voice-channel button and hides the
bell on the voice screen, and loses the Stream Studio button as the
development branch wants. The studio's test table takes the
segmentation rows and the Android camera row. MediaCodec follows the new
codec order with no code change (Codecs orders every hardware factory's
codecs); its description and docs/media.md now say so, including what
that means on a phone without a hardware VP8, VP9 or AV1 encoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
selikhovandClaude Opus 5.5 committed 2026-10-03 20:02:47 +03:00
commit 698e5f911e
35 files changed
+24436 -224

No files matched your search

+16 -9
View File
@@ -43,7 +43,7 @@ the UI) and a `background` (replacement, below).
|---|---|---|
| `screen` | `monitor`, `backend` (`portal`, `wlroots`, `x11`, `windows`; none: this session's), `cursor` | a capture backend, frames borrowed and copied into pooled frames |
| `window` | `handle` (X11 id, `HWND`), `backend`, `cursor` | the same |
| `portal` | `restore_token`, `cursor` | the ScreenCast portal's dialog (Wayland); the token is written back so it is asked once |
| `portal` | `restore_token`, `cursor` | the ScreenCast portal's dialog (Wayland); with a `restore_token` the portal may restore its last choice without asking. The UI adds portal sources without one, so the dialog asks each time the source starts |
| `camera` | `device` (a `camera::Camera::id`; empty: the first), `size`, `fps`, `mirror` | see [Cameras](#cameras) |
| `image` | `path` | PNG or JPEG, alpha kept, read once |
| `text` | `text`, `font` (none: the bundled Inter), `size_px`, `colour`, `backdrop`, `align`, `padding` | rasterised once with `ab_glyph` |
@@ -134,13 +134,19 @@ blur is a three-pass box blur (close to a Gaussian), separable, with a
running sum so its cost does not grow with the radius, in bands on a worker
pool over pooled buffers.
**What segments today is not a person.** `segment::Ellipse`, the segmenter
that is always there, is a centred oval about where a person sits in front
of a camera. A person segmentation model (MediaPipe selfie segmentation,
Apache-2.0, through `tract-onnx`) is meant to sit behind the `Segmenter`
trait; it is not in this build, because the model could not be fetched where
this was built (see [Status](#status)). Dropping it in changes nothing on the
frame path.
The person is found by `segment::HumanSeg` (feature `segment`, on by
default): PP-HumanSeg, PaddleSeg's portrait segmentation model as OpenCV Zoo
ships it (`crates/voelin-media/models/`, 6 MB, Apache-2.0, bundled into the
binary), run on the CPU by `tract-onnx`. The frame is squeezed to 192x192 RGB;
the mask is the model's probability of a person per pixel, 192x192, which
the frame path stretches back over the frame (its soft edge is the
feathering). The model is parsed and optimised once per process, on the
segmentation thread when the first mask is due; one mask then takes about
50 ms on one core of a desktop CPU (dev builds optimise tract too), so the
10 masks a second cost about half a core. If the model does not load,
`segment::Ellipse`, a centred oval about where a person sits in front of a
camera, stands in (and builds without `segment` use it). Other models drop
in behind the `Segmenter` trait without changing the frame path.
## Outputs (`studio::output`)
@@ -301,7 +307,8 @@ two threads) takes about 3 ms at its own rate (15 fps by default).
| Real camera through the user's PipeWire (Fifine K420, 1280x720) | `camera::tests::a_real_camera_delivers` (`--ignored`) | tested on one webcam |
| Camera through the XDG Camera portal (sandboxes) | – | compiles only |
| Screen, window and portal sources | the existing capture backends ([media.md](media.md#capture)) | as tested there; not run inside the studio here |
| Background blur, image and colour backdrops on the oval mask | `segment::tests` | tested; **no person segmentation model** (see above) |
| Background blur, image and colour backdrops on the oval mask | `segment::tests` | tested |
| Person segmentation (PP-HumanSeg through tract): loads, 192x192 mask, nobody in an empty room, time per mask | `segment::tests::the_model_finds_nobody_in_an_empty_room` | tested (about 50 ms per mask); on a photo of a person the mask follows the silhouette, arms and legs included (checked by eye, the photo is not in the repository); not yet tried with a camera |
| Android cameras (Camera2): planes borrowed, gathered or turned | `camera::tests::camera_planes_are_borrowed_gathered_and_turned` (the Rust side) | tested on the host; the Camera2 side compiles only (no device here) |
| Windows cameras | – | not implemented: `camera::list()` has only the test pattern there |
| RTMP | – | the seam only (refuses with its reason) |