Compartir a través de


WMS Multicast Data Writer Plug-in Properties

Note

   This plug-in is available only on Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008 Enterprise; and Windows Server Datacenter. For administration information about this plug-in, see Windows Media Services Help.

The WMS Multicast Data Writer plug-in enables a Windows Media server to deliver content over a multicast-enabled network. This means that your network equipment such as routers, switches and hubs, must be multicast-enabled. Multicast streaming is a one-to-many relationship between a Windows Media server and the clients receiving the stream. With a multicast stream, the server streams to an IP address on the network. Clients receive the stream by accessing the IP address. All clients receive the same stream. Using a multicast stream preserves network bandwidth and can be useful for low bandwidth local area networks. Multicasting requires less bandwidth than unicasting because there is only one stream from the server regardless of the number of clients receiving the stream.

You can deliver content as a multicast stream only from a broadcast publishing point. If the publishing point is not streaming content, the server can send multicast beacons that enable clients to remain connected. For more information, see IWMSBroadcastPublishingPoint.StartWithoutDataIWMSBroadcastPublishingPoint.StartWithoutData (Visual Basic .NET). Your network routers must be multicast-enabled, but if they are not, you can still deliver content as a multicast stream over the local segment of your local area network.

You can use the IWMSAdminMulticastSink interface to configure the plug-in. This interface exposes the following properties.

Property

Description

DataProtocol

Specifies and retrieves the data protocol for the multicast.

DestinationMulticastIPAddress

Specifies and retrieves the IP address to which the multicast broadcast is sent

DestinationMulticastPort

Specifies and retrieves the port number to which the multicast broadcast is sent.

LocalIPAddress

Specifies and retrieves the local IP address from which the multicast broadcast is sent.

LoggingURL

Specifies and retrieves the URL used to log messages during a multicast.

MulticastTtl

Specifies and retrieves the maximum number of intermediate router hops permitted for the multicast transmission.

UnicastRolloverURL

Specifies and retrieves the unicast URL used to redirect clients when a multicast session request fails.

UnicastRolloverURLOptions

Specifies and retrieves an enumeration value indicating whether the unicast rollover URL is a default or custom type.

The following examples illustrate how to use the IWMSAdminMulticastSink interface to specify properties for the plug-in.

Visual Basic .NET Example

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

Private Sub SetMulticastPluginProps() 

' Declare variables.
Dim Server As WMSServer
Dim Plugin As IWMSPlugin
Dim AdminMulticastSink As IWMSAdminMulticastSink
Dim BCPubPoint As IWMSBroadcastPublishingPoint

Try
    ' Create a new WMSServer object.
    Server = New WMSServer()

    ' Retrieve an existing broadcast publishing point.
    BCPubPoint = Server.PublishingPoints("Sample_Broadcast")

    ' Retrieve the WMS Multicast Data Writer plug-in.
    Plugin = BCPubPoint.BroadcastDataSinks("WMS Multicast Data Writer")

    ' Retrieve the administration interface for the plug-in.
    AdminMulticastSink = Plugin.CustomInterface

    ' Set the IP address to which the multicast
    ' broadcast will be sent.
    AdminMulticastSink.DestinationMulticastIPAddress = "224.2.150.127"

    ' Set the maximum number of intermediate
    ' router hops permitted for the multicast broadcast.
    AdminMulticastSink.MulticastTTL = 64
Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle exceptions here.
Finally
    ' TODO: Perform clean-up here.
End Try
End Sub 

C# Example

using Microsoft.WindowsMediaServices.Interop; 
using System.Runtime.InteropServices;

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSAdminMulticastSink AdminMulticastSink;
IWMSBroadcastPublishingPoint BCPubPoint; 

try
{
    // Create a new WMSServer object.
    Server = new WMSServerClass();
    
    // Retrieve an existing broadcast publishing point.
    BCPubPoint = (IWMSBroadcastPublishingPoint)Server.PublishingPoints["Sample_Broadcast"];
    
    // Retrieve the WMS Multicast Data Writer plug-in.
    Plugin = BCPubPoint.BroadcastDataSinks["WMS Multicast Data Writer"];
    
    // Retrieve the administrative interface for the plug-in.
    AdminMulticastSink = (IWMSAdminMulticastSink)Plugin.CustomInterface;
    
    // Set the IP address to which the multicast
    // broadcast will be sent.
    AdminMulticastSink.DestinationMulticastIPAddress = "224.2.150.127";
    
    // Set the maximum number of intermediate
    // router hops permitted for the multicast broadcast.
    AdminMulticastSink.MulticastTTL = 64;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception exc)
{
    // TODO: Handle exceptions here.
}
finally
{
    // TODO: Perform clean-up here.
}

C++ Example

#include <windows.h>
#include <atlbase.h>

// To access system plug-in interfaces, the
// type library must be imported as shown.
#import "WMSServerTypeLib.dll" no_namespace named_guids \
                               raw_interfaces_only

// Declare variables and interface pointers.
IWMSServer*                    pServer = NULL;
IWMSPlugins*                   pPlugins = NULL;
IWMSPlugin*                    pPlugin = NULL;
IDispatch*                     pDispatch = NULL;
IWMSAdminMulticastSink*        pAdminMulticastSink = NULL;
IWMSBroadcastPublishingPoint*  pBCPubPoint = NULL;
IWMSPublishingPoints*          pPubPoints = NULL;
IWMSPublishingPoint*           pPubPoint = NULL;
CComVariant                    varIndex;
CComBSTR                       bstrValue;
HRESULT                        hr = S_OK;

// 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.
hr = pServer->get_PublishingPoints(&pPubPoints);
if (FAILED(hr)) goto EXIT;

// Retrieve an existing broadcast publishing point.
varIndex = "Sample_Broadcast";
hr = pPubPoints->get_Item(varIndex, &pPubPoint);
if (FAILED(hr)) goto EXIT;

// Query the IWMSBroadcastPublishingPoint interface from
// the newly created publishing point.
hr = pPubPoint->QueryInterface(IID_IWMSBroadcastPublishingPoint,
                              (void **)&pBCPubPoint);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to an IWMSPlugins interface
// containing a broadcast data sink plug-in collection.
hr = pBCPubPoint->get_BroadcastDataSinks(&pPlugins);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPlugin interface
// of the plug-in to be configured.
varIndex = "WMS Multicast Data Writer";
hr = pPlugins->get_Item(varIndex, &pPlugin);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the custom interface
// of the plug-in.
hr = pPlugin->get_CustomInterface(&pDispatch);
if (FAILED(hr)) goto EXIT;

// Query the specific administration interface
// for the plug-in.
hr = pDispatch->QueryInterface(IID_IWMSAdminMulticastSink,
                              (void **)&pAdminMulticastSink);
if (FAILED(hr)) goto EXIT;

// Set the IP address to which the multicast
// broadcast will be sent.
bstrValue = "224.2.150.127";
hr = pAdminMulticastSink->put_DestinationMulticastIPAddress(bstrValue);
if (FAILED(hr)) goto EXIT;

// Set the maximum number of intermediate
// router hops permitted for the multicast broadcast.hr = pAdminMulticastSink->put_MulticastTTL(64);
if (FAILED(hr)) goto EXIT;

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

See Also

Reference

IWMSAdminMulticastSink Interface

IWMSAdminMulticastSink Object (C#)

IWMSAdminMulticastSink Object (Visual Basic .NET)

Concepts

Programming System Plug-in Properties