Is that possible to create a filter driver that would sit on top of existing USB web cam driver with the sole purpose to detect the beginning and end of video stream?
It is needed to pop-up an application on video stream start and hide it on video stream end. The problem is that the popping application should not (and cannot) touch the filter graph created by some other application for video capturing
Thanks,
Pavel
xxxxx@ukrpost.net wrote:
Is that possible to create a filter driver that would sit on top of existing USB web cam driver with the sole purpose to detect the beginning and end of video stream?
It is needed to pop-up an application on video stream start and hide it on video stream end. The problem is that the popping application should not (and cannot) touch the filter graph created by some other application for video capturing
Do you own the web cam driver? You can use a KS proxy to do this. The
KS proxy gets loaded every time your driver is added to a filter graph,
and it is given a handle to the graph, so you could ask to participate
in stream events. All you’d have to do is add another property set to
the driver and some registry entries.
You could also write an upper filter to watch for the streaming ioctls.
But when you do, how do you plan to pop up an application? Drivers
can’t start applications.
Also, I’m suspicious of your intent. What will this pop-up application
be doing? The world certainly does not need another mechanism for
forcing advertisements in front of my face. I can just see it; every
time I start a capture, you say “Thank you for starting a capture
session with your LogicalTech 49T web cam! By clicking OK to close this
dialog, we will be happy to show you targeted advertisement of other
fascinating USB technologies.”
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Tim,
Thanks for your answer.
There is a web cam and an application that goes with it. The end user has an option to install that application. Our product manager thinks that would be a greate idea if the end user had an option when the application is running to automatically pop-up the camera property page when video streaming starts, so the end user can control all available features.
The driver for the web cam is written by a subcontractor. And now our PM has to decide what would be cheaper - to ask the subcontractor (who can be very busy with some other stuff) to change the driver or KS proxy or write a filter driver that does the thing and can be polled with IOCTL.
So, I think the idea of the filter driver is much more preferrable option so far.
Pavel.
Pavel Anatolyev wrote:
Our product manager thinks that would be a greate idea if the end
user had an option when the application is running to automatically
pop-up the camera property page when video streaming starts, so
the end user can control all available features.
I would absolutely, positively hate that. And I bet, so would Tim 
xxxxx@ukrpost.net wrote:
There is a web cam and an application that goes with it. The end user has an option to install that application. Our product manager thinks that would be a greate idea if the end user had an option when the application is running to automatically pop-up the camera property page when video streaming starts, so the end user can control all available features.
No, this is an absolutely terrible idea. There is a way these things
are supposed to work. If the application wants the user to adjust the
features, then the application will bring up the property page. It’s
not up to you to override the application. The application has to be in
control.
In order for this to work, you would have to invoke the property page in
the context of the application, using the application’s handle. That’s
the only way for you to send property requests down to the open driver
handle. There is *no way* for you to force the application to do that.
The driver for the web cam is written by a subcontractor. And now our PM has to decide what would be cheaper - to ask the subcontractor (who can be very busy with some other stuff) to change the driver or KS proxy or write a filter driver that does the thing and can be polled with IOCTL.
So, I think the idea of the filter driver is much more preferrable option so far.
You should abandon this idea. Cameras do not work this way, and for
very good reasons. Make your driver adhere to the programming and user
interface standards, and your customers will be happier in the long run.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Tim,
I think there is a misunderstanding here. The application is ours. And the pop-up will be in the context of the application. But now the application has no way to know that our driver (written for us by our subcontractor) started streaming video. Changing the driver is the last possible option. Writing our filter driver for our driver seems to be a good idea.
Pavel.
Isn’t this application in control of the whole graph?
Driver packages showing popup UI are just plain nasty.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> Tim,
>
> I think there is a misunderstanding here. The application is ours. And the
pop-up will be in the context of the application. But now the application has
no way to know that our driver (written for us by our subcontractor) started
streaming video. Changing the driver is the last possible option. Writing our
filter driver for our driver seems to be a good idea.
>
> Pavel.
>
Maxim,
No, our product manager thinks that if the end user had an option of automatically showing our web camera property page when some other application starts using it then that would be a big plus.
I would not sign under his statement, but he is very stubborn, and I cannot do much do persuade him. Our driver cannot be changed (the subcontractor has not provided the sources, I do not know why). So, the only option left is to find some other way to imlement this feature.
I was not able to find any legal way to implement this feature in user mode, so I am more and more inclined towards using kernel mode filter driver
Pavel.
xxxxx@ukrpost.net wrote:
No, our product manager thinks that if the end user had an option of automatically showing our web camera property page when some other application starts using it then that would be a big plus.
I would not sign under his statement, but he is very stubborn, and I cannot do much do persuade him.
That’s not the way things are done. Your users will be very annoyed. I
would think that would be enough to convince any product manager who
hoped to keep his job for very long.
Our driver cannot be changed (the subcontractor has not provided the sources, I do not know why). So, the only option left is to find some other way to imlement this feature.
I was not able to find any legal way to implement this feature in user mode, so I am more and more inclined towards using kernel mode filter driver
This still doesn’t address the fundamental issue. How do you think this
will work? A kernel driver cannot display UI. It can’t pop up a
window, and it can’t force another application to pop up a window. In
order to display a property page, an application has to call a method in
a COM interface fetched from the capture driver’s proxy filter. That
proxy filter lives in the application. You, as a WDM filter driver,
cannot touch it.
This is not just a bad idea, it is a VERY bad idea.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Tim,
The idea was to run a helper application in the background, probably a service, (if the end user wishes so) that would communicate with the filter driver through IOCTLs from time to time. If the filter driver detects the stream and responses to the IOCTL correspondingly and if the end user chooses the option to automatically show the camera property page on stream start then this helper application can “call a method in a COM interface fetched from the capture driver’s proxy filter” to show the property page
I am absolutely not wild about this idea, but I have to do what I am told to…
If there’s any other idea of doing the task (other than “do not do it”), please tell me, I am open to any suggestions
Thanks,
Pavel
> I would not sign under his statement, but he is very stubborn, and I cannot
do
much do persuade him. Our driver cannot be changed (the subcontractor has
not provided the sources, I do not know why).
Just plain funny.
am more and more inclined towards using kernel mode filter driver
Is this an AVStream camera driver?
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
> The idea was to run a helper application in the background, probably a
service,
(if the end user wishes so) that would communicate with the filter driver
through
IOCTLs from time to time. If the filter driver detects the stream and
responses to
the IOCTL correspondingly and if the end user chooses the option to
Yes, something like this. Tell your PM that this stupid feature will cost 2
months of work. Probably this will convince him.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
xxxxx@ukrpost.net wrote:
The idea was to run a helper application in the background, probably a service, (if the end user wishes so) that would communicate with the filter driver through IOCTLs from time to time. If the filter driver detects the stream and responses to the IOCTL correspondingly and if the end user chooses the option to automatically show the camera property page on stream start then this helper application can “call a method in a COM interface fetched from the capture driver’s proxy filter” to show the property page
But the proxy filter you need lives in a graph that is running in a
*different process*. The property page has to communicate through THAT
filter, so that it connects to the correct driver instance.
Do you see the issue? Yes, you can use a filter driver to find out when
the stream changes from idle to pause or run. Yes, you can have a
background application that gets notified when that happens. But then
what? You can’t force another application to open a property page. And
if you instantiate the filter and open the property page in the
background application, you will be talking to a different instance of
the driver.
And let’s say, for a moment, that you could do it. What if the
application has its own fancy brightness and contrast controls on the
edge of its window? If you bring up a separate property page without
the knowledge of the application, then the application’s snapshot of the
camera state is incorrect, and it has no way to know that.
I am absolutely not wild about this idea, but I have to do what I am told to…
We’ve heard that before. You are not a robot. A conscientious employee
will inform his management when one of their ideas is not reasonable.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
OK, thanks for the info and comments
To summarize - writing a filter driver in this situation is possible but absolutely unreasonable and will take a lot of effort
Thanks again,
Pavel