Share via


IWMSBroadcastPublishingPoint::Announce

banner art

Previous Next

IWMSBroadcastPublishingPoint::Announce

The Announce method updates the publishing points multicast configuration with data formats that have been added to the IWMSAnnouncementStreamFormats interface.

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

Syntax

  HRESULT Announce();

Parameters

This method takes no parameters.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Description
NS_E_INVALID_OPERATING_SYSTEM_VERSION 0xC00D1459L This feature is not supported on this operating system.
NS_E_MULTICAST_PLUGIN_NOT_ENABLED 0xC00D1458L A multicast plug-in is not enabled on the publishing point.
NS_E_NO_FORMATS 0xC00D006BL The IWMSAnnouncementStreamFormats collection does not contain any stream format information.
NS_E_PUBLISHING_POINT_REMOVED 0xC00D145AL The publishing point has already been removed.
NS_E_TOO_MANY_MULTICAST_SINKS 0xC00D1456L More than one multicast plug-in is enabled on the publishing point. Only one multicast plug-in can be enabled per publishing point.

Remarks

The Announce method retrieves stream format data from the IWMSAnnouncementStreamFormats interface, and property data from an enabled multicast plug-in. Only one multicast plug-in can be enabled at a time. If no multicast plug-ins are enabled, the Announce method returns an error. If the file names in the IWMSAnnouncementStreamFormats collection reference media files that all use the same format, only one instance of the stream format information is used. After you have called the Announce method, you can call the IWMSBroadcastPublishingPoint::AnnounceToNSCFile method to create the file that is needed by the client to receive and render the broadcast. Call the Announce and the AnnounceToNSCFile methods whenever information that is included in the file is changed.

The Announce method is required for multicasting content from a broadcast publishing point, but it is not required for a unicast broadcast.

Example Code

#include <windows.h>
#include <atlbase.h>    // Includes CComVariant.
#include "wmsserver.h"

// Declare variables and interfaces.
IWMSServer                    *pServer;
IWMSPublishingPoints          *pPubPoints;
IWMSPublishingPoint           *pPubPoint;
IWMSBroadcastPublishingPoint  *pBCPubPoint;

HRESULT         hr;
CComVariant     varIndex;
long            lCount;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPublishingPoints
// interface and retrieve the number of publishing points.
hr = pServer->get_PublishingPoints(&pPubPoints);
if (FAILED(hr)) goto EXIT;
hr = pPubPoints->get_Count(&lCount);
if (FAILED(hr)) goto EXIT;

// Retrieve each publishing point and query the
// IWMSBroadcastPublishingPoint interface.
for (long x = 0; x < lCount; x++)
{
    varIndex = x;
    hr = pPubPoints->get_Item(varIndex, &pPubPoint);
    if (FAILED(hr)) goto EXIT;

    // Retrieve the type of publishing point.
    WMS_PUBLISHING_POINT_TYPE pptType;
    hr = pPubPoint->get_Type(&pptType);
    if (FAILED(hr)) goto EXIT;

    if (pptType == WMS_PUBLISHING_POINT_TYPE_BROADCAST)
    {
        hr = pPubPoint->QueryInterface(IID_IWMSBroadcastPublishingPoint,
                                      (void **)&pBCPubPoint);
        if (FAILED(hr)) goto EXIT;

        // Prepare the publishing point configuration for
        // announcement to clients.
        hr = pBCPubPoint->Announce();
        if (FAILED(hr)) goto EXIT;

        pBCPubPoint->Release();
    }

    // Release temporary COM objects.
    pPubPoint->Release();
}

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

Requirements

Header: wmsserver.h.

Library: WMSServerTypeLib.dll.

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

See Also

Previous Next