IWMSBroadcastPublishingPoint::StartWithoutData

The StartWithoutData method initializes the publishing point and sends multicast beacons that enable clients to connect to a multicast when no content is being streamed.

HRESULT StartWithoutData();

Arguments

This method takes no parameters.

Return Value

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

Return code

Number

Description

E_ACCESSDENIED

0x8007000E

The account that the WMS service is running under does not have access rights to the content requested.

ERROR_FILE_NOT_FOUND

0x00000002

The server was not able to find the file that was referenced by the Path property of the publishing point.

ERROR_PATH_NOT_FOUND

0x00000003

The server was not able to find the path that was referenced by the Path property of the publishing point.

NS_E_CANNOTCONNECT

0xC00D0006L

The destination server that was indicated in the Path property exists, but the server was unable to establish a connection to the destination server.

NS_E_EMPTY_PLAYLIST

0xC00D14B5L

The playlist that the server is attempting to stream does not reference any media streams or files.

NS_E_FILE_NOT_FOUND

0xC00D001AL

The server was not able to find the file that was referenced by the Path property of the publishing point.

NS_E_INCOMPATIBLE_SERVER

0xC00D2EE8L

The server that the publishing point attempted to connect to does not support the requested action.

NS_E_PLAYLIST_PARSE_FAILURE

0xC00D14B6L

The playlist that the server is attempting to parse contains a syntax error.

NS_E_PLAYLIST_PLUGIN_NOT_FOUND

0xC00D157FL

The server was not able to find a playlist parser plug-in to access the playlist that was referenced by the Path property of the publishing point.

NS_E_PUBLISHING_POINT_REMOVED

0xC00D145AL

The publishing point has already been removed.

NS_E_SOURCE_PLUGIN_NOT_FOUND

0xC00D157EL

The server was not able to find a data source plug-in to access the data that was referenced by the Path property of the publishing point.

NS_E_WSX_INVALID_VERSION

0xC00D151EL

The version of the playlist that the server is attempting to stream is either not supported by the server or is not valid. Version information in a playlist is indicated by the <WSX> element.

Remarks

You can use this method to initialize the publishing point before starting it, thereby minimizing latency at the start of the broadcast. Multicast beacons are messages that are sent by the server that enable a client to remain connected to a multicast broadcast when the publishing point is not streaming content.

Example

#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;

        // Initialize the publishing point.
        hr = pBCPubPoint->StartWithoutData();
        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

Reference

IWMSBroadcastPublishingPoint Interface