Camera3: add camera3 buffer manager support
* Add camera buffer manager for buffer allocation and sharing management across
multiple streams. Only gralloc v0 implementation is done, v1 implementation is
pending. With this, the max mem footprint for multiple streams in the same
stream set will be the max buffer count x max buffer size.
* API1 client will still use the old bufferQueue code path, buffer manager
is only targeting at API2 clients.
* Prepare and teardown should work with buffer manager.
* Some existing code typo fix and cleanup (to fix the compiling warnings).
Bug: 25088440
Change-Id: I68b246faa43080302acd02a8e976384bd3e26a23
diff --git a/services/camera/libcameraservice/device3/Camera3StreamInterface.h b/services/camera/libcameraservice/device3/Camera3StreamInterface.h
index 54009ae..3f7e7a7 100644
--- a/services/camera/libcameraservice/device3/Camera3StreamInterface.h
+++ b/services/camera/libcameraservice/device3/Camera3StreamInterface.h
@@ -26,6 +26,20 @@
namespace camera3 {
+enum {
+ /**
+ * This stream set ID indicates that the set ID is invalid, and this stream doesn't intend to
+ * share buffers with any other stream. It is illegal to register this kind of stream to
+ * Camera3BufferManager.
+ */
+ CAMERA3_STREAM_SET_ID_INVALID = -1,
+
+ /**
+ * Invalid output stream ID.
+ */
+ CAMERA3_STREAM_ID_INVALID = -1,
+};
+
class StatusTracker;
/**
@@ -45,6 +59,11 @@
virtual int getId() const = 0;
/**
+ * Get the output stream set id.
+ */
+ virtual int getStreamSetId() const = 0;
+
+ /**
* Get the stream's dimensions and format
*/
virtual uint32_t getWidth() const = 0;