Share via


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
Public propertySupported by Windows Phone Attributes Gets or sets attributes for this stream.
Public propertySupported by Windows Phone AvailableTracks Gets the AvailableTracks property.
Public propertySupported by Windows Phone ChildStreams Gets the ChildStreams property.
Public propertySupported by Windows Phone ChunkList Gets the list of chunks for this stream.
Public propertySupported by Windows Phone ParentStream Gets or sets the parent stream in the case of a sparse stream. Otherwise this is null.
Public propertySupported by Windows Phone Segment Gets or sets the segment for this stream.
Public propertySupported by Windows Phone SelectedTracks Gets or sets the SelectedTracks property.
Public propertySupported by Windows Phone Subtype Gets or sets the Subtype property.
Public property Timescale Gets or sets the time scale of the stream.
Public propertySupported by Windows Phone Type Gets or sets the Type property.
Public propertySupported by Windows Phone UniqueId Gets or sets the Id that identifies this stream.

Top

Methods

  Name Description
Public methodSupported by Windows Phone Equals (Inherited from Object.)
Protected methodSupported by Windows Phone Finalize (Inherited from Object.)
Public methodSupported by Windows Phone GetHashCode (Inherited from Object.)
Public methodSupported by Windows Phone GetType (Inherited from Object.)
Protected methodSupported by Windows Phone MemberwiseClone (Inherited from Object.)
Public methodSupported by Windows Phone RestrictTracks Replaces AvailableTracks with the specified list of available tracks.
Public methodSupported by Windows Phone SelectTracks Selects TrackInfo objects for this stream. For more information see Select and Monitor Bitrate.
Public methodSupported by Windows Phone 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.

See Also

Reference

Microsoft.Web.Media.SmoothStreaming Namespace