Camera VTS: Remove unnecessary test of Y16 depth format
getAvailableOutputStreams() shouldn't unconditionally add Y16 stream
configurations. Instead, if the threshold being passed in is valid,
getAvailableOutputStreams() should use the threshold's format
instead.
Test: Run VTS on pixel; vendor testing.
Bug: 265984260
Change-Id: I3c8119c6032141bb6e2f95f060f014a13340d16b
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index b0ae20e..5ea6ae2 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -6318,8 +6318,6 @@
std::vector<AvailableStream>& outputStreams,
const AvailableStream* threshold,
bool maxResolution) {
- AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
- static_cast<int32_t>(PixelFormat::Y16)};
if (nullptr == staticMeta) {
return Status::ILLEGAL_ARGUMENT;
}
@@ -6345,8 +6343,12 @@
}
if(foundDepth == 0 && (0 == (depthEntry.count % 4))) {
- fillOutputStreams(&depthEntry, outputStreams, &depthPreviewThreshold,
- ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT);
+ AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+ static_cast<int32_t>(PixelFormat::Y16)};
+ const AvailableStream* depthThreshold =
+ (threshold != nullptr) ? threshold : &depthPreviewThreshold;
+ fillOutputStreams(&depthEntry, outputStreams, depthThreshold,
+ ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT);
}
return Status::OK;
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index 2c2f1b2..5a8bbdd 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -751,8 +751,6 @@
std::vector<AvailableStream>& outputStreams,
const AvailableStream* threshold,
bool maxResolution) {
- AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
- static_cast<int32_t>(PixelFormat::Y16)};
if (nullptr == staticMeta) {
return Status::ILLEGAL_ARGUMENT;
}
@@ -778,7 +776,11 @@
}
if (foundDepth == 0 && (0 == (depthEntry.count % 4))) {
- fillOutputStreams(&depthEntry, outputStreams, &depthPreviewThreshold,
+ AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
+ static_cast<int32_t>(PixelFormat::Y16)};
+ const AvailableStream* depthThreshold =
+ (threshold != nullptr) ? threshold : &depthPreviewThreshold;
+ fillOutputStreams(&depthEntry, outputStreams, depthThreshold,
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT);
}