Click to See Complete Forum and Search --> : Video For Windows cap API


gonzo48
October 16th, 2004, 10:29 PM
I have 2 USB cameras installed on my XP laptop. One is a LogiTech and the other is a Creative Labs camera. I use the vfw cap... API and can display a capture window showing the video just fine. What I am trying to do now is to change to the other camera. I initialize the first one using driver index 0 and everything is just fine. Then I call capDriverDisconnect(), then DestroyWindow() and its gone, then I initialize it all again (calling capCreateCaptureWindow) using driver index 1. All of the API functions return successful (I am checking all of the return codes) and I get a new capture window. However, the video I get is from the first camera, not the second camera.

In short, I create a capture window using driver index 0, everything is fine.
I destroy it and create another capture window using driver index 1, everything is fine except it connects to driver 0's camera.

The capGetDriverDescription() routine does indeed find 2 drivers install on the system and they have the correct names for the cameras.

Has anyone experienced this before?? Any suggestions?

Thanks,

gonzo

NoHero
October 17th, 2004, 08:12 AM
What is with index 2 or 3 ...? Maybe its an error cauesed by the driver and it sets itself to another index than 1. Because the index can go from 0 to 9.

gonzo48
October 18th, 2004, 03:31 PM
You're right, the index goes from 0 to 9. I am connecting driver 0 and everything is fine. I then disconnect it, destroy the capture window, create a new capture window, connect to driver 1, and then I get the video from the driver 0 camera.

I havn't a clue....

-gonzo

NoHero
October 18th, 2004, 03:44 PM
You're right, the index goes from 0 to 9. I am connecting driver 0 and everything is fine. I then disconnect it, destroy the capture window, create a new capture window, connect to driver 1, and then I get the video from the driver 0 camera.

I havn't a clue....

-gonzo

Yes, But have you tested to connect to driver 2 or 3 ... Or checking the return values of the functions and the return value of ::GetLastError()?