Definitions in camera_api.h

Preprocessor macro definitions for the camera_api.h header file in the libcamapi library.

Definitions:

#define CAMERA_API_VERSION 2
The version of the Camera library.

The version is used for IPC handshaking and communication between the application and the camera service. You can compare CAMERA_API_VERSION with the value returned by the camera_get_api_version() function to determine if the runtime library is different from the version your application was compiled with. Differences may indicate potential incompatibilities.

#define CAMERA_HANDLE_INVALID (-1)
A safe-initializer value for camera_handle_t values.

Use this value to check that correct initialization occurred and whether a call to the camera_open() function was successful. A camera handle should be set to this value during initialization or when the handle is closed.

#define CAMERA_ROLL_NAMELEN (256)
The maximum length of a filename returned by camera-roll functions.

The value is useful for you to determine the largest char* buffer to allocate. The camera roll is a directory where photo and video files can be saved.

#define CAMERA_MAX_FRAMEDESC_SIZE (256)
The maximum size, in bytes, of the frame descriptor.
#define camera_set_videovf_property _camera_set_videovf_property(handle, args, CAMERA_IMGPROP_END)
Configure one or more settings in the video viewfinder.

As part of the args argument, you can provide one or more property-value pairs using camera_imgprop_t values as the name of the property and the correct type for the value such as an int or double value. The following camera_imgprop_t can be used with this function:

There is no type-checking performed by the compiler, therefore, you must ensure that the value you provide for each property matches the expected data type. Data type mismatches can result in undefined behavior and may cause your application to crash.

You can specify multiple property-value pairs by delimiting them with a comma as follows:

 property1, value1, property2, value2,...

For example, you can set values in the following manner:

 camera_set_videovf_property( camera_handle,
                              CAMERA_IMGPROP_WIN_GROUPID, "GroupID",
                              CAMERA_IMGPROP_WIN_ID, "WindowID",
                              CAMERA_IMGPROP_WIDTH, 1024,
                              CAMERA_IMGPROP_HEIGHT, 576,
                              CAMERA_IMGPROP_ROTATION, 90,
                              CAMERA_IMGPROP_FRAMERATE, (double)30.0 );

The following properties can't be changed after the viewfinder has started:
handle

The handle returned by a call to the camera_open() function.

args...

A series of comma-delimited property-value pairs where each value must be a pointer a variable of the expected type.

CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.

#define camera_get_video_property _camera_get_video_property(handle, args, CAMERA_IMGPROP_END)
Retrieve the current output properties for video.

As part of the args argument, you can provide one or more property-value pairs using camera_imgprop_t values as the name of the property and a pointer to the correct type for the value such as an int or double value. The following camera_imgprop_t can be used with this function:

There is no type-checking performed by the compiler, therefore, you must ensure that the value you provide for each property matches the expected data type. Data type mismatches can result in undefined behavior and may cause your application to crash.

You can specify multiple property-value pairs by delimiting them with a comma as follows:

 property1, &value1, property2, &value2,...

For example, you can retrieve the values in the following manner:
 camera_get_video_property( camera_handle,
                            CAMERA_IMGPROP_WIDTH, &vf_width,
                            CAMERA_IMGPROP_HEIGHT, &vf_height,
                            CAMERA_IMGPROP_ROTATION, &vf_rotation,
                            CAMERA_IMGPROP_FRAMERATE, &vf_framerate );
handle

The handle returned by a call to the camera_open() function.

args...

A series of comma-delimited property-value pairs where each value must be a pointer a variable of the expected type.

CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.

Library:

libcamapi