Delen via


MediaStreamSample Class

Definition

Represents a media sample used by the MediaStreamSource.

public ref class MediaStreamSample 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 MediaStreamSample 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 MediaStreamSample
Public NotInheritable Class MediaStreamSample
Inheritance
Object Platform::Object IInspectable MediaStreamSample
Attributes

Windows requirements

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

Remarks

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

Version history

Windows version SDK version Value added
1809 17763 CreateFromDirect3D11Surface
1809 17763 Direct3D11Surface

Properties

Buffer

Gets the buffer which encapsulates the MediaStreamSample data.

DecodeTimestamp

Gets and sets the decode timestamp for this MediaStreamSample.

Direct3D11Surface

Gets the IDirect3DSurface which encapsulates the MediaStreamSample data.

Discontinuous

Gets or sets a value to indicate that the previous MediaStreamSample in the sequence is missing.

Duration

Gets the duration of the sample.

ExtendedProperties

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

KeyFrame

Gets or sets a value that indicates the MediaStreamSample contains a keyframe.

Protection

Gets a MediaStreamSampleProtectionProperties object, which is used for getting and setting properties that are specific to the Digital Rights Management (DRM) protection of the MediaStreamSample.

Timestamp

Gets the time at which a sample should be rendered. This is also referred to as the presentation time.

Methods

CreateFromBuffer(IBuffer, TimeSpan)

Creates a MediaStreamSample from an IBuffer.

CreateFromDirect3D11Surface(IDirect3DSurface, TimeSpan)

Creates a MediaStreamSample from an IDirect3DSurface.

CreateFromStreamAsync(IInputStream, UInt32, TimeSpan)

Asynchronously creates a MediaStreamSample from an IInputStream.

Events

Processed

Occurs when the MediaStreamSample has been processed by the media pipeline.

Applies to

See also