MediaStreamSample Constructor (MediaStreamDescription, Stream, Int64, Int64, Int64, IDictionary<MediaSampleAttributeKeys, String>)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Instantiates a new instance of the MediaStreamSample class.

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

Syntax

'Declaration
Public Sub New ( _
    mediaStreamDescription As MediaStreamDescription, _
    stream As Stream, _
    offset As Long, _
    count As Long, _
    timestamp As Long, _
    attributes As IDictionary(Of MediaSampleAttributeKeys, String) _
)
public MediaStreamSample(
    MediaStreamDescription mediaStreamDescription,
    Stream stream,
    long offset,
    long count,
    long timestamp,
    IDictionary<MediaSampleAttributeKeys, string> attributes
)

Parameters

  • stream
    Type: System.IO.Stream
    A stream containing the desired media sample. Set to nulla null reference (Nothing in Visual Basic) to report the end of a stream.
  • offset
    Type: System.Int64
    The offset into the stream where the actual sample data begins.
  • count
    Type: System.Int64
    The number of bytes that comprises the sample data.
  • timestamp
    Type: System.Int64
    The time from the beginning of the media file at which this sample should be rendered as expressed using 100 nanosecond increments.

Exceptions

Exception Condition
InvalidOperationException

One or more parameters are invalid.

ArgumentException

DRMAlgorithmID value passed in was invalid.

ArgumentException

DRMAlgorithmID was set to "Unprotected" while DRMKeyIdentifier was set to a non Guid.Empty value.

ArgumentException

DRMAlgorithmID was not set but DRMKeyIdentifier was set to a non Guid.Empty value.

ArgumentException

DRMKeyIdentifier was not set to a correctly formatted value.

ArgumentException

DRMKeyIdentifier was not set or set to Guid.Empty, but DRMAlgorithmID was specified and not set to "Unprotected".

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.