camera2_stream_ops Struct Reference

camera2_stream_ops Struct Reference

#include < camera2.h >

Data Fields

int(*  dequeue_buffer )(const struct camera2_stream_ops *w, buffer_handle_t **buffer)
int(*  enqueue_buffer )(const struct camera2_stream_ops *w, int64_t timestamp, buffer_handle_t *buffer)
int(*  cancel_buffer )(const struct camera2_stream_ops *w, buffer_handle_t *buffer)
int(*  set_crop )(const struct camera2_stream_ops *w, int left, int top, int right, int bottom)

Detailed Description

Output image stream queue interface. A set of these methods is provided to the HAL device in allocate_stream(), and are used to interact with the gralloc buffer queue for that stream. They may not be called until after allocate_stream returns.

Definition at line 73 of file camera2.h .

Field Documentation

int(* cancel_buffer)(const struct camera2_stream_ops *w, buffer_handle_t *buffer)

Return a buffer to the queue without marking it as filled.

Definition at line 102 of file camera2.h .

int(* dequeue_buffer)(const struct camera2_stream_ops *w, buffer_handle_t **buffer)

Get a buffer to fill from the queue. The size and format of the buffer are fixed for a given stream (defined in allocate_stream), and the stride should be queried from the platform gralloc module. The gralloc buffer will have been allocated based on the usage flags provided by allocate_stream, and will be locked for use.

Definition at line 81 of file camera2.h .

int(* enqueue_buffer)(const struct camera2_stream_ops *w, int64_t timestamp, buffer_handle_t *buffer)

Push a filled buffer to the stream to be used by the consumer.

The timestamp represents the time at start of exposure of the first row of the image; it must be from a monotonic clock, and is measured in nanoseconds. The timestamps do not need to be comparable between different cameras, or consecutive instances of the same camera. However, they must be comparable between streams from the same camera. If one capture produces buffers for multiple streams, each stream must have the same timestamp for that buffer, and that timestamp must match the timestamp in the output frame metadata.

Definition at line 96 of file camera2.h .

int(* set_crop)(const struct camera2_stream_ops *w, int left, int top, int right, int bottom)

Set the crop window for subsequently enqueued buffers. The parameters are measured in pixels relative to the buffer width and height.

Definition at line 108 of file camera2.h .

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