Camera: Combine handling of deferred surface and shared surface
- Refactor the OutputConfiguration to contain isDeferred and isShared
flag, and not contain NULL surface.
- Unify the handling of deferred surface and shared surface.
Test: Camera CTS, and manual testing of GoogleCamera use cases
Bug: 33777818
Change-Id: I5dd3472f0f2133699b0e9fbdd8ba456956222746
diff --git a/services/camera/libcameraservice/common/CameraDeviceBase.h b/services/camera/libcameraservice/common/CameraDeviceBase.h
index a873402..98a3fcc 100644
--- a/services/camera/libcameraservice/common/CameraDeviceBase.h
+++ b/services/camera/libcameraservice/common/CameraDeviceBase.h
@@ -121,7 +121,7 @@
uint32_t width, uint32_t height, int format,
android_dataspace dataSpace, camera3_stream_rotation_t rotation, int *id,
int streamSetId = camera3::CAMERA3_STREAM_SET_ID_INVALID,
- uint32_t consumerUsage = 0) = 0;
+ bool isShared = false, uint32_t consumerUsage = 0) = 0;
/**
* Create an output stream of the requested size, format, rotation and
@@ -134,7 +134,7 @@
bool hasDeferredConsumer, uint32_t width, uint32_t height, int format,
android_dataspace dataSpace, camera3_stream_rotation_t rotation, int *id,
int streamSetId = camera3::CAMERA3_STREAM_SET_ID_INVALID,
- uint32_t consumerUsage = 0) = 0;
+ bool isShared = false, uint32_t consumerUsage = 0) = 0;
/**
* Create an input stream of width, height, and format.
@@ -341,7 +341,8 @@
/**
* Set the deferred consumer surface and finish the rest of the stream configuration.
*/
- virtual status_t setConsumerSurface(int streamId, sp<Surface> consumer) = 0;
+ virtual status_t setConsumerSurfaces(int streamId,
+ const std::vector<sp<Surface>>& consumers) = 0;
};