IWMSPublishingPoint2::put_AllowStartupProfile

The put_AllowStartupProfile method specifies a Boolean value that indicates whether the publishing point allows the use of Startup Profile.

Note

This method is available only on Windows Server 2003, Enterprise Edition with Service Pack 1; Windows Server 2003, Datacenter Edition with Service Pack 1; and Windows Server 2008.

HRESULT put_AllowStartupProfile(
  VARIANT_BOOL  newVal
);

Arguments

newVal

[in] VARIANT_BOOL that indicates whether the publishing point allows the use of Startup Profile.

Return Value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code

Description

S_OK

The method succeeded.

Remarks

The default value is VARIANT_FALSE.

Startup Profile, also called Advanced Fast Start, is the process by which the server and a client decide the minimum amount of buffering needed to prevent buffer underflow. Data is buffered at a higher rate than the encoded rate of the content by a multiplier value that the client determines. The server determines the buffering time. After an adequate amount of data has been buffered, the client begins playing the content.

Advanced Fast Start reduces latency more effectively than Fast Start because only the minimum amount of data is buffered initially.

For more information on Startup Profile and how to encode content to take advantage of it, see "Understanding Advanced Fast Start" in the Windows Media Services 9 Series Help documentation.

Example

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

// Declare variables and interfaces.
IWMSServer                    *pServer;
IWMSPublishingPoints          *pPubPoints;
IWMSPublishingPoint           *pPubPoint;
IWMSPublishingPoint2          *pPubPoint2;

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
// IWMSPublishingPoint2 interface. You can retrieve a pointer to this
// interface only when querying from a cache/proxy on-demand or 
// cache/proxy broadcast publishing point.
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_CACHE_PROXY_BROADCAST || 
        pptType == WMS_PUBLISHING_POINT_TYPE_CACHE_PROXY_ON_DEMAND)
    {
        hr = pPubPoint->QueryInterface(IID_IWMSPublishingPoint2,
                                      (void **)&pPubPoint2);
        if (FAILED(hr)) goto EXIT;

        // Set a Boolean value that indicates that Startup Profile
        // functionality is allowed when streaming content to clients.
        hr = pPubPoint2->put_AllowStartupProfile(VARIANT_TRUE);
        if (FAILED(hr)) goto EXIT;

        pPubPoint2->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, Enterprise Edition with Service Pack 1; Windows Server 2003, Datacenter Edition with Service Pack 1; Windows Server 2008.

See Also

Reference

IWMSPublishingPoint2 Interface