Controlling Pre-Image Capture

This document explains how to configure the camera before using it for still image capture.

Purpose

The PreImageCaptureControl API allows the client to retrieve the following information:

  • Direct snapshot support

  • Embedded still capture setting support

  • Direct saving support

  • Image format and pixel aspect ratio supported for a given resolution

  • Maximum memory size setting support

  • Maximum memory size currently used in camera

This new API creates a new set of camera configuration with improved speed. The new camera configuration is created, when there is an on-going still image capture based on previous configuration.

Introduction

This classes provide the necessary framework to control the image operations and settings prior to image capture. An observer class is associated with this class so that client may be notified of various relevant activities. This API provides replacement for few image capture related methods in class Ccamera.

Required Background

This is an extension API associated with Ccamera class. To create an object of the extension API facade class, a client application would need to provide a valid Ccamera reference as a parameter for the factory method.

Clients use New2L or NewDuplicate2L method to create camera object. So, clients that uses NewL or NewDuplicateL will not be able to create instance of this extension. This prepares the clients to receive unrecognized enum or ids that can be included in future.

Using PreImageCaptureControl

Licensee should provide concrete implementation for MCameraPreImageCaptureControl class. Configuring the camera before using it for still image capture includes the following steps:

  1. Use CcameraPreImageCaptureControl::NewL() factory method to create a class pointer.

    This maps the exported call to an internal object of class CCameraPreImageCaptureControl that provides the functionality.

  2. Get this pointer using a call to Ccamera::CustomInterface() with UID value KECamMCameraPreImageCaptureControlUid.

  3. Use pointer to the MCameraPreImageCaptureControl derived class to initialize CCameraPreImageCaptureControl::iImpl during the second phase construction of the class CCamera::CCameraPreImageCaptureControl.

  4. Use MpreImageCaptureControlObserver that contains call-back to provide instance of image capture class object after successfully preparing the image parameters.

  5. Check if camera can provide capture event notification to the client using CCamera::CCameraPreImageCaptureControl::GetCaptureEventSupportInfoL method. If capture event notification is supported, ECam implementation will use KUidECamEventImageCaptureEvent event to notify the clients that the image has been exposed to the camera sensor.

  6. Clients can decide whether to play a capture sound.

  7. Client retrieves the information about direct snapshot support, embedded still capture setting support and direct saving support from the camera, and filled the desired TPrepareImageParameters to issue PrepareImageCapture call.

  8. Implementation sets up and allocates memory for image capture operation. It creates a new CCameraImageCapture object using the prepare image parameters passed by the client.

  9. The callback MPreImageCaptureControlObserver::PrepareImageComplete passes the ownership of the CCameraImageCapture object to the client.

Note:

The following example code snippets illustrates the use of PreImageCaptureControl classes.

CCamera* camera; 
Use MCameraObserver2* observer2; 
Use camera = CCamera::New2L(*observer2, 0);

CCamera::CCameraPreImageCaptureControl* preImgCapture = CCamera::CCameraPreImageCaptureControl::NewL(*camera, MPreImageCaptureControlObserver* preImageCaptureControlObserver));

CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters prepareImageParameters;
MCaptureImageObserver*     captureImageObserver ;
preImgCapture->PrepareImageCapture(prepareImageParameters, *captureImageObserver);

Setting Maximum Memory Size

To set maximum memory size for a JPEG still image do the following:

Providing image file saving support

To save the still images do the following steps:

Note: Before capturing still images by direct saving option, clients need to provide the filename.