WinCE: Setting up a USB Camera

From Compulab Mediawiki
Jump to: navigation, search

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

  1. Download the driver from: USB cam driver
  2. Install the downloaded driver.
  3. Edit the file WINCE600\PUBLIC\ThirdParty\Catalog\USBCam\Driver\usbcam.reg .
  4. Replace
    [$(PCI_BUS_ROOT)\Template\ehci]
    with
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\ehci]
  5. 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

    1. Copy the previously compiled CameraDshowApp.exe to the target.
    2. Make sure the USB cam is plugged into the P17 connector of the SB_T3x.
    3. Run CameraDshowApp.exe.
    4. "CAM1:" should be selected as the driver.
      1. For still pictures only, select the following:
        CM T35 Cam APP Still Only Settings.jpg
      2. For still pictures and video capture select every item except AudioCapture and Audio encoder.
        CM T35 Cam APP Video Capture Settings.jpg
    5. Create a folder in which you want your files to be saved, set the filename in the application accordingly, and press "OK".
      (The default is in /release where your files will be named test0.jpg .. testN.jpg and test0.asf .. testN.asf as you can see marked in a red square and /release still needs to be created by the user)
      CM T35 Cam APP Files Location Settings.jpg
    6. To take a still picture snapshot, press "Still".
    7. For video capture, press "Start Cap" (to stop or pause it press "Stop Cap" or "Pause Cap" for the latter).
      (Notice that once you press "Stop Cap" it will take some time to finish processing the data and produce your filename.asf)
      CM T35 Cam APP Menu.jpg

    Modifying the camera resolution

    1. To modify the resolution, go to WINCE600\PUBLIC\ThirdParty\Catalog\USBCam\Driver\ and edit usbcam.reg.
    2. Modify the following registry values
        [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Video_Class]
        "PreferredWidth"=dword:B0;176
        "PreferredHeight"=dword:90;144