Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CTransInPlaceFilter::CheckInputType - upstream or downstream?

10 views
Skip to first unread message

Doctor Bonzo

unread,
Nov 25, 2009, 2:43:05 PM11/25/09
to
I have an application derived from the Amcap video capture sample with a
transform-in-place filter that modifies the image. This works fine with
webcams with a video resolution of 640 x 480 or so. With a HD video capture
card, specifically a BlackMagic Intensity Pro, I get CheckInputType calls
with video resolution of 1920 x 1080, which I expect. Once the graph has
been built and begun to preview, though, I get calls, presumably from the
renderer, with a smaller resolution matching the size of the window that then
gets displayed.

Following the Amcap sample, my filter gets its idea of the resolution of the
sample that it will see in Transform(.) from calls to CheckInputType and the
VIDEOINFOHEADER that is part of the CMediaType. Since the last input type it
checks has the wrong resolution, it was getting confused and I've had to make
an ugly kludge hack-around.

So these are my questions: Is there a way to know within CheckInputType
whether the call is coming from upstream or downstream? Or is there maybe
some other, more reliable, way to determine the dimensions of the sample
presented to Transform(.)? And a bonus question - why might anything
downstream of my filter call CheckInputType after the graph has started
running?

Thanks for any help . ..

Tom Handal

unread,
Nov 25, 2009, 9:07:00 PM11/25/09
to
On Nov 25, 11:43 am, Doctor Bonzo

Hi Doctor Bonzo,

This is the best example of a transform filter I have seen:
http://read.pudn.com/downloads40/sourcecode/windows/directx/138748/YUVGray/YuvGray.cpp__.htm

You may want to take a look at it. It handles dynamic resolution/
stride changes from the renderer. It may also help you with what you
are trying to do by using it as an example.

Hope this helps...

Tom

Doctor Bonzo

unread,
Nov 30, 2009, 8:54:01 AM11/30/09
to

"Tom Handal" wrote:

> http://read.pudn.com/downloads40/sourcecode/windows/directx/138748/YUVGray/YuvGray.cpp__.htm

This is indeed a good example - much better than what I was using which was
apparently from some preliminary DirectShow dox. Thanks for the pointer.

Doctor Bonzo

unread,
Nov 30, 2009, 9:45:01 AM11/30/09
to

Just to conclude - from the tutorial I was following, I had thought that the
place to get the image dimensions for my transform-in-place was
CheckInputType. This worked until I ran into the case that a downstream
filter wanted a smaller size. The more proper place to collect dimensions is
in SetInputType which also includes an argument indicating the direction of
connection.

0 new messages