camera2_request_queue_src_ops Struct Reference
|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)|
Request input queue protocol:
The framework holds the queue and its contents. At start, the queue is empty.
- When the first metadata buffer is placed into the queue, the framework signals the device by calling notify_request_queue_not_empty().
- After receiving notify_request_queue_not_empty, the device must call dequeue() once it's ready to handle the next buffer.
- 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.
- 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.
- 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.
- 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.
|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() .
|int(* free_request)(const struct camera2_request_queue_src_ops *q, camera_metadata_t *old_buffer)|
|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.
The documentation for this struct was generated from the following file:
- hardware/libhardware/include/hardware/ camera2.h