Camera: HIDLized camera HALs, first set
* Common camera definitions (camera.common/1.0)
* Basic status codes, shared types
* Provider 2.4 API (camera.provider/2.4), including vendor tag APIs
* Enumerate and acquire camera device instances
* Mostly equivalent to legacy camera module v2.4.
* Device 1.0 API (camera.device/1.0)
* Mostly equivalent to legacy camera HAL v1.0.
* Device 3.2 API (camera.device/3.2)
* Mostly equivalent to legacy camera HAL v3.2.
* Metadata 3.2 API (camera.metadata/3.2)
* Definitions for valid metadata fields for device 3.2
Only the key initial interfaces are added; default implementations are
in a later CL. Other interfaces that will likely need to be added:
* Other provider minor versions
* Other device 3.x minor versions
Test: make -j32
Bug: 30985004
Bug: 32991603
Change-Id: I1c6a9a269bf45276055707bbc58cfc50d29fa919
diff --git a/camera/device/1.0/ICameraDeviceCallback.hal b/camera/device/1.0/ICameraDeviceCallback.hal
new file mode 100644
index 0000000..97014ee
--- /dev/null
+++ b/camera/device/1.0/ICameraDeviceCallback.hal
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.camera.device@1.0;
+
+interface ICameraDeviceCallback {
+
+ /**
+ * 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.
+ *
+ * @param msgType The type of the event.
+ * @param ext1 The first parameter for the event, if needed.
+ * @param ext2 The second parameter for the event, if needed.
+ */
+ notifyCallback(NotifyCallbackMsg msgType, int32_t ext1, int32_t ext2);
+
+ /**
+ * Define a memory buffer from the provided handle and size, and return a
+ * unique identifier for the HAL to use to reference it with.
+ *
+ * TODO(b/33269977): Ensure this aligns with design and performance goals.
+ *
+ * @param descriptor A native handle that must have exactly one file
+ * descriptor in it; the file descriptor must be memory mappable to
+ * bufferSize * bufferCount bytes.
+ * @param bufferSize The number of bytes a single buffer consists of.
+ * @param bufferCount The number of contiguous buffers that the descriptor
+ * contains.
+ *
+ * @return memId A integer identifier for this memory buffer, for use with
+ * data callbacks and unregistering memory.
+ */
+ registerMemory(handle descriptor, uint32_t bufferSize, uint32_t bufferCount)
+ generates (MemoryId memId);
+
+ /**
+ * Unregister a previously registered memory buffer
+ */
+ unregisterMemory(MemoryId memId);
+
+ /**
+ * Send a buffer of image data to the camera service
+ *
+ * @param msgType The kind of image buffer data this call represents.
+ * @param data A memory handle to the buffer containing the data.
+ * @param bufferIndex The offset into the memory handle where the buffer
+ * starts.
+ *
+ */
+ dataCallback(DataCallbackMsg msgType, MemoryId data, uint32_t bufferIndex);
+
+ /**
+ * Send a buffer of image data to the camera service, with a timestamp
+ *
+ * @param msgType The kind of image buffer data this call represents.
+ * @param data A memory handle to the buffer containing the data.
+ * @param bufferIndex The offset into the memory handle where the buffer
+ * starts.
+ * @param timestamp The time this buffer was captured by the camera, in
+ * nanoseconds.
+ *
+ */
+ dataCallbackTimestamp(DataCallbackMsg msgType, MemoryId data, uint32_t bufferIndex,
+ int64_t timestamp);
+
+};