ChunkInfo Class

Defines per-chunk information for text/binary chunks of Smooth Streaming data.

Inheritance Hierarchy

System.Object
  Microsoft.Web.Media.SmoothStreaming.ChunkInfo

Namespace:  Microsoft.Web.Media.SmoothStreaming
Assembly:  Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)

Syntax

'Declaration

Public Class ChunkInfo _
    Implements IComparable
'Usage

Dim instance As ChunkInfo
public class ChunkInfo : IComparable
public ref class ChunkInfo : IComparable
type ChunkInfo =  
    class
        interface IComparable
    end
public class ChunkInfo implements IComparable

The ChunkInfo type exposes the following members.

Properties

  Name Description
Public propertySupported by Windows Phone Attributes Gets or sets Attributes.
Public propertySupported by Windows Phone Duration Time duration that corresponds the to the <d> element in the manifest for the chunk.
Public propertySupported by Windows Phone Stream Gets the StreamInfo object.
Public propertySupported by Windows Phone TimeStamp Gets or sets the start time for the data chunk.

Top

Methods

  Name Description
Public methodSupported by Windows Phone CompareTo Compares a chunk to another object.
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 ToString (Inherited from Object.)

Top

Examples

The following example shows how to get the ChunkInfo objects in a StreamInfo object and how to call the asynchronous method BeginGetChunk(TimeSpan, AsyncCallback, Object). For more information, see Timeline Markers and Events.

    foreach (TrackInfo trackInfo in streamInfo.SelectedTracks)
    {
        foreach (ChunkInfo chunk in streamInfo.ChunkList.ToList<ChunkInfo>())
        {
            IAsyncResult ar =
                trackInfo.BeginGetChunk(
                chunk.TimeStamp, new AsyncCallback(AddMarkers), streamInfo.UniqueId);
        }
    }

The following example shows the call to the EndGetChunk(IAsyncResult) method. For more information on this asynchronous scenario, see Timeline Markers and Events.

    foreach (TrackInfo trackInfo in streamInfo.SelectedTracks)
    {
        ChunkResult chunkResult = trackInfo.EndGetChunk(argAR);

        if (chunkResult.Result == ChunkResult.ChunkResultState.Succeeded)
        {
            System.Text.Encoding enc = System.Text.Encoding.UTF8;
            int length = (int)chunkResult.ChunkData.Length;
            byte[] rawData = new byte[length];
            chunkResult.ChunkData.Read(rawData, 0, length);
            String text = enc.GetString(rawData, 0, rawData.Length);
            TimelineMarker newMarker = new TimelineMarker();
            newMarker.Text = text;
            newMarker.Time = chunkResult.Timestamp;

            SmoothPlayer.Markers.Add(newMarker);
        }
    }

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