camera: Fix AIDL VTS test

The default value of a Stream's `dynamicRangeProfile` field is invalid,
which means the caller needs to set it to a sensible default with each
call. This CL updates the Stream creation in VTS test to use
`ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD`
wherever a Stream object was being created with implicit default.

Bug: 210912368
Test: Existing VTS tests now pass on Cuttlefish
Change-Id: Iaae2f6dfde852fc9c076a6029854ccdf8f68d39a
This commit is contained in:
Avichal Rakesh 2022-02-25 06:23:14 +00:00
parent 273583165c
commit d3503a349f
4 changed files with 150 additions and 88 deletions

View file

@ -36,6 +36,7 @@ using ::aidl::android::hardware::camera::common::CameraResourceCost;
using ::aidl::android::hardware::camera::common::TorchModeStatus;
using ::aidl::android::hardware::camera::common::VendorTagSection;
using ::aidl::android::hardware::camera::device::ICameraDevice;
using ::aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap;
using ::aidl::android::hardware::camera::metadata::SensorPixelMode;
using ::aidl::android::hardware::camera::provider::CameraIdAndStreamCombination;
using ::aidl::android::hardware::camera::provider::ICameraProviderCallbackDefault;
@ -488,7 +489,7 @@ TEST_P(CameraAidlTest, constructDefaultRequestSettings) {
ret = mSession->constructDefaultRequestSettings(reqTemplate, &rawMetadata);
ALOGI("constructDefaultRequestSettings returns status:%d:%d", ret.getExceptionCode(),
ret.getServiceSpecificError());
ASSERT_TRUE(ret.isOk());
if (reqTemplate == RequestTemplate::ZERO_SHUTTER_LAG ||
reqTemplate == RequestTemplate::MANUAL) {
// optional templates
@ -549,6 +550,8 @@ TEST_P(CameraAidlTest, configureStreamsAvailableOutputs) {
stream.usage = static_cast<aidl::android::hardware::graphics::common::BufferUsage>(
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER);
stream.rotation = StreamRotation::ROTATION_0;
stream.dynamicRangeProfile = RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD;
std::vector<Stream> streams = {stream};
StreamConfiguration config;
@ -626,6 +629,8 @@ TEST_P(CameraAidlTest, configureConcurrentStreamsAvailableOutputs) {
stream.dataSpace = dataspace;
stream.rotation = StreamRotation::ROTATION_0;
stream.sensorPixelModesUsed = {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT};
stream.dynamicRangeProfile = RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD;
streams[j] = stream;
j++;
}
@ -708,7 +713,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
int32_t streamConfigCounter = 0;
std::vector<Stream> streams = {stream};
StreamConfiguration config;
@ -737,7 +744,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
@ -761,7 +770,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
@ -784,7 +795,9 @@ TEST_P(CameraAidlTest, configureStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
@ -888,7 +901,9 @@ TEST_P(CameraAidlTest, configureStreamsZSLInputOutputs) {
std::string(),
jpegBufferSize,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
Stream inputStream = {
streamId++,
StreamType::INPUT,
@ -901,7 +916,9 @@ TEST_P(CameraAidlTest, configureStreamsZSLInputOutputs) {
std::string(),
jpegBufferSize,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
Stream outputStream = {
streamId++,
StreamType::OUTPUT,
@ -915,7 +932,9 @@ TEST_P(CameraAidlTest, configureStreamsZSLInputOutputs) {
std::string(),
jpegBufferSize,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
std::vector<Stream> streams = {inputStream, zslStream, outputStream};
@ -996,19 +1015,22 @@ TEST_P(CameraAidlTest, configureStreamsWithSessionParameters) {
&previewThreshold));
ASSERT_NE(0u, outputPreviewStreams.size());
Stream previewStream = {0,
StreamType::OUTPUT,
outputPreviewStreams[0].width,
outputPreviewStreams[0].height,
static_cast<PixelFormat>(outputPreviewStreams[0].format),
static_cast<aidl::android::hardware::graphics::common::BufferUsage>(
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER),
Dataspace::UNKNOWN,
StreamRotation::ROTATION_0,
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
Stream previewStream = {
0,
StreamType::OUTPUT,
outputPreviewStreams[0].width,
outputPreviewStreams[0].height,
static_cast<PixelFormat>(outputPreviewStreams[0].format),
static_cast<aidl::android::hardware::graphics::common::BufferUsage>(
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER),
Dataspace::UNKNOWN,
StreamRotation::ROTATION_0,
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
std::vector<Stream> streams = {previewStream};
StreamConfiguration config;
@ -1114,7 +1136,9 @@ TEST_P(CameraAidlTest, configureStreamsPreviewStillOutputs) {
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
Stream blobStream = {
streamId++,
StreamType::OUTPUT,
@ -1128,7 +1152,9 @@ TEST_P(CameraAidlTest, configureStreamsPreviewStillOutputs) {
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
std::vector<Stream> streams = {previewStream, blobStream};
StreamConfiguration config;
@ -1192,7 +1218,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) {
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
std::vector<Stream> streams = {stream};
StreamConfiguration config;
createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE,
@ -1220,7 +1248,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) {
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE,
&config);
@ -1244,7 +1274,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) {
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE,
&config);
@ -1266,7 +1298,9 @@ TEST_P(CameraAidlTest, configureStreamsConstrainedOutputs) {
std::string(),
/*bufferSize*/ 0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE,
&config);
@ -1341,7 +1375,9 @@ TEST_P(CameraAidlTest, configureStreamsVideoStillOutputs) {
std::string(),
jpegBufferSize,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
Stream blobStream = {
streamId++,
StreamType::OUTPUT,
@ -1355,7 +1391,9 @@ TEST_P(CameraAidlTest, configureStreamsVideoStillOutputs) {
std::string(),
jpegBufferSize,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
std::vector<Stream> streams = {videoStream, blobStream};
StreamConfiguration config;
@ -1817,9 +1855,7 @@ TEST_P(CameraAidlTest, process10BitDynamicRangeRequest) {
ASSERT_TRUE(ret.isOk());
continue;
}
std::vector<
aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap>
profileList;
std::vector<RequestAvailableDynamicRangeProfilesMap> profileList;
get10BitDynamicRangeProfiles(staticMeta, &profileList);
ASSERT_FALSE(profileList.empty());
@ -2652,7 +2688,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsAvailableOutputs) {
std::string(),
jpegBufferSize,
0,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
std::vector<Stream> streams = {stream};
StreamConfiguration config;
@ -2720,7 +2758,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
0,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
int32_t streamConfigCounter = 0;
std::vector<Stream> streams = {stream};
@ -2746,7 +2786,10 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
0,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
@ -2767,7 +2810,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
0,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
@ -2787,7 +2832,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsInvalidOutputs) {
std::string(),
jpegBufferSize,
0,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = stream;
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
@ -2869,7 +2916,9 @@ TEST_P(CameraAidlTest, configureInjectionStreamsWithSessionParameters) {
std::string(),
0,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
std::vector<Stream> streams = {previewStream};
StreamConfiguration config;
config.streams = streams;
@ -2940,22 +2989,21 @@ TEST_P(CameraAidlTest, configureStreamsUseCases) {
}
std::vector<Stream> streams(1);
streams[0] = {
0,
StreamType::OUTPUT,
outputPreviewStreams[0].width,
outputPreviewStreams[0].height,
static_cast<PixelFormat>(outputPreviewStreams[0].format),
static_cast<::aidl::android::hardware::graphics::common::BufferUsage>(
GRALLOC1_CONSUMER_USAGE_CPU_READ),
Dataspace::UNKNOWN,
StreamRotation::ROTATION_0,
std::string(),
0,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streams[0] = {0,
StreamType::OUTPUT,
outputPreviewStreams[0].width,
outputPreviewStreams[0].height,
static_cast<PixelFormat>(outputPreviewStreams[0].format),
static_cast<::aidl::android::hardware::graphics::common::BufferUsage>(
GRALLOC1_CONSUMER_USAGE_CPU_READ),
Dataspace::UNKNOWN,
StreamRotation::ROTATION_0,
std::string(),
0,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
int32_t streamConfigCounter = 0;
CameraMetadata req;

View file

@ -22,6 +22,7 @@
#include <HandleImporter.h>
#include <aidl/android/hardware/camera/device/ICameraDevice.h>
#include <aidl/android/hardware/camera/metadata/CameraMetadataTag.h>
#include <aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.h>
#include <aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.h>
#include <aidl/android/hardware/camera/metadata/SensorPixelMode.h>
#include <aidl/android/hardware/camera/provider/BnCameraProviderCallback.h>
@ -42,6 +43,7 @@ using ::aidl::android::hardware::camera::common::TorchModeStatus;
using ::aidl::android::hardware::camera::device::CameraMetadata;
using ::aidl::android::hardware::camera::device::ICameraDevice;
using ::aidl::android::hardware::camera::metadata::CameraMetadataTag;
using ::aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap;
using ::aidl::android::hardware::camera::metadata::SensorInfoColorFilterArrangement;
using ::aidl::android::hardware::camera::metadata::SensorPixelMode;
using ::aidl::android::hardware::camera::provider::BnCameraProviderCallback;
@ -356,6 +358,7 @@ Status CameraAidlTest::isMonochromeCamera(const camera_metadata_t* staticMeta) {
camera_metadata_ro_entry entry;
int rc = find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_AVAILABLE_CAPABILITIES,
&entry);
if (0 != rc) {
return Status::ILLEGAL_ARGUMENT;
}
@ -2141,6 +2144,10 @@ void CameraAidlTest::configureSingleStream(
reinterpret_cast<const camera_metadata_t*>(chars.metadata.data()));
ASSERT_NE(nullptr, staticMeta);
size_t expectedSize = chars.metadata.size();
ALOGE("validate_camera_metadata_structure: %d",
validate_camera_metadata_structure(staticMeta, &expectedSize));
camera_metadata_ro_entry entry;
auto status =
find_camera_metadata_ro_entry(staticMeta, ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &entry);
@ -2172,7 +2179,6 @@ void CameraAidlTest::configureSingleStream(
ASSERT_EQ(Status::OK, getJpegBufferSize(staticMeta, &jpegBufferSize));
ASSERT_NE(0u, jpegBufferSize);
free_camera_metadata(staticMeta);
ASSERT_EQ(Status::OK, rc);
ASSERT_FALSE(outputPreviewStreams.empty());
@ -2197,7 +2203,9 @@ void CameraAidlTest::configureSingleStream(
"",
0,
/*groupId*/ -1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
StreamConfiguration config;
config.streams = streams;
@ -2519,26 +2527,29 @@ void CameraAidlTest::configurePreviewStreams(
outputPreviewStreams.clear();
Status rc = getAvailableOutputStreams(staticMeta, outputPreviewStreams, previewThreshold);
free_camera_metadata(staticMeta);
ASSERT_EQ(Status::OK, rc);
ASSERT_FALSE(outputPreviewStreams.empty());
std::vector<Stream> streams(physicalIds.size());
int32_t streamId = 0;
for (auto const& physicalId : physicalIds) {
streams[streamId++] = {streamId,
StreamType::OUTPUT,
outputPreviewStreams[0].width,
outputPreviewStreams[0].height,
static_cast<PixelFormat>(outputPreviewStreams[0].format),
static_cast<aidl::android::hardware::graphics::common::BufferUsage>(
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER),
Dataspace::UNKNOWN,
StreamRotation::ROTATION_0,
physicalId,
0,
0,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
streams[streamId] = {streamId,
StreamType::OUTPUT,
outputPreviewStreams[0].width,
outputPreviewStreams[0].height,
static_cast<PixelFormat>(outputPreviewStreams[0].format),
static_cast<aidl::android::hardware::graphics::common::BufferUsage>(
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER),
Dataspace::UNKNOWN,
StreamRotation::ROTATION_0,
physicalId,
0,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
streamId++;
}
StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()};
@ -2580,13 +2591,15 @@ void CameraAidlTest::verifyBuffersReturned(const std::shared_ptr<ICameraDeviceSe
cb->waitForBuffersReturned();
}
void CameraAidlTest::configureStreams(
const std::string& name, const std::shared_ptr<ICameraProvider>& provider,
PixelFormat format, std::shared_ptr<ICameraDeviceSession>* session, Stream* previewStream,
std::vector<HalStream>* halStreams, bool* supportsPartialResults,
int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr<DeviceCb>* outCb,
uint32_t streamConfigCounter, bool maxResolution,
aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap prof) {
void CameraAidlTest::configureStreams(const std::string& name,
const std::shared_ptr<ICameraProvider>& provider,
PixelFormat format,
std::shared_ptr<ICameraDeviceSession>* session,
Stream* previewStream, std::vector<HalStream>* halStreams,
bool* supportsPartialResults, int32_t* partialResultCount,
bool* useHalBufManager, std::shared_ptr<DeviceCb>* outCb,
uint32_t streamConfigCounter, bool maxResolution,
RequestAvailableDynamicRangeProfilesMap prof) {
ASSERT_NE(nullptr, session);
ASSERT_NE(nullptr, halStreams);
ASSERT_NE(nullptr, previewStream);
@ -2612,6 +2625,7 @@ void CameraAidlTest::configureStreams(
ASSERT_TRUE(ret.isOk());
staticMeta = clone_camera_metadata(
reinterpret_cast<const camera_metadata_t*>(metadata.metadata.data()));
ASSERT_NE(staticMeta, nullptr);
camera_metadata_ro_entry entry;
auto status =
@ -2640,7 +2654,6 @@ void CameraAidlTest::configureStreams(
Size maxSize;
auto rc = getMaxOutputSizeForFormat(staticMeta, format, &maxSize, maxResolution);
ASSERT_EQ(Status::OK, rc);
free_camera_metadata(staticMeta);
std::vector<Stream> streams(1);
streams[0] = {0,
@ -2655,7 +2668,8 @@ void CameraAidlTest::configureStreams(
"",
0,
-1,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION},
{maxResolution ? SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION
: SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
prof};
StreamConfiguration config;
@ -2706,9 +2720,7 @@ bool CameraAidlTest::is10BitDynamicRangeCapable(const camera_metadata_t* staticM
void CameraAidlTest::get10BitDynamicRangeProfiles(
const camera_metadata_t* staticMeta,
std::vector<
aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap>*
profiles) {
std::vector<RequestAvailableDynamicRangeProfilesMap>* profiles) {
ASSERT_NE(nullptr, staticMeta);
ASSERT_NE(nullptr, profiles);
camera_metadata_ro_entry entry;
@ -2724,8 +2736,7 @@ void CameraAidlTest::get10BitDynamicRangeProfiles(
ASSERT_EQ(entries.find(entry.data.i64[i]), entries.end());
entries.insert(static_cast<int64_t>(entry.data.i64[i]));
profiles->emplace_back(
static_cast<aidl::android::hardware::camera::metadata::
RequestAvailableDynamicRangeProfilesMap>(entry.data.i64[i]));
static_cast<RequestAvailableDynamicRangeProfilesMap>(entry.data.i64[i]));
}
if (!entries.empty()) {
@ -2883,7 +2894,7 @@ void CameraAidlTest::configureOfflineStillStream(
currLargest = area;
}
}
free_camera_metadata(staticMeta);
ASSERT_EQ(Status::OK, rc);
ASSERT_FALSE(outputStreams.empty());
@ -2902,7 +2913,9 @@ void CameraAidlTest::configureOfflineStillStream(
/*physicalId*/ std::string(),
*jpegBufferSize,
/*groupId*/ 0,
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT}};
{SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()};

View file

@ -180,7 +180,8 @@ class CameraAidlTest : public ::testing::TestWithParam<std::string> {
uint32_t streamConfigCounter, bool maxResolution,
aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap
prof = ::aidl::android::hardware::camera::metadata::
RequestAvailableDynamicRangeProfilesMap(0));
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD);
void configurePreviewStreams(
const std::string& name, const std::shared_ptr<ICameraProvider>& provider,

View file

@ -380,7 +380,7 @@ bool DeviceCb::processCaptureResultLocked(
request->collectedResult.sort();
// Verify final result metadata
auto staticMetadataBuffer = mStaticMetadata;
camera_metadata_t* staticMetadataBuffer = mStaticMetadata;
bool isMonochrome = Status::OK == CameraAidlTest::isMonochromeCamera(staticMetadataBuffer);
if (isMonochrome) {
CameraAidlTest::verifyMonochromeCameraResult(request->collectedResult);