MediaStreamSettings

Struct MediaStreamSettings 

Source
pub struct MediaStreamSettings { /* private fields */ }
Expand description

Implementations§

Source§

impl MediaStreamSettings

Source

pub fn new() -> Self

Creates new MediaStreamSettings with none constraints configured.

Source

pub fn audio(&mut self, constraints: AudioTrackConstraints)

Specifies the nature and settings of the audio platform::MediaStreamTrack.

Source

pub fn device_video(&mut self, constraints: DeviceVideoTrackConstraints)

Set constraints that will be used to obtain local video sourced from media device.

Source

pub fn display_video(&mut self, constraints: DisplayVideoTrackConstraints)

Set constraints that will be used to capture local video from user display.

Source

pub async fn unconstrain_if_satisfies_video<T>(&mut self, track: T) -> bool

Indicates whether the provided platform::MediaStreamTrack satisfies some of the VideoTrackConstraints from this MediaStreamSettings.

Unconstrains VideoTrackConstraints which this platform::MediaStreamTrack satisfies.

Source

pub fn calculate_kinds_diff(&self, another: &Self) -> LocalStreamUpdateCriteria

Returns LocalStreamUpdateCriteria with MediaKind and MediaSourceKind which are different in the provided MediaStreamSettings.

Source

pub const fn get_audio(&self) -> &AudioTrackConstraints

Returns only audio constraints.

Source

pub const fn get_display_video(&self) -> Option<&DisplayVideoTrackConstraints>

Returns reference to DisplayVideoTrackConstraints from this MediaStreamSettings.

Returns None if DisplayVideoTrackConstraints is unconstrained.

Source

pub const fn get_device_video(&self) -> Option<&DeviceVideoTrackConstraints>

Returns reference to DeviceVideoTrackConstraints from this MediaStreamSettings.

Returns None if DeviceVideoTrackConstraints is unconstrained.

Source

pub fn set_track_media_state( &mut self, state: MediaState, kind: MediaKind, source_kind: Option<MediaSourceKind>, )

Changes MediaState of audio or video type in this MediaStreamSettings.

If some type of the MediaStreamSettings is disabled, then this kind of media won’t be published.

Source

pub fn set_media_exchange_state_by_kinds( &mut self, state: Stable, kinds: LocalStreamUpdateCriteria, )

Enables/disables provided LocalStreamUpdateCriteria based on provided media_exchange_state.

Source

pub const fn set_audio_publish(&mut self, enabled: bool)

Sets the underlying enabled field of these AudioMediaTracksSettings to the given value.

Source

pub const fn set_video_publish( &mut self, enabled: bool, source_kind: Option<MediaSourceKind>, )

Sets the underlying VideoTrackConstraints basing on the provided MediaSourceKind to the given value.

Source

pub const fn is_audio_enabled(&self) -> bool

Indicates whether audio is enabled in this MediaStreamSettings.

Source

pub const fn is_device_video_enabled(&self) -> bool

Returns true if DeviceVideoTrackConstraints are currently constrained and enabled.

Source

pub const fn is_display_video_enabled(&self) -> bool

Returns true if DisplayVideoTrackConstraints are currently constrained and enabled.

Source

pub const fn enabled(&self, kind: &MediaType) -> bool

Indicates whether the given MediaType is enabled and constrained in this MediaStreamSettings.

Source

pub const fn muted(&self, kind: &MediaType) -> bool

Indicates whether the given MediaType is muted in this MediaStreamSettings.

Source

pub const fn is_track_enabled_and_constrained( &self, kind: MediaKind, source: Option<MediaSourceKind>, ) -> bool

Indicates whether the given MediaKind and MediaSourceKind are enabled and constrained in this MediaStreamSettings.

Source

pub const fn is_track_enabled( &self, kind: MediaKind, source: Option<MediaSourceKind>, ) -> bool

Indicates whether the given MediaKind and MediaSourceKind are enabled in this MediaStreamSettings.

Trait Implementations§

Source§

impl Clone for MediaStreamSettings

Source§

fn clone(&self) -> MediaStreamSettings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MediaStreamSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MediaStreamSettings

Source§

fn default() -> MediaStreamSettings

Returns the “default value” for a type. Read more
Source§

impl From<&SimpleTracksRequest> for MediaStreamSettings

Source§

fn from(request: &SimpleTracksRequest) -> Self

Converts to this type from the input type.
Source§

impl From<ApiMediaStreamSettings> for MediaStreamSettings

Source§

fn from(value: ApiMediaStreamSettings) -> Self

Converts to this type from the input type.
Source§

impl From<MediaStreamSettings> for Option<MultiSourceTracksConstraints>

Source§

fn from(constraints: MediaStreamSettings) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MediaStreamSettings

Source§

fn eq(&self, other: &MediaStreamSettings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for MediaStreamSettings

Source§

impl StructuralPartialEq for MediaStreamSettings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<E> WrapTraced<E> for E

Source§

fn wrap_traced(self, f: Frame) -> Traced<E>

Wraps this error into a Traced wrapper, storing the given Frame of a Trace inside.
Source§

impl<T> DartSafe for T

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> TaskRetFutTrait for T
where T: Send,