USB Webcam Driver Developement
-
Sunday, April 15, 2012 7:12 PM
Hi,
I want to develop a driver for webcam that can uses smartphones as a webcam .
Now the thing is i have no idea and have never anything like this before.
What do you suggest as starting points and what kind of protocol, format, encoding etc. does a normal webcam use to transfer videos to the system?
Also I'm looking to create a full fledged driver instead of a directshow filter which only works with select applications(correct me if i'm wrong)
Thanks
All Replies
-
Monday, April 16, 2012 5:01 AMOwner
you want to use a directshow filter if you can, a driver will be more complicated and error prone. for a driver you would interface with avstream, see the two avstream samples in the wdk
avshws, http://code.msdn.microsoft.com/windowshardware/AVSHwS-AVStream-Simulated-7953991d
avstream filter, http://code.msdn.microsoft.com/windowshardware/AVStream-Filter-Centric-f5c5a235
as for the protocol, you can make it up yourself. if you have control over the smart phone's usb implementation, you can make it look like a standard webcam and then you have no drivers to write at all.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.
- Marked As Answer by Doron Holan [MSFT]Microsoft Community Contributor, Owner Monday, April 16, 2012 5:03 AM
-
Monday, April 16, 2012 5:03 AMOwneralso, see this thread, http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/b7597163-65b6-496e-9803-ba427e04e327, specifically tim roberts' reply
d -- This posting is provided "AS IS" with no warranties, and confers no rights.
- Edited by Doron Holan [MSFT]Microsoft Community Contributor, Owner Monday, April 16, 2012 5:03 AM
-
Monday, April 16, 2012 11:03 AM
I just have one question... these two sample contains the creation of AVStream in other words they get information from a camera (webcam build in or plug n play)... and they create a AVStream from it... As long as I know these two sample would create two virtual input device, woudn't they?
Thank you all.
Thanks again.
-
Monday, April 16, 2012 11:27 AM
you want to use a directshow filter if you can, a driver will be more complicated and error prone. for a driver you would interface with avstream, see the two avstream samples in the wdk
avshws, http://code.msdn.microsoft.com/windowshardware/AVSHwS-AVStream-Simulated-7953991d
avstream filter, http://code.msdn.microsoft.com/windowshardware/AVStream-Filter-Centric-f5c5a235
as for the protocol, you can make it up yourself. if you have control over the smart phone's usb implementation, you can make it look like a standard webcam and then you have no drivers to write at all.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.
I will try them to see what happens.
\documents\visual studio 2010\projects\avstream\c++\avshws.h(32): fatal error C1083: Cannot open include file: 'wdm.h': No such file or directory.
... I can not debug them...
- Edited by Carlesls Monday, April 16, 2012 12:08 PM
-
Monday, April 16, 2012 4:13 PMOwnerdid you install the WDK? to use the online sample you need to use dev11 beta (pro or higher) and the win8 WDK. these two samples also exist in the win7 WDK, but there is no integrated VS support, just command line builds.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.
-
Monday, April 16, 2012 4:31 PM
you want to use a directshow filter if you can, a driver will be more complicated and error prone. for a driver you would interface with avstream, see the two avstream samples in the wdk
avshws, http://code.msdn.microsoft.com/windowshardware/AVSHwS-AVStream-Simulated-7953991d
avstream filter, http://code.msdn.microsoft.com/windowshardware/AVStream-Filter-Centric-f5c5a235
as for the protocol, you can make it up yourself. if you have control over the smart phone's usb implementation, you can make it look like a standard webcam and then you have no drivers to write at all.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks for the replies.
I was thinking of a kernel mode driver mainly because its the most compatible of all not all programs support the directshow filter.
Is there any better option in your opinion or am i wrong?
What do you mean by "look like a standard webcam"?
What does a standard webcam look like?
Ok so i can make up the protocol myself.
so in case i go this route so i create protocol can feed raw video to avstream or can i use compression?
Sorry i am so clueless.
-
Monday, April 16, 2012 6:04 PMOwneryou can create your own protocol, you can use compression if you want. for compression I think if you use some standard algorithms, avstream/direct show/media foundation can decode them for you (vs decoding them in your avstream miniport). the standard webcam I am referring to is the webcam class specification for USB, available on usb.org.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.
-
Tuesday, April 17, 2012 6:37 AMCarlesls wrote:>>I just have one question... these two sample contains the creation>of AVStream in other words they get information from a camera (webcam>build in or plug n play)... and they create a AVStream from it...No, the samples create virtual cameras. The video comes from files.>As long as I know these two sample would create two virtual input>device, woudn't they?Well, each sample creates a virtual capture device.--Tim Roberts, timr@probo.comProvidenza & Boekelheide, Inc.
Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc. -
Tuesday, April 17, 2012 6:39 AMShaumux wrote:>>I was thinking of a kernel mode driver mainly because its the most>compatible of all not all programs support the directshow filter.AVStream cameras participate in DirectShow graphs through to a user modefilter called Ksproxy. Anything it can do, you can do in your own filter.Kernel drivers are not any more or less "compatible" than DirectShowfilters.>Is there any better option in your opinion or am i wrong?Option for what?--Tim Roberts, timr@probo.comProvidenza & Boekelheide, Inc.
Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc. -
Tuesday, April 17, 2012 6:41 AMShaumux wrote:>>Ok so i can make up the protocol myself.>>so in case i go this route so i create protocol can feed raw video to>avstream or can i use compression?You are glossing over one very important assumption that Doron made. Doronassumed that you KNEW how to get video out of your smart phone. Do you, infact, know how to do that?--Tim Roberts, timr@probo.comProvidenza & Boekelheide, Inc.
Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc. -
Tuesday, April 17, 2012 8:13 AM
Yes it was installed but I had to browse the include folder... it is ok...
damm now it says
>c:\winddk\7600.16385.1\inc\ddk\wdm.h(14197): fatal error C1189: #error : "No target architecture defined".
...I will try again...
why? I wonder why it is so complex to debug and build a simple sample.
I will try again.
-
Thursday, April 19, 2012 5:20 AMCarlesls wrote:>>Yes it was installed but I had to browse the include folder... it is ok...>>damm now it says>>c:\winddk\7600.16385.1\inc\ddk\wdm.h(14197):> fatal error C1189: #error : "No target architecture defined".>>...I will try again...>>why? I wonder why it is so complex to debug and build a simple sample.It's not complex to build a simple sample, if you follow the directions. Sofar, I don't think you are doing that.However, writing and debugging drivers is a LOT harder than building them.--Tim Roberts, timr@probo.comProvidenza & Boekelheide, Inc.
Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc. -
Thursday, April 19, 2012 5:49 AMOwnerhow are you buiding the driver? in the wdk build window on the command or are you trying to hack it together in VS? building in VS can be done with the win7 WDK with ddkbuild.bat (bing it), but creating your own driver project in VS2010 is not a supported scenario.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.


