Struct VideoOpenOptions
#[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§
§impl VideoOpenOptions
impl VideoOpenOptions
pub fn with_size(self, size: Size) -> VideoOpenOptions
pub fn with_size(self, size: Size) -> VideoOpenOptions
Asks for pictures of size.
pub fn with_framerate(self, rate: FrameRate) -> VideoOpenOptions
pub fn with_framerate(self, rate: FrameRate) -> VideoOpenOptions
Asks for rate frames per second.
pub fn with_portal_grants(self, app: impl Into<String>) -> VideoOpenOptions
pub fn with_portal_grants(self, app: impl Into<String>) -> VideoOpenOptions
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.
pub fn keep_portal_grants_after_end(self) -> VideoOpenOptions
pub fn keep_portal_grants_after_end(self) -> VideoOpenOptions
Keeps the grants with_portal_grants
stores when the stream ends, as PortalGrant::keep_after_end does.
pub fn with_file(self, file: MediaFile) -> VideoOpenOptions
pub fn with_file(self, file: MediaFile) -> VideoOpenOptions
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§
§impl Clone for VideoOpenOptions
impl Clone for VideoOpenOptions
§fn clone(&self) -> VideoOpenOptions
fn clone(&self) -> VideoOpenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for VideoOpenOptions
impl Debug for VideoOpenOptions
§impl Default for VideoOpenOptions
impl Default for VideoOpenOptions
§fn default() -> VideoOpenOptions
fn default() -> VideoOpenOptions
impl Eq for VideoOpenOptions
§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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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.