camera: Add IsOutputZslStream() to utils
Test: Pixel 4 Camera Test Checklist
Bug: 145317380
Change-Id: Id0c8714212c20b64e54ce8467ec95d7a63b8347d
diff --git a/common/hal/utils/utils.cc b/common/hal/utils/utils.cc
index 692daf5..72eb1b5 100644
--- a/common/hal/utils/utils.cc
+++ b/common/hal/utils/utils.cc
@@ -60,6 +60,16 @@
return false;
}
+bool IsOutputZslStream(const Stream& stream) {
+ if (stream.stream_type == StreamType::kOutput &&
+ (stream.usage & GRALLOC_USAGE_HW_CAMERA_ZSL) ==
+ GRALLOC_USAGE_HW_CAMERA_ZSL) {
+ return true;
+ }
+
+ return false;
+}
+
bool IsVideoStream(const Stream& stream) {
if (stream.stream_type == StreamType::kOutput &&
(stream.usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) != 0) {
diff --git a/common/hal/utils/utils.h b/common/hal/utils/utils.h
index 01476ac..6e69377 100644
--- a/common/hal/utils/utils.h
+++ b/common/hal/utils/utils.h
@@ -31,6 +31,7 @@
bool IsArbitraryDataSpaceRawStream(const Stream& stream);
bool IsYUVSnapshotStream(const Stream& stream);
bool IsDepthStream(const Stream& stream);
+bool IsOutputZslStream(const Stream& stream);
status_t GetSensorPhysicalSize(const HalCameraMetadata* characteristics,
float* width, float* height);