MediaStreamSample Constructor (MediaStreamDescription, Stream, Int64, Int64, Int64, IDictionary(Of 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)
'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) _ )
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 Nothing 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.
- attributes
- Type: System.Collections.Generic.IDictionary(Of 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". |