MediaCaptureInitializationSettings Class

Definition

Contains initialization settings for the MediaCapture object which are passed to the MediaCapture.InitializeAsync method.

public ref class MediaCaptureInitializationSettings sealed
class MediaCaptureInitializationSettings sealed
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MediaCaptureInitializationSettings
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class MediaCaptureInitializationSettings
function MediaCaptureInitializationSettings()
Public NotInheritable Class MediaCaptureInitializationSettings
Inheritance
MediaCaptureInitializationSettings
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)
App capabilities
backgroundMediaRecording microphone webcam

Examples

The following example initializes the MediaCaptureInitializationSettings. Call InitializeAsync with these settings to initialize a MediaCapture object.

private void InitCaptureSettings()
{
    _captureInitSettings = null;
    _captureInitSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
    _captureInitSettings.AudioDeviceId = "";
    _captureInitSettings.VideoDeviceId = "";
    _captureInitSettings.StreamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.AudioAndVideo;
    _captureInitSettings.PhotoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.VideoPreview;
    
    if (_deviceList.Count > 0)
        _captureInitSettings.VideoDeviceId = _deviceList[0].Id;
}
// Initialize the MediaCaptureInitialzationSettings.
function initCaptureSettings() {
    captureInitSettings = null;
    captureInitSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
    captureInitSettings.audioDeviceId = "";
    captureInitSettings.videoDeviceId = "";
    captureInitSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.audioAndVideo;
    captureInitSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.photo;
    if (deviceList.length > 0)
        captureInitSettings.videoDeviceId = deviceList[0].id;
}

Remarks

For how-to guidance on initializing and shutting down the MediaCapture object, see Basic photo, video, and audio capture with MediaCapture.

Note

When MediaCaptureSharingMode::SharedReadOnly is used, some of the MediaCaptureInitializationSettings properties can't be configured. See SharingMode for details.

Version history

Windows version SDK version Value added
1607 14393 MemoryPreference
1607 14393 SharingMode
1607 14393 SourceGroup
1703 15063 AlwaysPlaySystemShutterSound
2004 19041 DeviceUri
2004 19041 DeviceUriPasswordCredential

Constructors

MediaCaptureInitializationSettings()

Creates a new instance of the MediaCaptureInitializationSettings object.

Properties

AlwaysPlaySystemShutterSound

Gets a value indicating whether the system should always play a shutter sound when a photo is captured.

AudioDeviceId

Gets the DeviceInformation.Id of the microphone.

AudioProcessing

Gets or sets a value that specifies the audio processing mode.

AudioSource

Gets or sets the audio source for the capture operation.

DeviceUri

Gets or sets the URI of the remote capture device to be initialized.

DeviceUriPasswordCredential

Gets or sets the PasswordCredential object representing the credentials used to access the remote capture device to be initialized.

MediaCategory

Gets or set the media category.

MemoryPreference

Gets or sets an object specifying the preferred memory location for storing frames acquired from a MediaFrameSource used by the MediaCapture.

PhotoCaptureSource

Gets or sets the stream that is used for photo capture.

PhotoMediaDescription

Gets or sets the media description for photo capture.

PreviewMediaDescription

Gets or sets the media description for preview video.

RecordMediaDescription

Gets or sets the media description for video recording.

SharingMode

Gets or sets an object that specifies the sharing mode for the MediaCapture.

SourceGroup

Gets or sets the MediaFrameSourceGroup with which the MediaCapture should be initialized. This property defines a set of media frame sources that can be used simultaneously.

StreamingCaptureMode

Gets or sets the streaming mode.

VideoDeviceId

Gets the DeviceInformation.Id of the video camera.

VideoProfile

Gets or sets the video profile which provides hints to the driver to allow it to optimize for different capture scenarios.

VideoSource

Gets or sets the video source for the capture operation.

Applies to

See also