IWMSDataContainer.GetTransferParameters (C#)

void IWMSDataContainer.GetTransferParameters(
  ulong qwDesiredOffset,
  uint dwDesiredMinSize,
  uint dwDesiredMaxSize,
  ref ulong pqwOffset,
  ref uint pdwSize,
  ref uint pdwBufferAlignment
);

Arguments

ulong containing the desired offset in bytes. This must be set to zero if the data source plug-in does not support seeking.

uint containing the desired minimum size, in bytes.

uint containing the desired maximum size, in bytes.

Reference to a ulong containing the optimal offset in bytes for the request. The server uses this value to determine the offset value that will be set for the Read or Write method. Data containers that do not support seeking must return WMS_DATA_CONTAINER_NONSEEKABLE. For example, a live source cannot be seekable, but a file can be.

Reference to a uint containing the optimal size in bytes. The server uses this value to determine the size of the buffer required for the Read or Write method.

Reference to a uint containing the optimal buffer alignment in bytes. The server uses this value to determine the size of the buffer address that will be set for the Read or Write method. For data source plug-ins that do not require buffer alignment, the return value must be NULL. This value must not exceed the page size of the server running Windows Media Services.

Return Value

This method does not return a value. To report an error, the plug-in can throw a COMException object to the server. If the plug-in uses the IWMSEventLogIWMSEventLog Object (C#) to log error information, it is recommended that it throw NS_E_PLUGIN_ERROR_REPORTED (0xC00D157D). Typically, the server attempts to make plug-in error information available to the server object model, the Windows Event Viewer, and the troubleshooting list in the details pane of the Windows Media Services MMC. However, if the plug-in uses the IWMSEventLog object to send custom error information to the Windows Event Viewer, throwing NS_E_PLUGIN_ERROR_REPORTED stops the server from also logging to the event viewer. For more information about plug-in error information, see Identifying Plug-in Errors.

Remarks

This method must be called before every call to Read or Write. The following table indicates the combinations that the server can set for the dwDesiredMinSize, dwDesiredMaxSize, and qwDesiredOffset parameters, and for the type of information that can be returned by the pqwOffset and pdwSize parameters.

dwDesiredMinSize

dwDesiredMaxSize

Description

Positive integer value

NULL

The server requires data starting at the position indicated by qwDesiredOffset and going forward as specified by dwDesiredMinSize. This specifies that the value returned for pdwSize should be close to but not less than the value specified by dwDesiredMinSize for performance reasons. The values returned for pqwOffset and pdwSize must contain the data boundaries specified by qwDesiredOffset and dwDesiredMinSize, and can contain data before or after these boundaries.

Positive integer value

Positive integer value

The server requires data starting at the position indicated by qwDesiredOffset and going forward as specified by dwDesiredMinSize. The value returned for pdwSize should not be greater than dwDesiredMaxSize. The value returned for pdwSize should be close to but not less than the value specified by dwDesiredMaxSize for performance reasons. The values returned for pqwOffset and pdwSize must contain the data boundaries specified by qwDesiredOffset and dwDesiredMinSize, and can contain data before or after these boundaries.

NULL

Positive integer value

The server requires data starting at the position indicated by qwDesiredOffset and going backward to the value specified by dwDesiredMaxSize. The value returned for pdwSize should be close to but not less than the value specified by dwDesiredMaxSize for performance reasons. The values returned for pqwOffset and pdwSize must contain the data boundaries specified by qwDesiredOffset and dwDesiredMaxSize, and can contain data before or after these boundaries.

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Concepts

IWMSDataContainer Object (C#)