newbie... communication with usb/serial port

hello,

i thought this would be an appropriate forum to post in. i am a complete newbie, so please bear with me while i ask stupid questions!

what i need to do is to grab data coming in from a usb webcam and send it out over tcp so i can view the webcam at a different location. i have never done anything like this before and i have some very very basic questions for you regarding getting data from a webcam... (not about sending over tcp- i've done that and tested with different test cases..it should be ok!).

1. When you do something like this, is the communication between the "usb port (or webcam)" one way or two way? what i mean by this is will the webcam just keep sending data, or does the "computer" ever have to send anything to the port/device?

2. how difficult would it be for me to grab the webcam data? I mean, am i looking at 10 lines of code, 100 lines of code, 1000 LOC ......?

3. Someone suggested that i get a usb to serial converter. is it really that much easier to read from a serial port than a usb port?

4. I would like to be able to use any USB webcam in my app. are teh formats of the data from different webcams different? where can i find info on this?

5. Any other general stuff you can tell me, point me to would be appreciated!

I know these are very broad/general questions... but i need a starting point and to know if what i want to do is even possible! Please help a newbie out!

Thanks a lot!
[1516 byte] By [drewdaman] at [2007-11-19 6:57:24]
# 1 Re: newbie... communication with usb/serial port
anyone? you don't have to answer all my questions!! plz just answer as much as you can! thanks!
drewdaman at 2007-11-10 3:54:51 >
# 2 Re: newbie... communication with usb/serial port
not that many lines of code... the way i did it was to write an upper filter driver and attach it to the function driver installed for the web cam. By doing a DeviceIOControl, you can capture the streaming in data from the hardware being handled by this driver. You might also be able to manipulate it... *wink*.

There are several books introducing filter drivers and the like... namely Walter Oney and Cris Cant. I did this sometime ago... can't remember when. Then I realised that there was a DDK available online that also captures camera data in user mode... hrrm.
spockdude at 2007-11-10 3:55:51 >
# 3 Re: newbie... communication with usb/serial port
hey spockdude
thanks for replying and sorry i took so long to reply to my own post!! i have been working on a different project for the last few days... although i'm still very interested in this stuff because i have will have to do it when i finish up with my new project. i will look into the stuff yuo mentioned.
drewdaman at 2007-11-10 3:56:57 >
# 4 Re: newbie... communication with usb/serial port
Hi,

I'm not sure on how to communicate with USB, but I do know its easy with serial port, just using the CreateFile(...) to open the port, ReadFile(...) to read from the port and WriteFile(...) to write to the port. Its quite easy and straight forward.
Max Payne at 2007-11-10 3:57:51 >
# 5 Re: newbie... communication with usb/serial port
I have a proprietary device that talks via Serial port. I need to set the DTR line to power the device. On newre Win XP laptops there apears to be no serial port. If I use the USB to serial converter how do I set the DTR line on? How do I write my data to the USB port which the converter feeds to the RS-232 port?
Thanks,
Usha
Ushakuloor at 2007-11-10 3:58:50 >
# 6 Re: newbie... communication with usb/serial port
Guys, if you really wish to talk to a USB device, but without diving into USB practice, you should consider windriver (www.jungo.com). What it gives you basically is a driver for your device and API to talk to it. no writing kernel mode code and no deep driver understanding. it practically saved me from weeks of work that I had no room for in my schedule, and I could focus on the main issues of my application...
jayroberts at 2007-11-10 3:59:58 >