By default in AVStream, a requester acquires empty frames from an allocator and places them in a queue. The minidriver then fills frames either by pin-centric processing or filter-centric processing. The frames move across a transport to the next object in the circuit, eventually completing the circuit and returning to the requester. AVStream then reuses the frames.
Minidrivers can override this default behavior by using injection mode. In injection mode, the minidriver is responsible for placing frames into the circuit. Frames propagate around the circuit in the default manner. When the frames return to the AVStream object where they started, AVStream calls a minidriver-provided AVStrMiniFrameReturn routine.
In this routine, the minidriver could for instance deallocate the frame, complete work pending on the return of the frame, or refill and reinject the frame.
To set injection mode, the minidriver calls KsPinRegisterFrameReturnCallback and provides a pointer to its AVStrMiniFrameReturn routine.
Do not call KsPinRegisterFrameReturnCallback unless the filter is in the stop state.
The diagram below shows an AVStream filter set composed of a source filter, an inplace transform filter, and a rendering filter with the source injecting frames.