Поделиться через


Pausing

 
Microsoft DirectShow 9.0

Pausing

All filter state changes must hold the filter lock. In the Pause method, create any resources the filter needs:

HRESULT CMyFilter::Pause()
{
    CAutoLock lock_it(m_pLock);

    /* Create filter resources. */

    return CBaseFilter::Pause();
}

The CBaseFilter::Pause method sets the correct state on the filter (State_Paused) and calls the CBasePin::Active method on every connected pin in the filter. The Active method informs the pin that the filter has become active. If the pin creates resources, override the Active method, as follows:

HRESULT CMyInputPin::Active()
{
    // You do not need to hold the filter lock here. It is already held in Pause.

    /* Create pin resources. */

    return CBaseInputPin::Active()
}