Getting Buffers

If your filter has a custom allocator that uses filter resources, the allocator's IMemAllocator::GetBuffer method should hold the streaming lock, as with other streaming methods:

HRESULT CMyInputAllocator::GetBuffer(
    IMediaSample **ppBuffer,
    REFERENCE_TIME *pStartTime, 
    DWORD dwFlags)
    CAutoLock cObjectLock(&m_csReceive);

    /* Use resources. */

    return CMemAllocator::GetBuffer(ppBuffer, pStartTime, pEndTime, dwFlags);    

Related topics

Threads and Critical Sections