Hi,
I have a requirement to support multiple filters that can be connected from different applications and grab the same video (the same sensor).
please don’t ask why, and what that good for.
In the first step I extended the AVSHWS example to support two filters. each filter creates its Pin. One of them (first Pin) is chosen to be the "Real?- it?s connected to the sensor and gets DMA.
All other Pin (could be connected to different process) is ?dummy? ? gets frames from the first one by copy operation in DPC time of the ?Real? Pin. The ?dummy? pin has not any ISR, but only ?real? pin has.
please ignore all possible sync and PNP problems.
Since the filters are ?separate instances? of the driver, I use the linked list of ready frames pointers (comes from pin->Proccess()) in the Device class that is global for them.
In the DPC routine (of “real” pin) I copy the frame from the Real Pin frame to the dummy pin frame pointer. In such way the same frame is shown separately in two separate renderers.
Result:
When I create two filters and render two same frames in the same GraphEdit , I have no problem.
When I open two separate GraphEdits and create filter in each graph , I face strange situation:
The first pin is working properly , the second Pin > CCapturePin::Process () isn?t.
The frame pointer : Leading->StreamHeader->Data , ClonePointer->StreamHeader->Data address isn’t valid. I remind that it is received by KsPinGetLeadingEdgeStreamPointer , KsStreamPointerAdvance. The pointer itself is valid (it is not NULL) but when I try copy to this address I get BSOD. I gess the pointer points to address that isn’t allocated by KSProxy.
The interesting & strange thing is that this bad address appearance isn?t permanent. Sometimes the address is OK and copy operation success and sometimes it is bad.
I remind that this behaivior happen only when I use two separate graphs (each filer in separate procces).
I will thank you a lot if you have any idea.