StreamInfo Class
Defines the basic information for each stream. This class corresponds to the StreamIndex element of the client manifest. You can extend the class to add private data per stream.
Inheritance Hierarchy
System.Object
Microsoft.Web.Media.SmoothStreaming.StreamInfo
Namespace: Microsoft.Web.Media.SmoothStreaming
Assembly: Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)
Syntax
'Declaration
Public Class StreamInfo
'Usage
Dim instance As StreamInfo
public class StreamInfo
public ref class StreamInfo
type StreamInfo = class end
public class StreamInfo
The StreamInfo type exposes the following members.
Properties
Name | Description | |
---|---|---|
Attributes | Gets or sets attributes for this stream. | |
AvailableTracks | Gets the AvailableTracks property. | |
ChildStreams | Gets the ChildStreams property. | |
ChunkList | Gets the list of chunks for this stream. | |
ParentStream | Gets or sets the parent stream in the case of a sparse stream. Otherwise this is null. | |
Segment | Gets or sets the segment for this stream. | |
SelectedTracks | Gets or sets the SelectedTracks property. | |
Subtype | Gets or sets the Subtype property. | |
Timescale | Gets or sets the time scale of the stream. | |
Type | Gets or sets the Type property. | |
UniqueId | Gets or sets the Id that identifies this stream. |
Top
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
RestrictTracks | Replaces AvailableTracks with the specified list of available tracks. | |
SelectTracks | Selects TrackInfo objects for this stream. For more information see Select and Monitor Bitrate. | |
ToString | Writes the StreamInfo item to a string. (Overrides Object.ToString().) |
Top
Remarks
The AvailableStreams property of the SegmentInfo object contains a collection of StreamInfo objects. The SelectedStreams property of the SegmentInfo object must include exactly one video StreamInfo object and one audio StreamInfo object. Text streams do not have this restriction and can be multiply selected and deselected. Streams must be members of the current segment’s AvailableStreams and/or SelectedStreams property. To generate the lists of available streams or selected streams use a List<T>.CopyTo constructor of type StreamInfo to copy either the AvailableStreams or the SelectedStreams property. Add or remove streams until you have the desired list.
Notifications for de-selection of current streams will arrive before selection notifications on a per-segment basis. Applications can clean up any state associated with the deselected stream before adding state associated with the new stream. However, due to the possibility of multiple segments, it is preferable to use the UniqueId property to identify the stream with which objects are associated.
For an implementation example that parses StreamInfo objects, see Timeline Markers and Events under the heading "Extract Timeline Events and Assign Markers."
Examples
The following example shows how to get SegmentInfo and StreamInfo objects from the ManifestInfo object.
void SmoothPlayer_ManifestReady(object sender, EventArgs e)
{
if (!PremiumAccount)
{
foreach (SegmentInfo segment in SmoothPlayer.ManifestInfo.Segments)
{
IList<StreamInfo> streamInfoList = segment.AvailableStreams;
foreach (StreamInfo stream in streamInfoList)
{
if (stream.Type == MediaStreamType.Video)
{
// Limit bit-rate to 866000.
ulong highRate = 866000 + 1;
List<TrackInfo> tracks = new List<TrackInfo>();
tracks = stream.AvailableTracks.ToList<TrackInfo>();
IList<TrackInfo> allowedTracks = tracks.Where((ti) => ti.Bitrate < highRate).ToList();
stream.SelectTracks(allowedTracks, false);
}
}
}
}
}
Version Information
Silverlight
Supported in: 5
Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.