CAMSetState

Syntax

#include <cafe/camera/camera.h>

int CAMSetState(CAMHandle hCam, CAM_STATE state, int *pVal);

Parameters

hCam Handle returned from CAMInit.
state Camera state of the type CAM_STATE.
pVal Pointer to the returned value of the camera state.

Return Values

A value of zero indicates success and any other value indicates the type of error that was encountered.

The following error codes can be returned:

CAMERA_ERROR_INVALID_HANDLE hCam handle is invalid.
CAMERA_ERROR_INVALID_ARG One or more of the arguments is invalid.
CAMERA_ERROR_UNIINITIALIZED The camera driver is either not initialized or it is not open.
CAMERA_ERROR_NOT_SUPPORTED CAMSetState does not support setting this state.
CAMERA_ERROR_UNKNOWN Camera streaming device failed to respond.
CAMERA_ERROR_NONE No error.

Description

Calling this function sets the value of a camera state. CAMSetState does not support all of the camera states. The table below shows which ones are supported. Each state is explained in CAM_STATE.

CAMERA_DEVICE_POWER_MODE Unsupported
CAMERA_AUTO_EXPOSURE_MODE Supported
CAMERA_AUTO_EXPOSURE_TIME_ABSOLUTE Supported
CAMERA_BRIGHTNESS Supported
CAMERA_CONTRAST Supported
CAMERA_GAIN Supported
CAMERA_POWER_LINE_FREQUENCY Supported
CAMERA_HUE Supported
CAMERA_SATURATION Supported
CAMERA_SHARPNESS Supported
CAMERA_GAMMA Supported
CAMERA_DIGITAL_MULTIPLIER_STEP Unsupported
CAMERA_DIGITAL_MULTIPLIER_LIMIT Unsupported
CAMERA_WHITE_BALANCE_COMPONENT Supported
CAMERA_WHITE_BALANCE_COMPONENT_AUTO Supported
CAMERA_DRC_CONNECTION_STATE Unsupported
CAMERA_GENERATE_KEY_FRAME Supported

CAUTION:
If you change the camera parameters while the camera is running, noise may occur in the camera image. The most noticeable being if changing gamma values. If you change gamma values, noise occurs as horizontal lines. Noise may not be as noticeable when changing other parameters. However, a significant parameter change, may result in noise.

There is no solution for this issue. If disrupted images are noticeable, skip 2 frames worth of images with a parameter change, change parameters when opening the camera, or make smaller parameter changes.

Do Not Call From

Background Do not call this function from the background.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

See Also

CAM_STATE
CAMHandle
CAMInit
CAMGetState
CAMGetStateInfo

Revision History

2014/09/15 Reworked CAUTION notice.
2013/05/08 Automated cleanup pass.
2012/04/03 Initial version.


CONFIDENTIAL