Package: android.hardware.camera.device@1.0

ICameraDevicePreviewCallback

interface ICameraDevicePreviewCallback

Camera device HAL@1.0 preview stream operation interface.

Methods

dequeueBuffer

dequeueBuffer ()
generates (Status status, uint64_t bufferId, handle buffer, uint32_t stride)

Acquire a buffer to write a preview buffer into.

Details
Generates
status
The status code for this operation.If not OK, then buffer and stride must not be used.
bufferId
A unique ID for the returned buffer.
buffer
A handle to the buffer to write into.Must be non-null if the bufferId has not been seen by HAL before.Must be null if the bufferId is seen before.HAL must keep track of the bufferId to actual buffer handle mapping.
stride
The stride between two rows of pixels in this buffer.

enqueueBuffer

enqueueBuffer (uint64_t bufferId)
generates (Status status)

Send a filled preview buffer to its consumer.

Details
Parameters
bufferId
The bufferId of the preview buffer
Generates
status
The status code for this operation.

cancelBuffer

cancelBuffer (uint64_t bufferId)
generates (Status status)

Return a preview buffer unfilled.This buffer must not be sent on to the preview consumer as a valid buffer, but may be reused as if it were empty.

Details
Parameters
bufferId
The bufferId of the preview buffer
Generates
status
The status code for this operation.

setBufferCount

setBufferCount (uint32_t count)
generates (Status status)

Set the number of preview buffers needed by the HAL.

Details
Parameters
count
The maximum number of preview buffers to allocate.
Generates
status
The status code for this operation.

setBuffersGeometry

setBuffersGeometry (uint32_t w, uint32_t h, android.hardware.graphics.common@1.0::PixelFormat format)
generates (Status status)

Set the dimensions and format of future preview buffers.

The next buffer that is dequeued must match the requested size and format.

Details
Parameters
w
h
format
Generates
status

setCrop

setCrop (int32_t left, int32_t top, int32_t right, int32_t bottom)
generates (Status status)

Set the valid region of image data for the next buffer(s)to be enqueued.

Details
Parameters
left
top
right
bottom
Generates
status

setUsage

setUsage (BufferUsage usage)
generates (Status status)

Set the producer usage flags for the next buffer(s)to be enqueued.

Details
Parameters
usage
Generates
status

setSwapInterval

setSwapInterval (int32_t interval)
generates (Status status)

Set the expected buffering mode for the preview output.

Details
Parameters
interval
Generates
status

getMinUndequeuedBufferCount

getMinUndequeuedBufferCount ()
generates (Status status, uint32_t count)

Get the minimum number of buffers the preview consumer endpoint needs to hold for correct operation.

Details
Generates
status
count
The number of buffers the consumer has requested.

setTimestamp

setTimestamp (int64_t timestamp)
generates (Status status)

Set the timestamp for the next buffer to enqueue

Timestamps are measured in nanoseconds, and must be comparable and monotonically increasing between two frames in the same preview stream.They do not need to be comparable between consecutive or parallel preview streams, cameras, or app runs.

Details
Parameters
timestamp
The timestamp to set for future buffers.
Generates
status