Udostępnij za pośrednictwem


VideoFrame Class

Definition

Represents a single frame of video data.

public ref class VideoFrame sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.Media.IVideoFrameFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.GCPressure]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class VideoFrame final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.GCPressure]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Media.IVideoFrameFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class VideoFrame final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Media.IVideoFrameFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.GCPressure]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class VideoFrame : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.GCPressure]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Media.IVideoFrameFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class VideoFrame : System.IDisposable
function VideoFrame(format, width, height, alpha)
Public NotInheritable Class VideoFrame
Implements IDisposable
Inheritance
Object Platform::Object IInspectable VideoFrame
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

Version history

Windows version SDK version Value added
1803 17134 CopyToAsync(VideoFrame,Nullable<BitmapBounds&gt,Nullable<BitmapBounds&gt)

Constructors

VideoFrame(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode)

Initializes a new instance of the VideoFrame class.

VideoFrame(BitmapPixelFormat, Int32, Int32)

Initializes a new instance of the VideoFrame class.

Properties

Direct3DSurface

Gets the IDirect3DSurface object containing the pixel data of the video frame, when one is present.

Duration

Gets or sets the duration of the video frame.

ExtendedProperties

Gets the extended property set which enables getting and setting properties on the media frame.

IsDiscontinuous

Gets or sets a value that indicates whether an video frame is the first frame after a gap in the stream.

IsReadOnly

Gets a value indicating whether the video frame is read-only.

RelativeTime

Gets or sets the relative time of the frame within the video stream.

SoftwareBitmap

Gets the SoftwareBitmap object containing the pixel data of the video frame, when one is present.

SystemRelativeTime

Gets or sets a timestamp that is relative to the system and is correlatable across multiple media sources on the same device.

Type

Gets a string indicating the type of video data the video frame contains.

Methods

Close()

Disposes of the object and associated resources.

CopyToAsync(VideoFrame, IReference<BitmapBounds>, IReference<BitmapBounds>)

Copies the specified rectangle in the current VideoFrame into the specified rectangle of a provided VideoFrame object.

CopyToAsync(VideoFrame)

Copies the current VideoFrame into a provided VideoFrame object.

CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat, Int32, Int32, IDirect3DDevice)

Creates a new instance of the VideoFrame class for which the image data is stored in an IDXGISurface allocated by the supplied Direct3D device.

CreateAsDirect3D11SurfaceBacked(DirectXPixelFormat, Int32, Int32)

Creates a new instance of the VideoFrame class for which the image data is stored in an IDXGISurface allocated by the default Direct3D device.

CreateWithDirect3D11Surface(IDirect3DSurface)

Creates a new instance of the VideoFrame class for which the image data is stored in the provided IDXGISurface.

CreateWithSoftwareBitmap(SoftwareBitmap)

Creates a new instance of the VideoFrame class from the provided SoftwareBitmap.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Applies to

See also