camera3_stream_buffer Struct Reference

camera3_stream_buffer Struct Reference

#include < camera3.h >

Data Fields

camera3_stream_t stream
 
buffer_handle_t *  buffer
 
int  status
 
int  acquire_fence
 
int  release_fence
 

Detailed Description

camera3_stream_buffer_t:

A single buffer from a camera3 stream. It includes a handle to its parent stream, the handle to the gralloc buffer itself, and sync fences

The buffer does not specify whether it is to be used for input or output; that is determined by its parent stream type and how the buffer is passed to the HAL device.

Definition at line 1755 of file camera3.h .

Field Documentation

int acquire_fence

The acquire sync fence for this buffer. The HAL must wait on this fence fd before attempting to read from or write to this buffer.

The framework may be set to -1 to indicate that no waiting is necessary for this buffer.

When the HAL returns an output buffer to the framework with process_capture_result(), the acquire_fence must be set to -1. If the HAL never waits on the acquire_fence due to an error in filling a buffer, when calling process_capture_result() the HAL must set the release_fence of the buffer to be the acquire_fence passed to it by the framework. This will allow the framework to wait on the fence before reusing the buffer.

For input buffers, the HAL must not change the acquire_fence field during the process_capture_request() call.

>= CAMERA_DEVICE_API_VERSION_3_2:

When the HAL returns an input buffer to the framework with process_capture_result(), the acquire_fence must be set to -1. If the HAL never waits on input buffer acquire fence due to an error, the sync fences should be handled similarly to the way they are handled for output buffers.

Definition at line 1800 of file camera3.h .

buffer_handle_t* buffer

The native handle to the buffer

Definition at line 1764 of file camera3.h .

int release_fence

The release sync fence for this buffer. The HAL must set this fence when returning buffers to the framework, or write -1 to indicate that no waiting is required for this buffer.

For the output buffers, the fences must be set in the output_buffers array passed to process_capture_result().

<= CAMERA_DEVICE_API_VERSION_3_1:

For the input buffer, the release fence must be set by the process_capture_request() call.

>= CAMERA_DEVICE_API_VERSION_3_2:

For the input buffer, the fences must be set in the input_buffer passed to process_capture_result().

After signaling the release_fence for this buffer, the HAL should not make any further attempts to access this buffer as the ownership has been fully transferred back to the framework.

If a fence of -1 was specified then the ownership of this buffer is transferred back immediately upon the call of process_capture_result.

Definition at line 1827 of file camera3.h .

int status

Current state of the buffer, one of the camera3_buffer_status_t values. The framework will not pass buffers to the HAL that are in an error state. In case a buffer could not be filled by the HAL, it must have its status set to CAMERA3_BUFFER_STATUS_ERROR when returned to the framework with process_capture_result().

Definition at line 1773 of file camera3.h .

The handle of the stream this buffer is associated with

Definition at line 1759 of file camera3.h .


The documentation for this struct was generated from the following file: