IAMStats::GetValueByIndex method (control.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The GetValueByIndex method retrieves a statistic, by index.

Syntax

HRESULT GetValueByIndex(
  [in]  long   lIndex,
  [out] BSTR   *szName,
  [out] long   *lCount,
  [out] double *dLast,
  [out] double *dAverage,
  [out] double *dStdDev,
  [out] double *dMin,
  [out] double *dMax
);

Parameters

[in] lIndex

Zero-based index of the statistic.

[out] szName

Pointer to a variable that receives the name of the statistic.

[out] lCount

Pointer to a variable that receives the number of values that were recorded.

[out] dLast

Pointer to a variable that receives the most recent value that was recorded.

[out] dAverage

Pointer to a variable that receives the average value.

[out] dStdDev

Pointer to a variable that receives the standard deviation of the values. If the count is less than two, the standard deviation is zero.

[out] dMin

Pointer to a variable that receives the minimum value that was recorded.

[out] dMax

Pointer to a variable that receives the maximum value that was recorded.

Return value

Returns an HRESULT value. Possible values include the following.

Return code Description
S_OK
Success.
E_INVALIDARG
Index out of range.
E_OUTOFMEMORY
Insufficient memory.
E_POINTER
NULL pointer argument.

Remarks

The caller must free the string returned in szName, by calling the SysFreeString function.

To get the number of statistics, call IAMStats::GetIndex.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header control.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IAMStats Interface