Condividi tramite


IAMAudioRendererStats::GetStatParam

 
Microsoft DirectShow 9.0

IAMAudioRendererStats::GetStatParam

The GetStatParam method retrieves performance information from the audio renderer.

Syntax

  HRESULT GetStatParam(
    DWORD dwParam,
    DWORD *pdwParam1,
    DWORD *pdwParam2
);

Parameters

dwParam

[in] Specifies a member of the _AM_AUDIO_RENDERER_STAT_PARAM enumeration, indicating which information to retrieve.

pdwParam1

[out] Pointer to a variable that receives performance information. The meaning of the returned value depends on the value of dwParam.

pdwParam2

[out] Pointer to a variable that receives performance information. The meaning of the returned value depends on the value of dwParam.

Return Values

Returns an HRESULT value. Possible values include the following.

Value Description
E_FAIL Failure.
E_INVALIDARG Invalid argument.
E_NOTIMPL The renderer does not track the specified information.
E_POINTER NULL pointer argument.
S_OK Success.

Example Code

The following example retrieves the number of breaks in the audio stream:

IBaseFilter *pAudioRenderer;
// Assume pAudioRenderer is a valid pointer to an audio renderer filter.
IAMAudioRendererStats *pStats = 0;
HRESULT hr = pAudioRenderer->QueryInterface(IID_IAMAudioRendererStats, 
    (void**)&pStats);
if (SUCCEEDED(hr))
{
    DWORD dwBreakCount = 0, dwNotUsed = 0;
    hr = pStats->GetStatParam(AM_AUDREND_STAT_PARAM_BREAK_COUNT,
        &dwBreakCount, &dwNotUsed);
    if (SUCCEEDED(hr))
    {
        // dwBreakCount contains the cumulative number of audio breaks.
    }
    pStats->Release();
}

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also