Skip to main content

Module recording

Module recording 

Source
Expand description

RecordingScene — composes the recorder’s two visible streams (full-screen capture + circular webcam bubble) into a single Stage ready to render to a wgpu::TextureView (M-EXPORT.0 of M-RECORD-EXPORT).

Reusable composition primitive: the recorder feeds it new BGRA frames from the per-channel capture pipelines; the future editor preview lane will instantiate the same scene from decoded recording frames. Keeping composition inside wisp (rather than in screen-app) keeps the recorder + editor visually consistent and lets the storybook drive snapshot tests without booting Tauri.

§Layout

  • Screen frame is the fullscreen background — a Sprite anchored centre, scaled to fill NDC [-1, 1]².
  • Camera frame is a smaller Sprite inside a Container whose clip is a MaskShape::Ellipse with half-extents aspect-compensated for the output canvas, so the bubble is a true circle in pixels (an NDC Circle would stretch into an ellipse on a non-square frame). Default position is the bottom-left corner with a small margin; the CamLayout struct exposes this so the future editor can re-anchor.
`set_screen_frame` / `set_camera_frame` overwrite the GPU
texture in place — no queueing. The encoder reads at its own
frame rate (30 fps in M-EXPORT.1's default) regardless of source
FPS; uploads from faster sources just write the most recent
frame, slower sources show the last upload until a new one
lands.

Structs§

CamLayout
Position + size of the circular webcam bubble within the composed frame. All coordinates are NDC — (-1, -1) bottom-left, (1, 1) top-right.
CursorRipple
One click ripple to draw under the cursor (ED.19): an expanding, fading ring centered at a click, in output NDC. The app derives these from the click log (edit::telemetry::ripples_at) — center is already mapped through the screen transform, radius grows with age, alpha fades 1 → 0.
RecordingScene
Two-stream composition: fullscreen screen-capture + circular webcam bubble. Owns the Stage + the per-stream VideoTextures.
StreamDimensions
Dimensions for one of the composed input streams. Used at RecordingScene::new time to allocate the backing VideoTextures; subsequent set_*_frame calls must pass a BGRA buffer matching width * height * 4.

Functions§

draw_pointer 🔒
Append the arrow-cursor silhouette to g: a classic pointer filled with color, sized by NDC half-extent half, anchored at its hot-spot tip.
flip_bgra_rows_top_down_to_bottom_up 🔒
Copy a packed BGRA buffer (width * height * 4 bytes, no row padding) into a freshly-allocated Vec<u8> with rows reversed so the output is bottom-up.