Requirement - both your computer and your android phone should be connected to the same network with android connected via WiFi.
Once your phone is connected to the same PC network via wifi, follow these steps -
1.From android market in your phone, install IP Webcam.
2.Open the app and you will get the configuration screen where you can set the options for port, sound, video quality and username/password.
The default options are good enough, so scroll down and click on the "Start server" option.
3.Ip Webcam will now open your camera and start streaming the video to a particular IP address and port. Click on the "How do I connect" button appearing on the top left and choose "I'm using Wi-fi router" to get this IP address and port. You will get some thing like "http://10.42.43.89:8080".
4.Note this address down and type it in your PC web browser. You will get a page with links for various ways in which you can use your new webcam. From the list, you need to use either of the two links.
Connect to PC for use with Skype and other videochats on Windows.
Connect to PC for use with Skype and other videochats on Ubuntu GNU/Linux.
5.Depending on your operating system (Windows or Linux), use the links to download and install the webcam driver on your PC.
1. Setup your phone in debugging mode (Settings -> Applications -> Development -> USB debugging).
Connect the phone to your computer via USB (don't select storage mode if the phone asks while connecting USB).
2.Download DroidCam from android market,install it and open it on your phone. It will show a "Starting server" message.
3.Download and install the client application in your computer from Dev47Apps.
4.Start the DroidCam client and choose the "USB" option or button.
5.That's it. DroidCam will now open the camera on your phone and you can use it as webcam on your PC. Just configure the video settings of your video call application to use "DroidCam" driver.