VideoSink.OnFormatChange Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

When overridden in a derived class, is invoked when a video device reports a video format change.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

Syntax

Protected MustOverride Sub OnFormatChange ( _
    videoFormat As VideoFormat _
)
protected abstract void OnFormatChange(
    VideoFormat videoFormat
)

Parameters

Remarks

The current VideoFormat for a sink can differ from the format that is requested in VideoCaptureDevice..::.DesiredFormat.

When a video capture starts in the sink, OnFormatChange is invoked at least one time by the system for the first capture by that sink. Therefore, you can use OnFormatChange to determine current video format, instead of using DesiredFormat or SupportedFormats.

The VideoCaptureDevice properties help you determine whether your application logic can support capture and sample conversion for a particular device based on its formats. (You can also prompt users to change devices in their configuration UI if there are alternatives reported by GetAvailableVideoCaptureDevices that might work if the current default device is not supported.)

A format change from the video device (including getting the initial format of the capture) would typically also be relevant to your OnSample implementation.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

VideoSink Class

System.Windows.Media Namespace