libhardware/camera.h: camera HAL memory management updates

-- add a callback to camera_memory_t that can be used to free the requested
   memory
-- memory requests are in the form of N buffers S bytes each
-- data callbacks pass an index to a buffer in addition to the camera_memory
   pointer

Change-Id: I368139809f25a662d8895f205e3b87fa5046a4b2
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/include/hardware/camera.h b/include/hardware/camera.h
index 04fb6ec..20d58d4 100644
--- a/include/hardware/camera.h
+++ b/include/hardware/camera.h
@@ -62,13 +62,18 @@
     int (*get_camera_info)(int camera_id, struct camera_info *info);
 } camera_module_t;
 
+struct camera_memory;
+typedef void (*camera_release_memory)(struct camera_memory *mem);
+
 typedef struct camera_memory {
     void *data;
     size_t size;
     void *handle;
+    camera_release_memory release;
 } camera_memory_t;
 
-typedef camera_memory_t* (*camera_request_memory)(size_t size, void *user);
+typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs,
+                                                  void *user);
 
 typedef void (*camera_notify_callback)(int32_t msg_type,
         int32_t ext1,
@@ -76,12 +81,12 @@
         void *user);
 
 typedef void (*camera_data_callback)(int32_t msg_type,
-        const camera_memory_t *data,
+        const camera_memory_t *data, unsigned int index,
         void *user);
 
 typedef void (*camera_data_timestamp_callback)(int64_t timestamp,
         int32_t msg_type,
-        const camera_memory_t *data,
+        const camera_memory_t *data, unsigned int index,
         void *user);
 
 #define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d