Maarten Lankhorst wrote:
HRESULT Capture_Run(CaptureBox * capBox, FILTER_STATE *state) { HRESULT hr; IMediaSample *pSample = NULL; LPBYTE pointer; hr = OutputPin_GetDeliveryBuffer((OutputPin *)capBox->pOut, &pSample, NULL, NULL, 0); TRACE("Meat 1: %lx - %p\n", hr, pSample); hr = IMediaSample_GetPointer(pSample, &pointer); TRACE("Meat 2\n"); IMediaSample_SetActualDataLength(pSample, 320*240*3); TRACE("Meat 3\n"); ZeroMemory(pointer, 320*240*3); TRACE("Meat 4\n"); OutputPin_SendSample((OutputPin *)capBox->pOut, pSample); FIXME("%p -> (%p) stub\n", capBox, state); return S_OK; }
I get E_VFW_NOT_COMMITTED after trying GetDeliveryBuffer, what's the cause?
This error is due to a memory allocator needing to be committed before it can be used (see dlls/quartz/memallocator.c). You should call IMemAllocator_Commit in the Run implementation of your filter and then push one sample downstream. IIRC, you should also call IMemAllocator_Decommit in the Stop implementation of your filter, but this isn't done for the implementation I referred to (dlls/quartz/transform.c).
Rob