camera2_request_queue_src_ops Struct Reference

camera2_request_queue_src_ops Struct Reference

#include < camera2.h >

Data Fields

int(*  request_count )(const struct camera2_request_queue_src_ops *q)
 
int(*  dequeue_request )(const struct camera2_request_queue_src_ops *q, camera_metadata_t **buffer)
 
int(*  free_request )(const struct camera2_request_queue_src_ops *q, camera_metadata_t *old_buffer)
 

Detailed Description

Request input queue protocol:

The framework holds the queue and its contents. At start, the queue is empty.

  1. When the first metadata buffer is placed into the queue, the framework signals the device by calling notify_request_queue_not_empty().
  2. After receiving notify_request_queue_not_empty, the device must call dequeue() once it's ready to handle the next buffer.
  3. Once the device has processed a buffer, and is ready for the next buffer, it must call dequeue() again instead of waiting for a notification. If there are no more buffers available, dequeue() will return NULL. After this point, when a buffer becomes available, the framework must call notify_request_queue_not_empty() again. If the device receives a NULL return from dequeue, it does not need to query the queue again until a notify_request_queue_not_empty() call is received from the source.
  4. If the device calls buffer_count() and receives 0, this does not mean that the framework will provide a notify_request_queue_not_empty() call. The framework will only provide such a notification after the device has received a NULL from dequeue, or on initial startup.
  5. The dequeue() call in response to notify_request_queue_not_empty() may be on the same thread as the notify_request_queue_not_empty() call, and may be performed from within the notify call.
  6. All dequeued request buffers must be returned to the framework by calling free_request, including when errors occur, a device flush is requested, or when the device is shutting down.

Definition at line 220 of file camera2.h .

Field Documentation

int(* dequeue_request)(const struct camera2_request_queue_src_ops *q, camera_metadata_t **buffer)

Get a metadata buffer from the framework. Returns OK if there is no error. If the queue is empty, returns NULL in buffer. In that case, the device must wait for a notify_request_queue_not_empty() message before attempting to dequeue again. Buffers obtained in this way must be returned to the framework with free_request() .

Definition at line 237 of file camera2.h .

int(* free_request)(const struct camera2_request_queue_src_ops *q, camera_metadata_t *old_buffer)

Return a metadata buffer to the framework once it has been used, or if an error or shutdown occurs.

Definition at line 243 of file camera2.h .

int(* request_count)(const struct camera2_request_queue_src_ops *q)

Get the count of request buffers pending in the queue. May return CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS if a repeating request (stream request) is currently configured. Calling this method has no effect on whether the notify_request_queue_not_empty() method will be called by the framework.

Definition at line 228 of file camera2.h .


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