WinCE: Setting up a USB Camera
Contents
Overview
This document explains how to set up a USB camera for the CM-T3x. This solution is based on a USB camera driver provided by Microsoft. The driver was tested using the JDEPC-OV03-B web camera, but it should work for any other USB web camera as well.
Adding the USB camera driver to the image
- Download the driver from: USB cam driver
- Install the downloaded driver.
- Edit the file WINCE600\PUBLIC\ThirdParty\Catalog\USBCam\Driver\usbcam.reg .
- Replace
[$(PCI_BUS_ROOT)\Template\ehci]
with[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\ehci]
- In platform builder, go to Catalog Items View, select the following components and run "clean sysgen":
SYSGEN_USB
SYSGEN_DSHOW_CAPTURE
SYSGEN_DSHOW_DMO
SYSGEN_DSHOW_VIDREND
SYSGEN_DCOM_STG
SYSGEN_IMAGING
SYSGEN_IMAGING_BMP_DECODE
SYSGEN_IMAGING_BMP_ENCCODE
SYSGEN_IMAGING_JPG_ENCCODE
SYSGEN_IMAGING_JPG_DECODE
SYSGEN_DCOM
Compiling the camera application
The test application source code is located in WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\CAMERAAPP. This section explains how to build it.
Select “Open release Directory in Build Window” from the workspace Build Menu.
Change your directory to
WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\COMMON\LIBS
Type the command ‘build -c’ and wait for the build to finish.
Change the directory to
WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA
Type the command ‘build -c’. It will build those directories, but finish of with the ‘kato.lib’ non availability error.
Now Change the directory to
WINCE600\PRIVATE\TEST\MULTIMEDIA\DIRECTX\DSHOW\CAMERA\CAMERAAPP\
Type the command ‘build -c’
The “CameraDshowApp.exe” application binary is generated in the Release directory of the OSDesign.
Running the Camera test app
- Copy the previously compiled CameraDshowApp.exe to the target.
- Make sure the USB cam is plugged into the P17 connector of the SB_T3x.
- Run CameraDshowApp.exe.
- "CAM1:" should be selected as the driver.
- Create a folder in which you want your files to be saved, set the filename in the application accordingly, and press "OK".
- To take a still picture snapshot, press "Still".
- For video capture, press "Start Cap" (to stop or pause it press "Stop Cap" or "Pause Cap" for the latter).
Modifying the camera resolution
- To modify the resolution, go to WINCE600\PUBLIC\ThirdParty\Catalog\USBCam\Driver\ and edit usbcam.reg.
- Modify the following registry values
[HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Video_Class] "PreferredWidth"=dword:B0;176 "PreferredHeight"=dword:90;144