get_preview_buffer_size_func_t

Updated: April 19, 2023

Query the size of buffer needed for a given preview resolution and frame type

Synopsis:

#include <camera/external_camera_api.h>
typedef int(* get_preview_buffer_size_func_t)(void *handle,
            camera_unit_t unit,
            camera_res_t previewResolution,
            camera_frametype_t frameType,
            camera_res_t *bufferSize);

Arguments:

handle
The handle that's returned from calling the function open_external_camera_func_t.
unit
The camera unit being queried. See camera_unit_t for details.
previewResolution
The resolution of the preview image. See camera_res_t for details.
frameType
The frame type of the preview image. See camera_frametype_t for details.
bufferSize
On success, it is filled with the desired buffer size. See camera_res_t for details.

Library:

libcamapi

Description:

This function queries the size of buffer needed for the specified preview resolution and frame type. Due to alignment and border requirements, it is possible that the size of the buffer required for a given preview resolution differs from the resolution itself.

Note:

This function is optional. If it is not present, the buffers will be the same size as the preview resolution.

Returns:

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