Hi,
I have a filter driver for a webcam and I need to do some processing on the
video stream before sending it to the user app. The problem that I am facing
is that the camera supports multiple video formats (both multiple
resolutions and video encoding: RGB and YUV).
In the DDK documentation (the "KS Data Formats and Data Ranges" article) it
is said that the properties KSPROPERTY_PIN_DATARANGES,
KSPROPERTY_PIN_CONSTRAINEDDATARANGES, KSPROPERTY_PIN_PROPOSEDATAFORMAT and
KSPROPERTY_PIN_DATAINTERSECTION are used to querry the data format of the
pin, and KSPROPERTY_CONNECTION_DATAFORMAT to set the data format (or some
property of KSPROPERTY_Connection)

I have looked through all the property IOCTLs that my filter receives and I
did not find any KSPROPERTY_CONNECTION_DATAFORMAT ; the only IOCTLs from
this class that pass through my driver are KSPROPERTY_CONNECTION_STATE and
KSPROPERTY_CONNECTION_ALLOCATORFRAMING.

Does anyone know how is the stream format set at this level (basic IOCTLs
parsing), or at least a point where to look from? This should be closely
related to the way AVStream or USBCAMD uses to set the format.


BTW, as far as I could guess, it seems that the current format is the one
negociated by the last KSPROPERTY_PIN_DATAINTERSECTION, but i did not find
any information that it also sets the format, not only querry for a
supported one. Can anyone confirm this?
Also, I believe that the function driver below me I believe is a USBCAMD 2.0
minidriver.

Thanks,
Bogdan.

Re: how to get the video stream format (filter driver) by Tim

Tim
Mon May 15 00:05:27 CDT 2006

"Bogdan Dinu" <bdinu@ubisoft.ro> wrote:
>
>I have a filter driver for a webcam and I need to do some processing on the
>video stream before sending it to the user app.

That is not supported. Why don't you write a user-mode filter and let it
do the reprocessing?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: how to get the video stream format (filter driver) by Bogdan

Bogdan
Mon May 22 03:44:09 CDT 2006

Hi,
Sorry for the late response, I was out of the office for a while.

The project that I'm working on needs to do the image processing so that it
will be available in ANY application using the camera. The user mode filter
needs to be included in the DirectShow graph, which I do not have access to
(all I have is the function driver below me and any application that can
connect to it. I need to get in between those). A filter driver seems to be
the best idea (and maybe the only one. GFX filters are the only other
alternative that I know about, but I did not do so much research here, and
all the samples I've found are related to sound processing.)

Anyway, I believe I've found the format for the streaming. It seems that it
is passed with IRP_MJ_CREATE, in a KSDATARANGE structure, starting from
((UCHAR*)(stack->FileObject->FileName.Buffer)) + (39*sizeof(WCHAR))

But unfortunately the documentation is poor, and I do not know what will
happen on Vista.


"Tim Roberts" <timr@probo.com> wrote in message
news:uu2g62t5l7vdu96dtrqgeheipmuv5a5e5m@4ax.com...
> "Bogdan Dinu" <bdinu@ubisoft.ro> wrote:
>>
>>I have a filter driver for a webcam and I need to do some processing on
>>the
>>video stream before sending it to the user app.
>
> That is not supported. Why don't you write a user-mode filter and let it
> do the reprocessing?
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.



Re: how to get the video stream format (filter driver) by Max

Max
Sun May 21 18:08:33 CDT 2006

The documentation is not poor. On the opposite AVStream docs are quite good.
The thing is that what you are trying to do is totally unsupported and thus
undocumented.
You are stretching the universe and that's why you are on your own. What you
do is dangerous and subject to breaking.

We've done something like this in the past just to find out that we never be
able to ship what we created. Too risky.
-- Max.



"Bogdan Dinu" <bdinu@ubisoft.ro> wrote in message
news:OpRZovXfGHA.4776@TK2MSFTNGP05.phx.gbl...
> Hi,
> Sorry for the late response, I was out of the office for a while.
>
> The project that I'm working on needs to do the image processing so that
> it will be available in ANY application using the camera. The user mode
> filter needs to be included in the DirectShow graph, which I do not have
> access to (all I have is the function driver below me and any application
> that can connect to it. I need to get in between those). A filter driver
> seems to be the best idea (and maybe the only one. GFX filters are the
> only other alternative that I know about, but I did not do so much
> research here, and all the samples I've found are related to sound
> processing.)
>
> Anyway, I believe I've found the format for the streaming. It seems that
> it is passed with IRP_MJ_CREATE, in a KSDATARANGE structure, starting from
> ((UCHAR*)(stack->FileObject->FileName.Buffer)) + (39*sizeof(WCHAR))
>
> But unfortunately the documentation is poor, and I do not know what will
> happen on Vista.
>
>
> "Tim Roberts" <timr@probo.com> wrote in message
> news:uu2g62t5l7vdu96dtrqgeheipmuv5a5e5m@4ax.com...
>> "Bogdan Dinu" <bdinu@ubisoft.ro> wrote:
>>>
>>>I have a filter driver for a webcam and I need to do some processing on
>>>the
>>>video stream before sending it to the user app.
>>
>> That is not supported. Why don't you write a user-mode filter and let it
>> do the reprocessing?
>> --
>> - Tim Roberts, timr@probo.com
>> Providenza & Boekelheide, Inc.
>
>



Re: how to get the video stream format (filter driver) by Maxim

Maxim
Mon May 22 15:16:24 CDT 2006

> The project that I'm working on needs to do the image processing so that it
> will be available in ANY application using the camera. The user mode filter
> needs to be included in the DirectShow graph, which I do not have access to

Why? Any COM class can be filtered in user mode, I think you understand how :-)

Note: not all cameras have the kernel-mode software, for instance, most
RTP/videoconferencing software have none. They will not be filtered by a kernel
mode filter.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com