IWMSBroadcastPublishingPoint.AnnouncementStreamFormats (Visual Basic .NET)

banner art

Previous Next

IWMSBroadcastPublishingPoint.AnnouncementStreamFormats (Visual Basic .NET)

The AnnouncementStreamFormats property retrieves an IWMSAnnouncementStreamFormats object containing a collection of names of media files whose formats are used in a multicast broadcast.

  • Note   This method is available only on Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008 Enterprise; and Windows Server 2008 Datacenter.

Syntax

  IWMSAnnouncementStreamFormats = IWMSBroadcastPublishingPoint.AnnouncementStreamFormats

Property Value

An IWMSAnnouncementStreamFormats object.

If this property fails, it returns an error number.

Number Description
0xC00D1459L This feature is not supported on this operating system.
0xC00D145AL The publishing point has already been removed.

Remarks

The IWMSAnnouncementStreamFormats object contains a collection of names of media files whose formats are used in a multicast broadcast. A format consists of the codecs, frame size, bit rates, and so on, specified in the file header. One file per format must be specified. For example, if you are broadcasting two files that were created using one format and five files created by using another format, only two file names are added to the IWMSAnnouncementStreamFormats object, one to represent each format. When a file name is added to the collection, the associated file is parsed to extract the format information that a player must use to receive and render the content. The IWMSBroadcastPublishingPoint.Announce method adds the parsed information to the multicast configuration for the publishing point.

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetStreamCollection()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim BCPubPoint As IWMSBroadcastPublishingPoint
    Dim AnnounceStreamFormats As IWMSAnnouncementStreamFormats
    Dim strFile As String
    Dim i As Integer

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints

    ' Retrieve each publishing point and retrieve the
    ' IWMSBroadcastPublishingPoint object.
    For i = 0 To Server.PublishingPoints.Count – 1

        PubPoint = PubPoints.Item(i)
        If PubPoint.Type = WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST Then
            BCPubPoint = PubPoint
            Exit For
        End If

    Next i

    ' Retrieve the IWMSAnnouncementStreamFormats object.
    AnnounceStreamFormats = BCPubPoint.AnnouncementStreamFormats

    ' Add a file to the IWMSAnnoucementStreamFormats
    ' object for multicast broadcasting.
    strFile = "file://c:\wmpub\wmroot\welcome2.asf"
    AnnounceStreamFormats.Add(strFile)

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next