KS Frame Injection

The AVStream documentation talks about “frame injection” mode, in which
a source driver can inject frames into the standard frame pipeline
without having to involve an allocator and a process dispatch. For a
USB video device, this kind of processing makes a great deal of sense.
It means I don’t have to choose between a pin-centric Process dispatch
(which doesn’t exactly fit) and a filter-centric Process dispatch (which
doesn’t exactly fit).

However, Google shows almost no real-world experience with this. The
only newsgroup hit is a question similar to this one from 3 years ago,
which had no response.

So, does frame injection mode work? Is it supported by ksproxy? Will a
frame-injection-based filter play in a DirectShow graph?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim Roberts wrote:

The AVStream documentation talks about “frame injection” mode, in which
a source driver can inject frames into the standard frame pipeline
without having to involve an allocator and a process dispatch. For a
USB video device, this kind of processing makes a great deal of sense.
It means I don’t have to choose between a pin-centric Process dispatch
(which doesn’t exactly fit) and a filter-centric Process dispatch (which
doesn’t exactly fit).

However, Google shows almost no real-world experience with this. The
only newsgroup hit is a question similar to this one from 3 years ago,
which had no response.

So, does frame injection mode work? Is it supported by ksproxy? Will a
frame-injection-based filter play in a DirectShow graph?

Well, I’m coming to the conclusion that frame injection is just a
whiz-bang kernel streaming feature that either has never been tested, or
has no place in the “real world” in which KS filters are all just
players in a DirectShow graph. I have my capture filter connected
directly to a VMR filter, offering 720x480 UYVY. VMR is sending me a
format change (after the change to Start state) to 768x-480 UYVY, which
tells me that it is creating an overlay surface and expects me to render
directly into that surface. That doesn’t mate with frame injection.
I’m also getting an error 80070001 saying that the graph could not
change state, but I’m not failing any of the state changes.

It seems to me that a lot of AVStream is like this. The AVStream
documentation is written as though AVStream existed in a world by
itself, where KS filters communicate with nothing but other KS filters.
But that’s not how AVStream filters really get used. To three decimal
places, all AVStream filters get wrapped by ksproxy and shoved into a
DirectShow filter graph. The very few AVStream sample drivers there are
demonstrate only a tiny part of the AVStream API. For the rest, there
is no clue about how (or whether!) the AVStream features actually map
into useful DirectShow concepts.

So, I’m about to yank out the frame injection stuff and go back to
mucking with stream pointers and leading edges.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.