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
Robert Shearman wrote:
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
I added this line: hr = OutputPin_CommitAllocator((OutputPin *)capBox->pOut);
I get this error: =>1 0x7b50326f StdMemAllocator_Alloc(iface=0x7d29bc80) [/usr/src/bld/wine-cur/dlls/quartz/memallocator.c:792] in quartz (0x77a9dee8) 2 0x7b501e56 BaseMemAllocator_Commit+0x186(iface=0x7d29bc80) [/usr/src/bld/wine-cur/dlls/quartz/memallocator.c:258] in quartz (0x77a9df18) 3 0x7b5073ca OutputPin_CommitAllocator+0xca(This=0x7d29b928) [/usr/src/bld/wine-cur/dlls/quartz/pin.c:937] in quartz (0x77a9df44) ... Unhandled exception: divide by zero in 32-bit code (0x7b50326f). trace:quartz:BaseMemAllocator_Commit using alloc at 0x7b503230
The offending line: if ((si.dwPageSize % This->base.pProps->cbAlign) != 0)