Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Creating and Setting Up ICamera

Objective

This topic shows code snippets needed to set up an ICamera object.

Requirements

To use the ICamera interface, an application needs to:

  1. Create an ICamera object.
  2. Register a callback function.

Example - Creating and setting up ICamera

Create the ICamera object. If you are testing on the Simulator and do not have a web cam attached to your computer, the create instance call will fail.

nErr = ISHELL_CreateInstance(pMe->Applet.m_pIShell, AEECLSID_CAMERA,
																													(void**)( &pMe->pICamera));
if (nErr != AEE_SUCCESS)
{
      DBGPRINTF("Creating ICamera Failed %d", nErr);
      if (nErr == AEE_EPRIVLEVEL)
      {
         DBGPRINTF("Check if MIF has permissions to create AEECLSID_CAMERA");
      }
      return;
}

Register the callback function.

ICAMERA_RegisterNotify(pMe->pICamera,(PFNCAMERANOTIFY)c_SampleCameraApp_CameraCBFunc, 
                          					(void *)pMe);