Compartilhar via


Getting Buffers

 
Microsoft DirectShow 9.0

Getting Buffers

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

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

    /* Use resources. */

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