Struct windows::Media::Capture::MediaCapture

pub struct MediaCapture(/* private fields */);

Implementations§

§

impl MediaCapture

pub fn new() -> Result<Self>

pub fn Close(&self) -> Result<()>

pub fn InitializeAsync(&self) -> Result<IAsyncAction>

pub fn InitializeWithSettingsAsync<P0>( &self, mediacaptureinitializationsettings: P0, ) -> Result<IAsyncAction>

pub fn StartRecordToStorageFileAsync<P0, P1>( &self, encodingprofile: P0, file: P1, ) -> Result<IAsyncAction>
where P0: Param<MediaEncodingProfile>, P1: Param<IStorageFile>,

pub fn StartRecordToStreamAsync<P0, P1>( &self, encodingprofile: P0, stream: P1, ) -> Result<IAsyncAction>
where P0: Param<MediaEncodingProfile>, P1: Param<IRandomAccessStream>,

pub fn StartRecordToCustomSinkAsync<P0, P1>( &self, encodingprofile: P0, custommediasink: P1, ) -> Result<IAsyncAction>
where P0: Param<MediaEncodingProfile>, P1: Param<IMediaExtension>,

pub fn StartRecordToCustomSinkIdAsync<P0, P1>( &self, encodingprofile: P0, customsinkactivationid: &HSTRING, customsinksettings: P1, ) -> Result<IAsyncAction>
where P0: Param<MediaEncodingProfile>, P1: Param<IPropertySet>,

pub fn StopRecordAsync(&self) -> Result<IAsyncAction>

pub fn CapturePhotoToStorageFileAsync<P0, P1>( &self, type: P0, file: P1, ) -> Result<IAsyncAction>
where P0: Param<ImageEncodingProperties>, P1: Param<IStorageFile>,

pub fn CapturePhotoToStreamAsync<P0, P1>( &self, type: P0, stream: P1, ) -> Result<IAsyncAction>
where P0: Param<ImageEncodingProperties>, P1: Param<IRandomAccessStream>,

pub fn AddEffectAsync<P0>( &self, mediastreamtype: MediaStreamType, effectactivationid: &HSTRING, effectsettings: P0, ) -> Result<IAsyncAction>
where P0: Param<IPropertySet>,

pub fn ClearEffectsAsync( &self, mediastreamtype: MediaStreamType, ) -> Result<IAsyncAction>

pub fn SetEncoderProperty<P0>( &self, mediastreamtype: MediaStreamType, propertyid: GUID, propertyvalue: P0, ) -> Result<()>
where P0: Param<IInspectable>,

pub fn GetEncoderProperty( &self, mediastreamtype: MediaStreamType, propertyid: GUID, ) -> Result<IInspectable>

pub fn Failed<P0>( &self, erroreventhandler: P0, ) -> Result<EventRegistrationToken>

pub fn RemoveFailed(&self, eventcookie: EventRegistrationToken) -> Result<()>

pub fn RecordLimitationExceeded<P0>( &self, recordlimitationexceededeventhandler: P0, ) -> Result<EventRegistrationToken>

pub fn RemoveRecordLimitationExceeded( &self, eventcookie: EventRegistrationToken, ) -> Result<()>

pub fn MediaCaptureSettings(&self) -> Result<MediaCaptureSettings>

pub fn AudioDeviceController(&self) -> Result<AudioDeviceController>

pub fn VideoDeviceController(&self) -> Result<VideoDeviceController>

pub fn SetPreviewMirroring(&self, value: bool) -> Result<()>

pub fn GetPreviewMirroring(&self) -> Result<bool>

pub fn SetPreviewRotation(&self, value: VideoRotation) -> Result<()>

pub fn GetPreviewRotation(&self) -> Result<VideoRotation>

pub fn SetRecordRotation(&self, value: VideoRotation) -> Result<()>

pub fn GetRecordRotation(&self) -> Result<VideoRotation>

pub fn PrepareLowLagRecordToStorageFileAsync<P0, P1>( &self, encodingprofile: P0, file: P1, ) -> Result<IAsyncOperation<LowLagMediaRecording>>
where P0: Param<MediaEncodingProfile>, P1: Param<IStorageFile>,

pub fn PrepareLowLagRecordToStreamAsync<P0, P1>( &self, encodingprofile: P0, stream: P1, ) -> Result<IAsyncOperation<LowLagMediaRecording>>
where P0: Param<MediaEncodingProfile>, P1: Param<IRandomAccessStream>,

pub fn PrepareLowLagRecordToCustomSinkAsync<P0, P1>( &self, encodingprofile: P0, custommediasink: P1, ) -> Result<IAsyncOperation<LowLagMediaRecording>>
where P0: Param<MediaEncodingProfile>, P1: Param<IMediaExtension>,

pub fn PrepareLowLagRecordToCustomSinkIdAsync<P0, P1>( &self, encodingprofile: P0, customsinkactivationid: &HSTRING, customsinksettings: P1, ) -> Result<IAsyncOperation<LowLagMediaRecording>>
where P0: Param<MediaEncodingProfile>, P1: Param<IPropertySet>,

pub fn PrepareLowLagPhotoCaptureAsync<P0>( &self, type: P0, ) -> Result<IAsyncOperation<LowLagPhotoCapture>>
where P0: Param<ImageEncodingProperties>,

pub fn PrepareLowLagPhotoSequenceCaptureAsync<P0>( &self, type: P0, ) -> Result<IAsyncOperation<LowLagPhotoSequenceCapture>>
where P0: Param<ImageEncodingProperties>,

pub fn SetEncodingPropertiesAsync<P0, P1>( &self, mediastreamtype: MediaStreamType, mediaencodingproperties: P0, encoderproperties: P1, ) -> Result<IAsyncAction>
where P0: Param<IMediaEncodingProperties>, P1: Param<MediaPropertySet>,

pub fn PrepareVariablePhotoSequenceCaptureAsync<P0>( &self, type: P0, ) -> Result<IAsyncOperation<VariablePhotoSequenceCapture>>
where P0: Param<ImageEncodingProperties>,

pub fn FocusChanged<P0>(&self, handler: P0) -> Result<EventRegistrationToken>

pub fn RemoveFocusChanged(&self, token: EventRegistrationToken) -> Result<()>

pub fn PhotoConfirmationCaptured<P0>( &self, handler: P0, ) -> Result<EventRegistrationToken>

pub fn RemovePhotoConfirmationCaptured( &self, token: EventRegistrationToken, ) -> Result<()>

pub fn AddAudioEffectAsync<P0>( &self, definition: P0, ) -> Result<IAsyncOperation<IMediaExtension>>
where P0: Param<IAudioEffectDefinition>,

pub fn AddVideoEffectAsync<P0>( &self, definition: P0, mediastreamtype: MediaStreamType, ) -> Result<IAsyncOperation<IMediaExtension>>
where P0: Param<IVideoEffectDefinition>,

pub fn PauseRecordAsync( &self, behavior: MediaCapturePauseBehavior, ) -> Result<IAsyncAction>

pub fn ResumeRecordAsync(&self) -> Result<IAsyncAction>

pub fn CameraStreamStateChanged<P0>( &self, handler: P0, ) -> Result<EventRegistrationToken>
where P0: Param<TypedEventHandler<MediaCapture, IInspectable>>,

pub fn RemoveCameraStreamStateChanged( &self, token: EventRegistrationToken, ) -> Result<()>

pub fn CameraStreamState(&self) -> Result<CameraStreamState>

pub fn GetPreviewFrameAsync(&self) -> Result<IAsyncOperation<VideoFrame>>

pub fn GetPreviewFrameCopyAsync<P0>( &self, destination: P0, ) -> Result<IAsyncOperation<VideoFrame>>
where P0: Param<VideoFrame>,

pub fn ThermalStatusChanged<P0>( &self, handler: P0, ) -> Result<EventRegistrationToken>
where P0: Param<TypedEventHandler<MediaCapture, IInspectable>>,

pub fn RemoveThermalStatusChanged( &self, token: EventRegistrationToken, ) -> Result<()>

pub fn ThermalStatus(&self) -> Result<MediaCaptureThermalStatus>

pub fn PrepareAdvancedPhotoCaptureAsync<P0>( &self, encodingproperties: P0, ) -> Result<IAsyncOperation<AdvancedPhotoCapture>>
where P0: Param<ImageEncodingProperties>,

pub fn RemoveEffectAsync<P0>(&self, effect: P0) -> Result<IAsyncAction>
where P0: Param<IMediaExtension>,

pub fn PauseRecordWithResultAsync( &self, behavior: MediaCapturePauseBehavior, ) -> Result<IAsyncOperation<MediaCapturePauseResult>>

pub fn StopRecordWithResultAsync( &self, ) -> Result<IAsyncOperation<MediaCaptureStopResult>>

pub fn FrameSources(&self) -> Result<IMapView<HSTRING, MediaFrameSource>>

pub fn CreateFrameReaderAsync<P0>( &self, inputsource: P0, ) -> Result<IAsyncOperation<MediaFrameReader>>
where P0: Param<MediaFrameSource>,

pub fn CreateFrameReaderWithSubtypeAsync<P0>( &self, inputsource: P0, outputsubtype: &HSTRING, ) -> Result<IAsyncOperation<MediaFrameReader>>
where P0: Param<MediaFrameSource>,

pub fn CreateFrameReaderWithSubtypeAndSizeAsync<P0>( &self, inputsource: P0, outputsubtype: &HSTRING, outputsize: BitmapSize, ) -> Result<IAsyncOperation<MediaFrameReader>>
where P0: Param<MediaFrameSource>,

pub fn CaptureDeviceExclusiveControlStatusChanged<P0>( &self, handler: P0, ) -> Result<EventRegistrationToken>

pub fn RemoveCaptureDeviceExclusiveControlStatusChanged( &self, token: EventRegistrationToken, ) -> Result<()>

pub fn CreateMultiSourceFrameReaderAsync<P0>( &self, inputsources: P0, ) -> Result<IAsyncOperation<MultiSourceMediaFrameReader>>
where P0: Param<IIterable<MediaFrameSource>>,

pub fn CreateRelativePanelWatcher<P0>( &self, capturemode: StreamingCaptureMode, displayregion: P0, ) -> Result<MediaCaptureRelativePanelWatcher>
where P0: Param<DisplayRegion>,

pub fn IsVideoProfileSupported(videodeviceid: &HSTRING) -> Result<bool>

pub fn FindAllVideoProfiles( videodeviceid: &HSTRING, ) -> Result<IVectorView<MediaCaptureVideoProfile>>

pub fn FindConcurrentProfiles( videodeviceid: &HSTRING, ) -> Result<IVectorView<MediaCaptureVideoProfile>>

pub fn FindKnownVideoProfiles( videodeviceid: &HSTRING, name: KnownVideoProfile, ) -> Result<IVectorView<MediaCaptureVideoProfile>>

pub fn StartPreviewAsync(&self) -> Result<IAsyncAction>

pub fn StartPreviewToCustomSinkAsync<P0, P1>( &self, encodingprofile: P0, custommediasink: P1, ) -> Result<IAsyncAction>
where P0: Param<MediaEncodingProfile>, P1: Param<IMediaExtension>,

pub fn StartPreviewToCustomSinkIdAsync<P0, P1>( &self, encodingprofile: P0, customsinkactivationid: &HSTRING, customsinksettings: P1, ) -> Result<IAsyncAction>
where P0: Param<MediaEncodingProfile>, P1: Param<IPropertySet>,

pub fn StopPreviewAsync(&self) -> Result<IAsyncAction>

Trait Implementations§

§

impl CanInto<IClosable> for MediaCapture

§

const QUERY: bool = true

§

impl CanInto<IInspectable> for MediaCapture

§

const QUERY: bool = false

§

impl CanInto<IUnknown> for MediaCapture

§

const QUERY: bool = false

§

impl Clone for MediaCapture

§

fn clone(&self) -> MediaCapture

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
§

impl Debug for MediaCapture

§

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

Formats the value using the given formatter. Read more
§

impl From<&MediaCapture> for &IInspectable

§

fn from(value: &MediaCapture) -> Self

Converts to this type from the input type.
§

impl From<&MediaCapture> for &IUnknown

§

fn from(value: &MediaCapture) -> Self

Converts to this type from the input type.
§

impl From<MediaCapture> for IInspectable

§

fn from(value: MediaCapture) -> Self

Converts to this type from the input type.
§

impl From<MediaCapture> for IUnknown

§

fn from(value: MediaCapture) -> Self

Converts to this type from the input type.
§

impl Interface for MediaCapture

§

const IID: GUID = <IMediaCapture as windows_core::Interface>::IID

The GUID associated with the interface.
§

fn as_raw(&self) -> *mut c_void

Returns the raw COM interface pointer. The resulting pointer continues to be owned by the Interface implementation.
§

fn into_raw(self) -> *mut c_void

Returns the raw COM interface pointer and releases ownership. It the caller’s responsibility to release the COM interface pointer.
§

unsafe fn from_raw(raw: *mut c_void) -> Self

Creates an Interface by taking ownership of the raw COM interface pointer. Read more
§

unsafe fn from_raw_borrowed(raw: &*mut c_void) -> Option<&Self>

Creates an Interface that is valid so long as the raw COM interface pointer is valid. Read more
§

fn cast<T>(&self) -> Result<T, Error>
where T: Interface,

Attempts to cast the current interface to another interface using QueryInterface. Read more
§

fn cast_to_any<T>(&self) -> Result<&(dyn Any + 'static), Error>
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

This casts the given COM interface to [&dyn Any]. Read more
§

fn is_object<T>(&self) -> bool
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

Returns true if the given COM interface refers to an implementation of T. Read more
§

fn cast_object_ref<T>(&self) -> Result<&<T as ComObjectInner>::Outer, Error>
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

This casts the given COM interface to [&dyn Any]. It returns a reference to the “outer” object, e.g. &MyApp_Impl, not the inner &MyApp object. Read more
§

fn cast_object<T>(&self) -> Result<ComObject<T>, Error>
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

This casts the given COM interface to [&dyn Any]. It returns a reference to the “outer” object, e.g. MyApp_Impl, not the inner MyApp object. Read more
§

fn downgrade(&self) -> Result<Weak<Self>, Error>

Attempts to create a [Weak] reference to this object.
§

unsafe fn query(&self, iid: *const GUID, interface: *mut *mut c_void) -> HRESULT

Call QueryInterface on this interface Read more
§

fn to_ref(&self) -> InterfaceRef<'_, Self>

Creates an InterfaceRef for this reference. The InterfaceRef tracks lifetimes statically, and eliminates the need for dynamic reference count adjustments (AddRef/Release).
§

impl PartialEq for MediaCapture

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl Eq for MediaCapture

§

impl StructuralPartialEq for MediaCapture

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

§

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>,

§

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>,

§

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.