On May 18, 2014, at 10:23 AM, xxxxx@barco.com wrote:
> Why? The graph is perfectly capable of allocating system memory on its own.
We have a proptietary library that makes a composition of several incoming streams.
This library / framework allocates ist own frame buffers, in which the capture filter is supposed to DMA its frames into. So, from a DirectShow point of view, it would be nice if the connected filter to our capture output pin = the compositor filter - would provide the frame buffer S/G lists for its frame buffer directly.
OK, wait a minute. You certainly cannot pass scatter/gather lists into the filter through any conceivable DirectShow interface. The allocator works with virtual addresses ONLY.
What you?re talking about, I think, is a bit tricky. If you?re doing horizontal concatenation, then that means you need your capture filter to be able to handle very large strides. That is, the hardware has to be able to skip over the parts of the scan lines that don?t belong to this stream. if there are three streams across, then stream one gets pixels 0 to 639, then it has to skip over 1280 pixels before it can write the next scan line. It turns out there is no way in a BITMAPINFOHEADER or a VIDEOINFOHEADER or a memory allocator to describe that situation.
Having said that, there is a precedent for what you are describing. When the Video Mixing Renderers are using an overlay surface or a texture surface, those surfaces often have rather unusual alignment requirements (like multiple of 256 bytes). If the VMR is directly connected to a capture filter, what it will do is configure the stream initially for the fully packed format (i.e., a 640x480 DIB). Then, as soon as streaming starts, it will send a change-of-format notice to the capture pin, changing the format to, for example, 768x480. The capture filter knows that it doesn?t really want a new format, it?s merely saying ?OK, I?m switching to the overlay surface now and the stride is 768 pixels?. The capture filter is required to accept this ? VMR doesn?t even check whether it failed.
So, you could either try to emulate what VMR does, or you could implement your own private communication scheme.
Do you expect to have several capture filters feeding into your compositor?
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.