get_preview_frame_func_t

Retrieves the next available preview frame

Synopsis:

#include <camera/external_camera_api.h>
typedef int(* get_preview_frame_func_t)(void *handle,
            void *bufferIn,
            camera_preview_frame_flags_t *flags,
            void **bufferOut,
            int64_t *timestamp,
            void *metaOut,
            uint64_t *metaSize);

Arguments:

handle
The handle that's returned from calling the function open_external_camera_func_t.
bufferIn
An empty buffer to feed in to the camera to be filled now or in the future.
flags
The returned flags. See camera_preview_frame_flags_t for information.
bufferOut
The newly acquired preview image data.
timestamp
The returned timestamp, which indicates the capture time of the preview frame. The clock is measured in microseconds and is in the sensor time domain. See get_time_func_t for more information.
metaOut
The returned metadata associated with this preview frame.
metaSize
A pointer to value passed in as metaSize indicates the maximum space available in the metaOut buffer. The value returned indicates how much space was actually populated with metadata (e.g., 64k in, 1k out).

Library:

libcamapi

Description:

This is the main interface between the preview thread and the camera. The Sensor service runs the preview thread that repeatedly calls into get_preview_frame_func_t to receive the next available frame from the camera. This operation both enqueues empty buffers for use by the camera (i.e., to pipeline) and expects to receive filled buffers back from the camera. If the camera's hardware requires pipelining, this function doesn't return any new frames until enough empty buffers have been supplied.

Note:

This function call is blocking when the camera is fully pipelined.

Returns:

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