CAMInit

Syntax

#include <cafe/camera/camera.h>

// enumerate all supported Camera IDs here
typedef enum _CAMERA_INSTANCE
{
    CAMERA_INSTANCE_0 = 0,
    CAMERA_INSTANCE_NUM
} CAMERA_INSTANCE;

CAMHandle CAMInit(CAMERA_INSTANCE instance, CAMSetupInfo *pSetup, int *err);

Parameters

instance Instance of device to initialize for use. Currently, the only valid value is CAMERA_INSTANCE_0.
pSetup Pointer to the CAMSetupInfo structure.
err Pointer to the variable that will contain the specific error code.

Return Values

CAMHandle is returned. Zero or greater values for the handle indicate success whereas a value of -1 indicates error. In case of an error, err is set to a nonzero value.

Error can be populated with the following error codes.

CAMERA_ERROR_DEVICE_IN_USE Camera has been previously initialized.
CAMERA_ERROR_INVALID_ARG One or more of input parameters are invalid.
CAMERA_ERROR_INSUFFICIENT_MEMORY Not enough memory for camera operation.
CAMERA_ERROR_SEGMENT_VIOLATION Work memory straddles 256 MB boundary.
CAMERA_ERROR_NONE No error.

Description

Validates the given parameters and then initializes the driver stack and video decode hardware (UVD). The application needs to allocate enough work memory for the driver and populate CAMSetupInfo structure with valid parameters for this call to succeed. CAMExit needs to be called before the application can safely free up the work memory.

NOTE:
The DRC needs not be attached for CAMInit to succeed.

Do Not Call From

Background Do not call this function from the background.
Multiple threads This function is not thread-safe.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

See Also

CAMHandle
CAMSetupInfo
CAMExit

Revision History

2013/05/08 Automated cleanup pass.
2011/10/24 Initial version.


CONFIDENTIAL