#[repr(C)]pub struct FrameConsumer {
pub id: u32,
pub width: u32,
pub height: u32,
}Expand description
One CONSUMER of a capture source’s frames: a requested output size.
A camera or a screen share has many consumers of the same captured
frame at once — the on-screen preview tile (sized by layout), a remote
participant who asked for 500x200, a recorder at full size. The device
captures ONCE, at the smallest size that covers every consumer
(azul_layout::image_scale::covering_size), and every consumer gets its
own resample of that one frame (azul_layout::image_scale::fan_out): the
camera never captures more than the largest consumer needs, and nothing
is ever sent bigger than the consumer asked for. Registered on a capture
widget with CameraWidget::with_consumer /
ScreenCaptureWidget::with_consumer; each cut frame is handed to the
widget’s on_consumer_frame hook as a ConsumerFrame.
id is caller-chosen and handed back with every cut frame so one hook can
serve many consumers (“client Bob” = 7, “the recorder” = 8). Id 0
(FrameConsumer::PREVIEW_ID) is reserved for the widget’s own on-screen
tile, whose size follows layout.
Fields§
§id: u32Caller-chosen id, handed back with every cut frame. 0 is the preview.
width: u32Requested output width in px (0 = invalid, the consumer is skipped).
height: u32Requested output height in px (0 = invalid, the consumer is skipped).
Implementations§
Trait Implementations§
Source§impl Clone for FrameConsumer
impl Clone for FrameConsumer
Source§fn clone(&self) -> FrameConsumer
fn clone(&self) -> FrameConsumer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more