#[non_exhaustive]pub struct MediaEncoding {
pub video: VideoEncoding,
pub audio: Option<AudioEncoding>,
}Expand description
How LocalBroadcast::set_spec encodes the sources it opens.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.video: VideoEncodingThe renditions of a raw video source.
audio: Option<AudioEncoding>The encoding of a raw audio source.
None picks voice for a microphone and music for anything
else. A PCM encoding takes the rate and layout of a source that
reports them, so the samples go out as they come in.
Implementations§
Source§impl MediaEncoding
impl MediaEncoding
Sourcepub fn new(video: VideoEncoding) -> Self
pub fn new(video: VideoEncoding) -> Self
Creates an encoding of video, with the audio encoding picked by the source.
Sourcepub fn with_audio(self, audio: impl Into<AudioEncoding>) -> Self
pub fn with_audio(self, audio: impl Into<AudioEncoding>) -> Self
Returns this encoding with audio as the audio encoding.
Trait Implementations§
Source§impl Clone for MediaEncoding
impl Clone for MediaEncoding
Source§impl Debug for MediaEncoding
impl Debug for MediaEncoding
Source§impl Default for MediaEncoding
impl Default for MediaEncoding
Source§fn default() -> Self
fn default() -> Self
Returns the default VideoEncoding, with the audio encoding picked by the source.
Source§impl From<VideoEncoding> for MediaEncoding
impl From<VideoEncoding> for MediaEncoding
Source§fn from(video: VideoEncoding) -> Self
fn from(video: VideoEncoding) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MediaEncoding
impl RefUnwindSafe for MediaEncoding
impl Send for MediaEncoding
impl Sync for MediaEncoding
impl Unpin for MediaEncoding
impl UnsafeUnpin for MediaEncoding
impl UnwindSafe for MediaEncoding
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
Mutably borrows from an owned value. Read more