pub struct SwVideoLayerHandle { /* private fields */ }Expand description
Thread-safe runtime placement control for one compositor input. Retaining it does not keep the input or compositor alive.
Implementations§
Source§impl SwVideoLayerHandle
impl SwVideoLayerHandle
Sourcepub fn id(&self) -> VideoInputId
pub fn id(&self) -> VideoInputId
Returns the stable identity of this particular input registration.
Sourcepub fn name(&self) -> Arc<str> ⓘ
pub fn name(&self) -> Arc<str> ⓘ
Returns the registration name, which may be reused by a newer input.
Sourcepub fn layer(&self) -> Option<VideoLayer>
pub fn layer(&self) -> Option<VideoLayer>
Returns the current layer settings, or None after this registration is removed.
Sourcepub fn set_layer(&self, layer: VideoLayer) -> Result<(), SwVideoCompositorError>
pub fn set_layer(&self, layer: VideoLayer) -> Result<(), SwVideoCompositorError>
Atomically replaces every layer setting.
Returns SwVideoCompositorError::SourceRemoved if this handle is stale.
Sourcepub fn set_rect(&self, rect: VideoRect) -> Result<(), SwVideoCompositorError>
pub fn set_rect(&self, rect: VideoRect) -> Result<(), SwVideoCompositorError>
Replaces the destination rectangle while retaining the other layer settings.
Sourcepub fn set_opacity(&self, opacity: f32) -> Result<(), SwVideoCompositorError>
pub fn set_opacity(&self, opacity: f32) -> Result<(), SwVideoCompositorError>
Replaces the layer opacity after validating the 0.0..=1.0 range.
Sourcepub fn set_z_index(&self, z_index: i32) -> Result<(), SwVideoCompositorError>
pub fn set_z_index(&self, z_index: i32) -> Result<(), SwVideoCompositorError>
Changes the stacking order; larger values are drawn later.
Sourcepub fn set_visible(&self, visible: bool) -> Result<(), SwVideoCompositorError>
pub fn set_visible(&self, visible: bool) -> Result<(), SwVideoCompositorError>
Shows or hides the input without removing its registration.
Sourcepub fn set_fit(&self, fit: VideoFit) -> Result<(), SwVideoCompositorError>
pub fn set_fit(&self, fit: VideoFit) -> Result<(), SwVideoCompositorError>
Changes how the input aspect ratio maps into its rectangle.
Sourcepub fn set_source(
&self,
source: Option<VideoSourceRect>,
) -> Result<(), SwVideoCompositorError>
pub fn set_source( &self, source: Option<VideoSourceRect>, ) -> Result<(), SwVideoCompositorError>
Draws only part of the input, or all of it again with None.
Not checked against the frame, which may not have arrived yet and may
change size later — see VideoSourceRect. Only an empty region is
refused here.
Trait Implementations§
Source§impl Clone for SwVideoLayerHandle
impl Clone for SwVideoLayerHandle
Source§fn clone(&self) -> SwVideoLayerHandle
fn clone(&self) -> SwVideoLayerHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more