Package: android.hardware.camera.device@1.0

ICameraDeviceCallback

interface ICameraDeviceCallback

Methods

notifyCallback

notifyCallback (NotifyCallbackMsg msgType, int32_t ext1, int32_t ext2)

Notify the camera service of a particular event occurring The meaning of each parameter is defined by the value of msgType, and documented in the definition of NotifyCallbackMsg.

Details
Parameters
msgType
The type of the event.
ext1
The first parameter for the event, if needed.
ext2
The second parameter for the event, if needed.

registerMemory

registerMemory (handle descriptor, uint32_t bufferSize, uint32_t bufferCount)
generates (MemoryId memId)

Define a memory buffer from the provided handle and size, and return a unique identifier for the HAL to use to reference it with.

Details
Parameters
descriptor
A native handle that must have exactly one file descriptor in it;the file descriptor must be memory mappable to bufferSize * bufferCount bytes.
bufferSize
The number of bytes a single buffer consists of.
bufferCount
The number of contiguous buffers that the descriptor contains.
Generates
memId
A positive integer identifier for this memory buffer, for use with data callbacks and unregistering memory.0 must be returned in case of error, such as if the descriptor does not contain exactly one FD.

unregisterMemory

unregisterMemory (MemoryId memId)

Unregister a previously registered memory buffer

Details
Parameters
memId

dataCallback

dataCallback (DataCallbackMsg msgType, MemoryId data, uint32_t bufferIndex, CameraFrameMetadata metadata)

Send a buffer of image data to the camera service

Details
Parameters
msgType
The kind of image buffer data this call represents.
data
A memory handle to the buffer containing the data.
bufferIndex
The offset into the memory handle where the buffer starts.
metadata

dataCallbackTimestamp

dataCallbackTimestamp (DataCallbackMsg msgType, MemoryId data, uint32_t bufferIndex, int64_t timestamp)

Send a buffer of image data to the camera service, with a timestamp

Details
Parameters
msgType
The kind of image buffer data this call represents.
data
A memory handle to the buffer containing the data.
bufferIndex
The offset into the memory handle where the buffer starts.
timestamp
The time this buffer was captured by the camera, in nanoseconds.

handleCallbackTimestamp

handleCallbackTimestamp (DataCallbackMsg msgType, handle frameData, MemoryId data, uint32_t bufferIndex, int64_t timestamp)

Send a buffer of image data to the camera service, with a timestamp

Details
Parameters
msgType
The kind of image buffer data this call represents.
frameData
data
A memory handle to the buffer containing the data.
bufferIndex
The offset into the memory handle where the buffer starts.
timestamp
The time this buffer was captured by the camera, in nanoseconds.

handleCallbackTimestampBatch

handleCallbackTimestampBatch (DataCallbackMsg msgType, vec<HandleTimestampMessage> batch)

Send a batch of image data buffer to the camera service, with timestamps

This callback can be used to send multiple frames to camera framework in one callback, which reduce number of callbacks in performance intensive use cases, such as high speed video recording.The HAL must not mix use of this method with handleCallbackTimestamp in one recording session(between startRecording and stopRecording)

Details
Parameters
msgType
The kind of image buffer data this call represents.
batch
a vector messages.Each message contains a image buffer and a timestamp.The messages must be ordered in time from lower index to higher index, so that timestamp of i-th message is always smaller than i+1-th message.