MediaStreamSourceSwitchStreamsRequest MediaStreamSourceSwitchStreamsRequest MediaStreamSourceSwitchStreamsRequest MediaStreamSourceSwitchStreamsRequest Class


Represents an object to be used by the MediaStreamSource.SwitchStreamsRequest event to provide information to the application.

public : sealed class MediaStreamSourceSwitchStreamsRequest : IMediaStreamSourceSwitchStreamsRequest
public sealed class MediaStreamSourceSwitchStreamsRequest : IMediaStreamSourceSwitchStreamsRequest
Public NotInheritable Class MediaStreamSourceSwitchStreamsRequest Implements IMediaStreamSourceSwitchStreamsRequest
// This class does not provide a public constructor.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


See the MediaStreamSource Sample for an example of using Media Stream Source in a UWP app.


NewStreamDescriptor NewStreamDescriptor NewStreamDescriptor NewStreamDescriptor

Gets the stream descriptor for the stream that is now selected by the MediaStreamSource.

public : IMediaStreamDescriptor NewStreamDescriptor { get; }
public IMediaStreamDescriptor NewStreamDescriptor { get; }
Public ReadOnly Property NewStreamDescriptor As IMediaStreamDescriptor
var iMediaStreamDescriptor = mediaStreamSourceSwitchStreamsRequest.newStreamDescriptor;

OldStreamDescriptor OldStreamDescriptor OldStreamDescriptor OldStreamDescriptor

Gets the stream descriptor for the stream which is no longer selected by the MediaStreamSource.

public : IMediaStreamDescriptor OldStreamDescriptor { get; }
public IMediaStreamDescriptor OldStreamDescriptor { get; }
Public ReadOnly Property OldStreamDescriptor As IMediaStreamDescriptor
var iMediaStreamDescriptor = mediaStreamSourceSwitchStreamsRequest.oldStreamDescriptor;


GetDeferral() GetDeferral() GetDeferral() GetDeferral()

Defers completing the MediaStreamSource.SwitchStreamsRequested event.

public : MediaStreamSourceSwitchStreamsRequestDeferral GetDeferral()
public MediaStreamSourceSwitchStreamsRequestDeferral GetDeferral()
Public Function GetDeferral() As MediaStreamSourceSwitchStreamsRequestDeferral
var mediaStreamSourceSwitchStreamsRequestDeferral = mediaStreamSourceSwitchStreamsRequest.getDeferral();


You can use a deferral when you want to make an asynchronous call in response to the MediaStreamSource.SwitchStreamsRequested event. For example, if you need to establish a HTTP connection or open a file for reading. The MediaStreamSource will then wait for you to mark the deferral as complete before it begins raising the SampleRequested event.

To create a deferral, call the GetDeferral method to instruct the MediaStreamSource to wait for your asynchronous call to complete. When you are ready to start receiving SampleRequested events, call the Complete method to end the deferral.

See Also