none
USB Webcam Driver Developement

    질문

  • 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

    2012년 4월 15일 일요일 오후 7:12

답변

모든 응답

  • 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.

    2012년 4월 16일 월요일 오전 5:01
  • also, 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.


    2012년 4월 16일 월요일 오전 5:03
  • 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.

    2012년 4월 16일 월요일 오전 11:03
  • 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...

    • 편집됨 Carlesls 2012년 4월 16일 월요일 오후 12:08
    2012년 4월 16일 월요일 오전 11:27
  • did 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.

    2012년 4월 16일 월요일 오후 4:13
  • 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.

    2012년 4월 16일 월요일 오후 4:31
  • you 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.

    2012년 4월 16일 월요일 오후 6:04
  • Carlesls 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.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    2012년 4월 17일 화요일 오전 6:37
  • Shaumux 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 mode
    filter called Ksproxy.  Anything it can do, you can do in your own filter.
    Kernel drivers are not any more or less "compatible" than DirectShow
    filters.
     
    >Is there any better option in your opinion or am i wrong?
     
    Option for what?
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    2012년 4월 17일 화요일 오전 6:39
  • Shaumux 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.  Doron
    assumed that you KNEW how to get video out of your smart phone.  Do you, in
    fact, know how to do that?
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    2012년 4월 17일 화요일 오전 6:41
  • 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.

    2012년 4월 17일 화요일 오전 8:13
  • Carlesls 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. So
    far, I don't think you are doing that.
     
    However, writing and debugging drivers is a LOT harder than building them.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    2012년 4월 19일 목요일 오전 5:20
  • how 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.

    2012년 4월 19일 목요일 오전 5:49