Camera service: Add support for camera.device@3.3
Support overriding the dataSpace field if the HAL does so.
Test: Camera CTS passes
Bug: 62358514
Change-Id: I4c22237ebbf8c54afc0d0b202098f6530d8ec7f8
diff --git a/services/camera/libcameraservice/common/CameraDeviceBase.h b/services/camera/libcameraservice/common/CameraDeviceBase.h
index fe4c8d7..3919bfa 100644
--- a/services/camera/libcameraservice/common/CameraDeviceBase.h
+++ b/services/camera/libcameraservice/common/CameraDeviceBase.h
@@ -145,23 +145,42 @@
struct StreamInfo {
uint32_t width;
uint32_t height;
+
uint32_t format;
bool formatOverridden;
uint32_t originalFormat;
+
android_dataspace dataSpace;
+ bool dataSpaceOverridden;
+ android_dataspace originalDataSpace;
+
StreamInfo() : width(0), height(0), format(0), formatOverridden(false), originalFormat(0),
- dataSpace(HAL_DATASPACE_UNKNOWN) {}
+ dataSpace(HAL_DATASPACE_UNKNOWN), dataSpaceOverridden(false),
+ originalDataSpace(HAL_DATASPACE_UNKNOWN) {}
/**
* Check whether the format matches the current or the original one in case
* it got overridden.
*/
- bool matchFormat(uint32_t clientFormat) {
+ bool matchFormat(uint32_t clientFormat) const {
if ((formatOverridden && (originalFormat == clientFormat)) ||
(format == clientFormat)) {
return true;
}
return false;
}
+
+ /**
+ * Check whether the dataspace matches the current or the original one in case
+ * it got overridden.
+ */
+ bool matchDataSpace(android_dataspace clientDataSpace) const {
+ if ((dataSpaceOverridden && (originalDataSpace == clientDataSpace)) ||
+ (dataSpace == clientDataSpace)) {
+ return true;
+ }
+ return false;
+ }
+
};
/**