#[non_exhaustive]pub struct VideoOpenOptions {
pub width: Option<u32>,
pub height: Option<u32>,
pub framerate: Option<FrameRate>,
pub cursor: bool,
/* private fields */
}Expand description
How VideoSourceSpec::open opens a source.
Every field is a hint. A device that cannot honor one picks the closest mode it has.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.width: Option<u32>The picture width to ask a device or a generator for.
height: Option<u32>The picture height to ask a device or a generator for.
framerate: Option<FrameRate>The frame rate to ask for.
A device picks its own without it, and a generator runs at 30 fps.
cursor: boolWhether a screen or window capture draws the mouse cursor, true by default.
Implementations§
Source§impl VideoOpenOptions
impl VideoOpenOptions
Sourcepub fn with_framerate(self, rate: FrameRate) -> Self
pub fn with_framerate(self, rate: FrameRate) -> Self
Asks for rate frames per second.
Sourcepub fn with_portal_grants(self, app: impl Into<String>) -> Self
pub fn with_portal_grants(self, app: impl Into<String>) -> Self
Keeps the desktop portal’s grants in app’s config directory.
Sources opened through the portal (screen:portal, window:portal,
or the default display on Wayland) reuse and store their grant as
PortalGrant::in_config_dir does, so a later run can skip the picker.
Has no effect without a portal, or when app is not a single file
name.
Sourcepub fn keep_portal_grants_after_end(self) -> Self
pub fn keep_portal_grants_after_end(self) -> Self
Keeps the grants with_portal_grants
stores when the stream ends, as PortalGrant::keep_after_end does.
Sourcepub fn with_file(self, file: MediaFile) -> Self
pub fn with_file(self, file: MediaFile) -> Self
Plays file for a file: source of its path, instead of opening the path again.
Applies to audio sources too: LocalBroadcast::set_spec opens a
file: audio source through these options. Clones of a
MediaFile share its clock, so a video that opens
again, or an audio source of the same file, plays in sync with the
streams the file already feeds.
Trait Implementations§
Source§impl Clone for VideoOpenOptions
impl Clone for VideoOpenOptions
Source§impl Debug for VideoOpenOptions
impl Debug for VideoOpenOptions
Source§impl Default for VideoOpenOptions
impl Default for VideoOpenOptions
impl Eq for VideoOpenOptions
Source§impl PartialEq for VideoOpenOptions
impl PartialEq for VideoOpenOptions
impl StructuralPartialEq for VideoOpenOptions
Auto Trait Implementations§
impl Freeze for VideoOpenOptions
impl RefUnwindSafe for VideoOpenOptions
impl Send for VideoOpenOptions
impl Sync for VideoOpenOptions
impl Unpin for VideoOpenOptions
impl UnsafeUnpin for VideoOpenOptions
impl UnwindSafe for VideoOpenOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.