xxxxx@barco.com wrote:
Thanks, Tim !
> There are some counterintuitive tradeoffs to be made here. A purely kernel mode transform filter only makes sense if both sides of the filter will also be kernel filters.
In our case, the filter only has one input pin = RGB24 video. The output is a network interface ( video stream ).
This filter controls the internal hardware of our FPGA to control the network stream, so this is (obviously?) a kernel mode filter.
No, it’s not obvious at all. There needs to be a kernel component, but
that component does not necessarily have to be an AVStream filter.
In the real world, people do not build graphs that are 100% Kernel
Streaming components. (It is possible to do so, and there are
frameworks that do this in the audio world, but not for video.) To
three decimal places, 100% of the video capture applications in the
world are DirectShow graphs or Media Foundation topologies.
In both cases, that means that the entire graph actually consists of a
user mode components. When you have an AVStream capture device, the
user mode component will be a wrapper like ksproxy, but the actual graph
participant is a user mode filter.
IF you happen to stumble upon a case where two consecutive filters are
both AVStream, the graph will connect them at the kernel level, and the
data will not pass into user mode. However, that almost never happens.
When you have a kernel node followed by a user-mode node, the data has
to percolate back up to user mode.
So, think about where your RGB24 video is coming from. Unless you are
always coming from a video capture device that natively generates
uncompressed RGB24, your upstream filter will always be in user mode.
That means the buffer communication is going to happen in user mode, and
you are at the mercy of ksproxy’s rules for buffer allocation, which do
not seem to meet your needs.
The very practical alternative is to write the wrapper yourself.
Instead of relying on ksproxy to load and talk to your driver, just
write a DirectShow in-place transform filter that loads your driver
(after removing the AVStream stuff). Now you can implement your
allocator using the DirectShow mechanisms. You have full control.
2/ Provide a custom interface (annex property page) on the filter that exposes the underlaying FPGA memory buffer directly (both as physical address / scatter-gather list for DMA and virtual address for simple memcpy access). This information can be retrieved to user mode and passed to another driver that controls e.g. the GPU DMA. The GPU that composes an image can then DMA images directly into the FPGA memory buffer.
How does a GPU get involved in this? DXVA?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.