MediaStreamSample Constructor (MediaStreamDescription, Stream, Int64, Int64, Int64, Int64, IDictionary<MediaSampleAttributeKeys, String>)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Instantiates a new instance of the MediaStreamSample class.
Assembly: System.Windows (in System.Windows.dll)
public MediaStreamSample( MediaStreamDescription mediaStreamDescription, Stream stream, long offset, long count, long timestamp, long duration, IDictionary<MediaSampleAttributeKeys, string> attributes )
Parameters
- mediaStreamDescription
- Type: System.Windows.Media.MediaStreamDescription
A description of the stream this sample was pulled from.
- stream
- Type: System.IO.Stream
A stream containing the desired media sample. Set to null 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.
- duration
- Type: System.Int64
The duration of the sample.
- attributes
- Type: System.Collections.Generic.IDictionary<MediaSampleAttributeKeys, String>
A collection of pairs describing other attributes of the media sample.
| 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". |