Share via


MediaStreamSourceSwitchStreamsRequestDeferral 类

定义

提供一种方法,让应用程序异步报告它已完成 MediaStreamSource.SwitchStreamsRequested 事件。

public ref class MediaStreamSourceSwitchStreamsRequestDeferral sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class MediaStreamSourceSwitchStreamsRequestDeferral final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MediaStreamSourceSwitchStreamsRequestDeferral
Public NotInheritable Class MediaStreamSourceSwitchStreamsRequestDeferral
继承
Object Platform::Object IInspectable MediaStreamSourceSwitchStreamsRequestDeferral
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

如果要进行异步调用以响应 MediaStreamSource.SwitchStreamsRequested 事件,可以使用延迟。 例如,如果需要建立 HTTP 连接或打开文件进行读取。 然后 ,MediaStreamSource 将等待将延迟标记为完成,然后它开始引发 SampleRequested 事件。

若要创建延迟,请在 MediaStreamSourceSwitchStreamsRequest 对象上调用 GetDeferral 方法,以指示 MediaStreamSource 等待异步调用完成。 准备好开始接收 SampleRequested 事件时,请调用 Complete 方法以结束延迟。

有关在 UWP 应用中使用媒体流源的示例,请参阅 MediaStreamSource 示例

方法

Complete()

报告应用程序已完成处理 MediaStreamSource.SwitchStreamsRequested 事件。

适用于

另请参阅