Android Hardware Abstraction Layer
Data Fields
camera2_device_ops Struct Reference

#include <camera2.h>

Data Fields

int(* set_request_queue_src_ops )(const struct camera2_device *, const camera2_request_queue_src_ops_t *request_src_ops)
 
int(* notify_request_queue_not_empty )(const struct camera2_device *)
 
int(* set_frame_queue_dst_ops )(const struct camera2_device *, const camera2_frame_queue_dst_ops_t *frame_dst_ops)
 
int(* get_in_progress_count )(const struct camera2_device *)
 
int(* flush_captures_in_progress )(const struct camera2_device *)
 
int(* construct_default_request )(const struct camera2_device *, int request_template, camera_metadata_t **request)
 
int(* allocate_stream )(const struct camera2_device *, uint32_t width, uint32_t height, int format, const camera2_stream_ops_t *stream_ops, uint32_t *stream_id, uint32_t *format_actual, uint32_t *usage, uint32_t *max_buffers)
 
int(* register_stream_buffers )(const struct camera2_device *, uint32_t stream_id, int num_buffers, buffer_handle_t *buffers)
 
int(* release_stream )(const struct camera2_device *, uint32_t stream_id)
 
int(* allocate_reprocess_stream )(const struct camera2_device *, uint32_t width, uint32_t height, uint32_t format, const camera2_stream_in_ops_t *reprocess_stream_ops, uint32_t *stream_id, uint32_t *consumer_usage, uint32_t *max_buffers)
 
int(* allocate_reprocess_stream_from_stream )(const struct camera2_device *, uint32_t output_stream_id, const camera2_stream_in_ops_t *reprocess_stream_ops, uint32_t *stream_id)
 
int(* release_reprocess_stream )(const struct camera2_device *, uint32_t stream_id)
 
int(* trigger_action )(const struct camera2_device *, uint32_t trigger_id, int32_t ext1, int32_t ext2)
 
int(* set_notify_callback )(const struct camera2_device *, camera2_notify_callback notify_cb, void *user)
 
int(* get_metadata_vendor_tag_ops )(const struct camera2_device *, vendor_tag_query_ops_t **ops)
 
int(* dump )(const struct camera2_device *, int fd)
 
int(* get_instance_metadata )(const struct camera2_device *, camera_metadata **instance_metadata)
 

Detailed Description

Definition at line 523 of file camera2.h.

Field Documentation

int(* allocate_reprocess_stream)(const struct camera2_device *, uint32_t width, uint32_t height, uint32_t format, const camera2_stream_in_ops_t *reprocess_stream_ops,uint32_t *stream_id, uint32_t *consumer_usage, uint32_t *max_buffers)

allocate_reprocess_stream:

Allocate a new input stream for use, defined by the output buffer width, height, and the pixel format. Returns the new stream's ID, gralloc usage flags, and required simultaneously acquirable buffer count, on success. Error conditions:

  • Requesting a width/height/format combination not listed as supported by the sensor's static characteristics
  • Asking for too many reprocessing streams to be configured at once.

Input parameters:

  • width, height, format: Specification for the buffers to be sent through this stream. Format must be a value from the HAL_PIXEL_FORMAT_* list.
  • reprocess_stream_ops: A structure of function pointers for acquiring and releasing buffers for this stream. The underlying stream will be configured based on the usage and max_buffers outputs.

Output parameters:

  • stream_id: An unsigned integer identifying this stream. This value is used in incoming requests to identify the stream, and in releasing the stream. These ids are numbered separately from the input stream ids.
  • consumer_usage: The gralloc usage mask needed by the HAL device for consuming the requested type of data. This is used in allocating new gralloc buffers for the stream buffer queue.
  • max_buffers: The maximum number of buffers the HAL device may need to have acquired at the same time. The device may not have more buffers acquired at the same time than this value.

Definition at line 704 of file camera2.h.

int(* allocate_reprocess_stream_from_stream)(const struct camera2_device *, uint32_t output_stream_id, const camera2_stream_in_ops_t *reprocess_stream_ops,uint32_t *stream_id)

allocate_reprocess_stream_from_stream:

Allocate a new input stream for use, which will use the buffers allocated for an existing output stream. That is, after the HAL enqueues a buffer onto the output stream, it may see that same buffer handed to it from this input reprocessing stream. After the HAL releases the buffer back to the reprocessing stream, it will be returned to the output queue for reuse.

Error conditions:

  • Using an output stream of unsuitable size/format for the basis of the reprocessing stream.
  • Attempting to allocatee too many reprocessing streams at once.

Input parameters:

  • output_stream_id: The ID of an existing output stream which has a size and format suitable for reprocessing.
  • reprocess_stream_ops: A structure of function pointers for acquiring and releasing buffers for this stream. The underlying stream will use the same graphics buffer handles as the output stream uses.

Output parameters:

  • stream_id: An unsigned integer identifying this stream. This value is used in incoming requests to identify the stream, and in releasing the stream. These ids are numbered separately from the input stream ids.

The HAL client must always release the reprocessing stream before it releases the output stream it is based on.

Definition at line 750 of file camera2.h.

int(* allocate_stream)(const struct camera2_device *,uint32_t width, uint32_t height, int format, const camera2_stream_ops_t *stream_ops,uint32_t *stream_id, uint32_t *format_actual,uint32_t *usage, uint32_t *max_buffers)

allocate_stream:

Allocate a new output stream for use, defined by the output buffer width, height, target, and possibly the pixel format. Returns the new stream's ID, gralloc usage flags, minimum queue buffer count, and possibly the pixel format, on success. Error conditions:

  • Requesting a width/height/format combination not listed as supported by the sensor's static characteristics
  • Asking for too many streams of a given format type (2 bayer raw streams, for example).

Input parameters:

  • width, height, format: Specification for the buffers to be sent through this stream. Format is a value from the HAL_PIXEL_FORMAT_* list. If HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform gralloc module will select a format based on the usage flags provided by the camera HAL and the consumer of the stream. The camera HAL should inspect the buffers handed to it in the register_stream_buffers call to obtain the implementation-specific format if necessary.
  • stream_ops: A structure of function pointers for obtaining and queuing up buffers for this stream. The underlying stream will be configured based on the usage and max_buffers outputs. The methods in this structure may not be called until after allocate_stream returns.

Output parameters:

  • stream_id: An unsigned integer identifying this stream. This value is used in incoming requests to identify the stream, and in releasing the stream.
  • usage: The gralloc usage mask needed by the HAL device for producing the requested type of data. This is used in allocating new gralloc buffers for the stream buffer queue.
  • max_buffers: The maximum number of buffers the HAL device may need to have dequeued at the same time. The device may not dequeue more buffers than this value at the same time.

Definition at line 628 of file camera2.h.

int(* construct_default_request)(const struct camera2_device *, int request_template, camera_metadata_t **request)

Create a filled-in default request for standard camera use cases.

The device must return a complete request that is configured to meet the requested use case, which must be one of the CAMERA2_TEMPLATE_* enums. All request control fields must be included, except for android.request.outputStreams.

The metadata buffer returned must be allocated with allocate_camera_metadata. The framework takes ownership of the buffer.

Definition at line 576 of file camera2.h.

int(* dump)(const struct camera2_device *, int fd)

Dump state of the camera hardware

Definition at line 797 of file camera2.h.

int(* flush_captures_in_progress)(const struct camera2_device *)

Flush all in-progress captures. This includes all dequeued requests (regular or reprocessing) that have not yet placed any outputs into a stream or the frame queue. Partially completed captures must be completed normally. No new requests may be dequeued from the request queue until the flush completes.

Definition at line 563 of file camera2.h.

int(* get_in_progress_count)(const struct camera2_device *)

Number of camera requests being processed by the device at the moment (captures/reprocesses that have had their request dequeued, but have not yet been enqueued onto output pipeline(s) ). No streams may be released by the framework until the in-progress count is 0.

Definition at line 554 of file camera2.h.

int(* get_instance_metadata)(const struct camera2_device *, camera_metadata **instance_metadata)

Get device-instance-specific metadata. This metadata must be constant for a single instance of the camera device, but may be different between open() calls. The returned camera_metadata pointer must be valid until the device close() method is called.

Version information:

CAMERA_DEVICE_API_VERSION_2_0:

Not available. Framework may not access this function pointer.

CAMERA_DEVICE_API_VERSION_2_1:

Valid. Can be called by the framework.

Definition at line 816 of file camera2.h.

int(* get_metadata_vendor_tag_ops)(const struct camera2_device *, vendor_tag_query_ops_t **ops)

Get methods to query for vendor extension metadata tag infomation. May set ops to NULL if no vendor extension tags are defined.

Definition at line 791 of file camera2.h.

int(* notify_request_queue_not_empty)(const struct camera2_device *)

Notify device that the request queue is no longer empty. Must only be called when the first buffer is added a new queue, or after the source has returned NULL in response to a dequeue call.

Definition at line 540 of file camera2.h.

int(* register_stream_buffers)(const struct camera2_device *, uint32_t stream_id, int num_buffers, buffer_handle_t *buffers)

Register buffers for a given stream. This is called after a successful allocate_stream call, and before the first request referencing the stream is enqueued. This method is intended to allow the HAL device to map or otherwise prepare the buffers for later use. num_buffers is guaranteed to be at least max_buffers (from allocate_stream), but may be larger. The buffers will already be locked for use. At the end of the call, all the buffers must be ready to be returned to the queue. If the stream format was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL should inspect the passed-in buffers here to determine any platform-private pixel format information.

Definition at line 653 of file camera2.h.

int(* release_reprocess_stream)(const struct camera2_device *, uint32_t stream_id)

Release a reprocessing stream. Returns an error if called when get_in_progress_count is non-zero, or if the stream id is not valid.

Definition at line 761 of file camera2.h.

int(* release_stream)(const struct camera2_device *, uint32_t stream_id)

Release a stream. Returns an error if called when get_in_progress_count is non-zero, or if the stream id is invalid.

Definition at line 663 of file camera2.h.

int(* set_frame_queue_dst_ops)(const struct camera2_device *, const camera2_frame_queue_dst_ops_t *frame_dst_ops)

Pass in output frame queue interface methods

Definition at line 545 of file camera2.h.

int(* set_notify_callback)(const struct camera2_device *, camera2_notify_callback notify_cb, void *user)

Notification callback setup

Definition at line 783 of file camera2.h.

int(* set_request_queue_src_ops)(const struct camera2_device *, const camera2_request_queue_src_ops_t *request_src_ops)

Pass in input request queue interface methods.

Definition at line 532 of file camera2.h.

int(* trigger_action)(const struct camera2_device *, uint32_t trigger_id, int32_t ext1, int32_t ext2)

Trigger asynchronous activity. This is used for triggering special behaviors of the camera 3A routines when they are in use. See the documentation for CAMERA2_TRIGGER_* above for details of the trigger ids and their arguments.

Definition at line 775 of file camera2.h.


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