MediaStreamSample Constructor (MediaStreamDescription, Stream, Int64, 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
<SecuritySafeCriticalAttribute> _
Public Sub New ( _
mediaStreamDescription As MediaStreamDescription, _
stream As Stream, _
offset As Long, _
count As Long, _
timestamp As Long, _
duration As Long, _
attributes As IDictionary(Of MediaSampleAttributeKeys, String) _
)
[SecuritySafeCriticalAttribute]
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 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.
- 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.
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
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
See Also