Expand description
Shared core for the video-ish widgets (camera/screencap/video): the
VideoFrame type + the GL-texture present_frame writeback. See
capture_common.rs.
Shared core for the “video-ish” widgets (camera / screencap / video).
All three are identical in architecture (RefAny dataset + AfterMount
background capture/decode thread + writeback that uploads each frame into a
stable external GL texture + recomposites). Only the config and the
worker differ. This module holds the duplicated pieces - the [VideoFrame]
the worker produces and [present_frame], the GL writeback core - so each
widget is a thin config+worker wrapper and there’s a single place for GL
fixes + the real platform workers (AVFoundation / ScreenCaptureKit /
vk-video) to plug in.
NOTE: GL code - compile-verified here; the actual texture rendering must be verified on a machine with a window + GPU.
Structs§
- Audio
CaptureV Table - A platform audio-capture backend (microphone), registered by the dll so
MicrophoneWidgetcan pull real samples instead of the test tone. LikeCaptureVTablebut yields interleavedf32audio rather than RGBA video. - CaptureV
Table - A platform frame-capture backend (camera / screen), registered by the dll at
startup so the cross-platform capture widgets can pull real frames
instead of their built-in test pattern. The dll provides one per OS (v4l2 on
Linux, AVFoundation on macOS, Media Foundation on Windows, ScreenCaptureKit /
PipeWire / DXGI for screens, …). These are plain Rust fn pointers - the dll
links azul-layout statically, so registering + calling is a Rust-to-Rust
call, no
extern "C"/trait-object dance. - OnVideo
Frame - OnVideo
Frame Callback
Enums§
Statics§
- ON_
VIDEO_ FRAME_ INVOKER - Process-global slot for this callback kind’s host-side invoker.
Functions§
- AzApp_
setOn Video Frame Callback Invoker - Register the host-side invoker for this callback kind.
- AzOn
Video Frame Callback_ create From Host Handle - C-ABI export wrapping
<Wrapper>::create_from_host_handle. - camera_
backend - The registered camera backend, if the dll provided one for this platform.
- invoke_
on_ frame - Invoke a capture widget’s optional
on_framehook withframe, returning the user’sUpdate(DoNothingwhen no hook is set). Shared by all three capture widgets’ writebacks. - mic_
backend - The registered mic-capture backend, if the dll provided one for this platform.
- present_
frame - Present
framefor a video-ish widget and return the (stable) GL texture id to store back in the widget’s state. - register_
camera_ backend - Register the platform camera capture backend (called once by the dll at
startup; the first registration wins). Without it,
CameraWidgetshows its test pattern. - register_
mic_ backend - Register the platform microphone-capture backend (called once by the dll).
- register_
screen_ backend - Register the platform screen capture backend (for
ScreenCaptureWidget). - screen_
backend - The registered screen-capture backend, if any.
- upload_
rgba - Upload tightly-packed RGBA8 pixels into the GL texture
texture_id.
Type Aliases§
- AzOn
Video Frame Callback Invoker - Pointer-arg variant of this callback kind’s typedef.
- OnVideo
Frame Callback Type - User hook fired once per captured/decoded frame - the backreference
dependency-injection pattern (see
architecture.md). A capture widget’s private writeback invokes it with eachVideoFrame, so application code can apply effects, save the frame into its own data model, or send it over the network (azul-meet). ReturnsUpdatelike any callback. Wired viaCameraWidget::with_on_frame/ScreenCaptureWidget::with_on_frame/VideoWidget::with_on_frame.