Using the camera in applications

Camera API allows your application to use the device onboard camera to capture still images and video clips, and store them in the internal memory or on removable media. You can implement applications that make use of the camera to capture images, record videos, or use the display as a viewfinder.

To capture images or to record videos, you need a combination of S60 APIs, Symbian classes and device-specific components.

This section contains information on the following implementations of the Camera API:

Evolution of the Camera API

There is a source and binary compatibility break between S60 3rd Edition, Feature Pack 1 and Feature Pack 2. This break is related to the advanced camera features, not the main CCamera class.

For example, prior to S60 3rd Edition, Feature Pack 2, autofocus support for camera applications was enabled with an add-on autofocus plug-in library, which is included in the S60 Platform: Camera Example with AutoFocus Support. From S60 3rd Edition, Feature Pack 2 onwards, autofocus is controlled through the CCameraAdvancedSettings class of the Camera API. However, the CCameraAdvancedSettings class is not part of the S60 3rd Edition, Feature Pack 2 SDK, but it is available in the Extensions Plug-in for S60 3rd Edition SDK for Symbian OS, Feature Pack 2, v1.2.

For more information on using autofocus, see Using the camera autofocus feature in S60 devices and Implementing autofocus functionality (S60 3rd Edition, pre-FP2) on Forum Nokia Developer Community Wiki.

Figure: Implementation of autofocus in different platform release versions

Pressing the camera shutter key on the device halfway down generates additional key events. These key events can be used to activate the autofocus, if the camera hardware supports the functionality. Shutter release (image capture) can be triggered by pressing the key all the way down. These key presses generate separate key events and, moreover, the key codes for these events vary in different 3rd Edition devices. Note that if you want to capture other than autofocus key events from the shutter key, you need the SwEvent capability.

The settings you can use in your application depend on the camera hardware on the device. The Camera API allows you to query nearly every feature of the onboard camera. For example, to get a list of supported advanced settings, use the CCameraAdvancedSettings::GetSupportedSettingsL() method.