pub struct DeviceVideoTrackConstraints {
pub required: bool,
pub device_id: Option<ConstrainString<String>>,
pub facing_mode: Option<ConstrainString<FacingMode>>,
pub height: Option<ConstrainU32>,
pub width: Option<ConstrainU32>,
}Expand description
Constraints applicable to video tracks that are sourced from some media device.
Fields§
§required: boolImportance of this DeviceVideoTrackConstraints.
If true then without this DeviceVideoTrackConstraints call
session can’t be started.
device_id: Option<ConstrainString<String>>Identifier of the device generating the content for the media track.
facing_mode: Option<ConstrainString<FacingMode>>Describes the directions that the camera can face, as seen from the user’s perspective.
height: Option<ConstrainU32>Height of the video in pixels.
width: Option<ConstrainU32>Width of the video in pixels.
Implementations§
Source§impl DeviceVideoTrackConstraints
Constraints applicable to video tracks that are sourced from screen-capture.
impl DeviceVideoTrackConstraints
Constraints applicable to video tracks that are sourced from screen-capture.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates new DeviceVideoTrackConstraints with none constraints
configured.
Sourcepub const fn exact_facing_mode(&mut self, facing_mode: FacingMode)
pub const fn exact_facing_mode(&mut self, facing_mode: FacingMode)
Sets exact facingMode constraint.
Sourcepub const fn ideal_facing_mode(&mut self, facing_mode: FacingMode)
pub const fn ideal_facing_mode(&mut self, facing_mode: FacingMode)
Sets ideal facingMode constraint.
Sourcepub const fn exact_height(&mut self, height: u32)
pub const fn exact_height(&mut self, height: u32)
Sets exact height constraint.
Sourcepub const fn ideal_height(&mut self, height: u32)
pub const fn ideal_height(&mut self, height: u32)
Sets ideal height constraint.
Sourcepub const fn height_in_range(&mut self, min: u32, max: u32)
pub const fn height_in_range(&mut self, min: u32, max: u32)
Sets range of height constraint.
Sourcepub const fn exact_width(&mut self, width: u32)
pub const fn exact_width(&mut self, width: u32)
Sets exact width constraint.
Sourcepub const fn ideal_width(&mut self, width: u32)
pub const fn ideal_width(&mut self, width: u32)
Sets ideal width constraint.
Sourcepub const fn width_in_range(&mut self, min: u32, max: u32)
pub const fn width_in_range(&mut self, min: u32, max: u32)
Sets range of width constraint.
Sourcepub async fn satisfies<T: AsRef<MediaStreamTrack>>(&self, track: T) -> bool
pub async fn satisfies<T: AsRef<MediaStreamTrack>>(&self, track: T) -> bool
Checks whether the provided platform::MediaStreamTrack satisfies
contained DeviceVideoTrackConstraints.
Sourcepub fn merge(&mut self, another: Self)
pub fn merge(&mut self, another: Self)
Merges these DeviceVideoTrackConstraints with another ones,
meaning that if some constraints are not set on these ones, then they
will be applied from another.
Sourcepub const fn required(&self) -> bool
pub const fn required(&self) -> bool
Returns an importance of these DeviceVideoTrackConstraints.
If these DeviceVideoTrackConstraints are important then without them
a session call can’t be started.
Trait Implementations§
Source§impl Clone for DeviceVideoTrackConstraints
impl Clone for DeviceVideoTrackConstraints
Source§fn clone(&self) -> DeviceVideoTrackConstraints
fn clone(&self) -> DeviceVideoTrackConstraints
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more