camera3: Pass consumer information in configure_streams
HALs seem to need to know the gralloc usage flags of the opposite
endpoint (producer/consumer) of a stream at configure time.
Instead of adding another call to pass stream information, we just
pass the usage flags in the existing usage field.
Change-Id: I745baf2c4dd9123273d811b9bd52ae68c854b70c
diff --git a/include/hardware/camera3.h b/include/hardware/camera3.h
index 3a900fc..f9b63f4 100644
--- a/include/hardware/camera3.h
+++ b/include/hardware/camera3.h
@@ -82,6 +82,10 @@
* management. Bidirectional streams replace STREAM_FROM_STREAM construct.
*
* - Limited mode semantics for older/limited hardware devices.
+ *
+ * 3.1: Minor revision of expanded-capability HAL:
+ *
+ * - configure_streams passes consumer usage flags to the HAL.
*/
/**
@@ -1041,6 +1045,9 @@
* remain valid as if configure_streams() had not been called.
*
* The endpoint of the stream is not visible to the camera HAL device.
+ * In DEVICE_API_VERSION_3_1, this was changed to share consumer usage flags
+ * on streams where the camera is a producer (OUTPUT and BIDIRECTIONAL stream
+ * types) see the usage field below.
*/
typedef struct camera3_stream {
@@ -1092,6 +1099,25 @@
* the producer and the consumer will be combined together and then passed
* to the platform gralloc HAL module for allocating the gralloc buffers for
* each stream.
+ *
+ * Version information:
+ *
+ * == CAMERA_DEVICE_API_VERSION_3_0:
+ *
+ * No initial value guaranteed when passed via configure_streams().
+ * HAL may not use this field as input, and must write over this field
+ * with its usage flags.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * For stream_type OUTPUT and BIDIRECTIONAL, when passed via
+ * configure_streams(), the initial value of this is the consumer's
+ * usage flags. The HAL may use these consumer flags to decide stream
+ * configuration.
+ * For stream_type INPUT, when passed via configure_streams(), the initial
+ * value of this is 0.
+ * For all streams passed via configure_streams(), the HAL must write
+ * over this field with its usage flags.
*/
uint32_t usage;