Dela via


MediaCaptureInitializationSettings.SharingMode Property

Definition

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

public:
 property MediaCaptureSharingMode SharingMode { MediaCaptureSharingMode get(); void set(MediaCaptureSharingMode value); };
MediaCaptureSharingMode SharingMode();

void SharingMode(MediaCaptureSharingMode value);
public MediaCaptureSharingMode SharingMode { get; set; }
var mediaCaptureSharingMode = mediaCaptureInitializationSettings.sharingMode;
mediaCaptureInitializationSettings.sharingMode = mediaCaptureSharingMode;
Public Property SharingMode As MediaCaptureSharingMode

Property Value

An object that specifies the sharing mode for the MediaCapture.

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)
App capabilities
backgroundMediaRecording

Remarks

Multiple apps can simultaneously acquire frames from the same MediaFrameSource, but only a single app can acquire exclusive control of and modify the settings for the frame source. Set SharingMode to ExclusiveControl if you need to adjust the configuration of any of the frame sources included the requested SourceGroup. However, this means that the call to InitializeAsync will fail if another app already has exclusive control of one of the frame sources in the group. If you only need to acquire frames without modifying the configuration, set SharingMode to SharedReadOnly.

When the SharingMode is set to SharedReadOnly, some of the MediaCaptureInitializationSettings properties can't be configured. See below table for details.

Properties Can be configured in Sharing Mode
AlwaysPlaySystemShutterSound Yes
AudioDeviceId Yes
AudioProcessing Yes
AudioSource N/A
DeviceUri Yes
DeviceUriPasswordCredential Yes
MediaCategory Yes
MemoryPreference Yes
PhotoCaptureSource N/A
PhotoMediaDescription No
PreviewMediaDescription No
RecordMediaDescription No
SourceGroup Yes
StreamingCaptureMode Yes
VideoDeviceId Yes
VideoProfile No
VideoSource Yes

Applies to