summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/Camera2Device.h
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-08-10 08:40:26 -0700
committerEino-Ville Talvala <etalvala@google.com>2012-08-14 11:31:27 -0700
commit8ce89d9e2b132bf58a030acec88acf0a998926a1 (patch)
tree00a9c5d1799d3ef29365c5c5596797dadf09a079 /services/camera/libcameraservice/Camera2Device.h
parent93b68548124ec9b01b9bf4ddf010afa06a503547 (diff)
downloadframeworks_av-8ce89d9e2b132bf58a030acec88acf0a998926a1.zip
frameworks_av-8ce89d9e2b132bf58a030acec88acf0a998926a1.tar.gz
frameworks_av-8ce89d9e2b132bf58a030acec88acf0a998926a1.tar.bz2
Camera2: Skeleton for output frame processing, plus face detect
- Plumbing for processing output metadata frames from the HAL - Support for passing face detection metadata from said frames to the application. - Switch calls on ICameraClient interface to use separate mutex to avoid deadlock scenarios with messages being communicated from the HAL to the camera user while calls from the user to the service are active. Bug: 6243944 Change-Id: Id4cf821d9c5c3c0069be4c0f669874b6ff0d1ecd
Diffstat (limited to 'services/camera/libcameraservice/Camera2Device.h')
-rw-r--r--services/camera/libcameraservice/Camera2Device.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/Camera2Device.h b/services/camera/libcameraservice/Camera2Device.h
index 9be370f..790b946 100644
--- a/services/camera/libcameraservice/Camera2Device.h
+++ b/services/camera/libcameraservice/Camera2Device.h
@@ -124,6 +124,27 @@ class Camera2Device : public virtual RefBase {
status_t setNotifyCallback(NotificationListener *listener);
/**
+ * Abstract class for HAL frame available notifications
+ */
+ class FrameListener {
+ public:
+ virtual void onNewFrameAvailable() = 0;
+ protected:
+ virtual ~FrameListener();
+ };
+
+ /**
+ * Set a frame listener to be notified about new frames.
+ */
+ status_t setFrameListener(FrameListener *listener);
+
+ /**
+ * Get next metadata frame from the frame queue. Returns NULL if the queue
+ * is empty; caller takes ownership of the metadata buffer.
+ */
+ status_t getNextFrame(camera_metadata_t **frame);
+
+ /**
* Trigger auto-focus. The latest ID used in a trigger autofocus or cancel
* autofocus call will be returned by the HAL in all subsequent AF
* notifications.
@@ -180,6 +201,7 @@ class Camera2Device : public virtual RefBase {
status_t dequeue(camera_metadata_t **buf, bool incrementCount = true);
int getBufferCount();
status_t waitForBuffer(nsecs_t timeout);
+ status_t setListener(FrameListener *listener);
// Set repeating buffer(s); if the queue is empty on a dequeue call, the
// queue copies the contents of the stream slot into the queue, and then
@@ -208,6 +230,7 @@ class Camera2Device : public virtual RefBase {
List<camera_metadata_t*> mStreamSlot;
bool mSignalConsumer;
+ FrameListener *mListener;
static MetadataQueue* getInstance(
const camera2_frame_queue_dst_ops_t *q);