IWMReaderAdvanced::GetStatistics method

The GetStatistics method retrieves the current reader statistics.

Syntax


HRESULT GetStatistics(
  [in, out] WM_READER_STATISTICS *pStatistics
);

Parameters

pStatistics [in, out]

Pointer to a WM_READER_STATISTICS structure.

Return value

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

Return codeDescription
S_OK

The method succeeded.

E_INVALIDARG

pStatistics is NULL, or the cbSize member of pStatistics is not set to the size of WM_READER_STATISTICS.

E_OUTOFMEMORY

The method is unable to allocate memory for an internal object.

NS_E_INVALID_REQUEST

The reader object has not opened a file yet.

 

Remarks

The WM_READER_STATISTICS structure must be supplied by the application. The cbSize data member must be set before the structure is passed to the method. The rest of the members will be set by this method.

As with any method, too many calls can affect performance. The actual performance impact is machine-dependent. Using the GetStatistics method for each sample is not recommended. The Microsoft Windows Media Encoder pulls the data once per second, which results in a manageable amount of data being passed.

The GetStatistics method is not recommended for a callback method like IWMReaderCallback::OnSample. In general, such calls have the potential to lead to deadlocks.

To determine the connection bandwidth before receiving a sample, the IWMReaderNetworkConfig::GetConnectionBandwidth method is the recommended method. The GetStatistics method has more overhead.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Version

Windows Media Format 7 SDK, or later versions of the SDK

Header

Wmsdkidl.h (include Wmsdk.h)

Library

Wmvcore.lib;
WMStubDRM.lib (if you use DRM)

See also

IWMReaderAdvanced Interface

 

 

Show: