Camera: Set arbitrary dataspace for RAW streams
Use 'arbitrary' dataspace when trying to configure RAW streams. Bug: 179158925 Test: run vts -m VtsHalCameraProviderV2_4TargetTest Change-Id: I1faa29bea3df91a34ba87ec2c7ecb9a17bd7a4e2
This commit is contained in:
parent
1df025e5f4
commit
2bb7e8a59b
1 changed files with 24 additions and 34 deletions
|
@ -888,6 +888,8 @@ public:
|
|||
static Status getSystemCameraKind(const camera_metadata_t* staticMeta,
|
||||
SystemCameraKind* systemCameraKind);
|
||||
|
||||
static V3_2::DataspaceFlags getDataspace(PixelFormat format);
|
||||
|
||||
void processCaptureRequestInternal(uint64_t bufferusage, RequestTemplate reqTemplate,
|
||||
bool useSecureOnlyCameras);
|
||||
|
||||
|
@ -3178,7 +3180,6 @@ TEST_P(CameraHidlTest, constructDefaultRequestSettings) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Verify that all supported stream formats and sizes can be configured
|
||||
// successfully.
|
||||
TEST_P(CameraHidlTest, configureStreamsAvailableOutputs) {
|
||||
|
@ -3221,17 +3222,7 @@ TEST_P(CameraHidlTest, configureStreamsAvailableOutputs) {
|
|||
uint32_t streamConfigCounter = 0;
|
||||
for (auto& it : outputStreams) {
|
||||
V3_2::Stream stream3_2;
|
||||
V3_2::DataspaceFlags dataspaceFlag = 0;
|
||||
switch (static_cast<PixelFormat>(it.format)) {
|
||||
case PixelFormat::BLOB:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::V0_JFIF);
|
||||
break;
|
||||
case PixelFormat::Y16:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::DEPTH);
|
||||
break;
|
||||
default:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::UNKNOWN);
|
||||
}
|
||||
V3_2::DataspaceFlags dataspaceFlag = getDataspace(static_cast<PixelFormat>(it.format));
|
||||
stream3_2 = {streamId,
|
||||
StreamType::OUTPUT,
|
||||
static_cast<uint32_t>(it.width),
|
||||
|
@ -3351,17 +3342,8 @@ TEST_P(CameraHidlTest, configureConcurrentStreamsAvailableOutputs) {
|
|||
size_t j = 0;
|
||||
for (const auto& it : outputStreams) {
|
||||
V3_2::Stream stream3_2;
|
||||
V3_2::DataspaceFlags dataspaceFlag = 0;
|
||||
switch (static_cast<PixelFormat>(it.format)) {
|
||||
case PixelFormat::BLOB:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::V0_JFIF);
|
||||
break;
|
||||
case PixelFormat::Y16:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::DEPTH);
|
||||
break;
|
||||
default:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::UNKNOWN);
|
||||
}
|
||||
V3_2::DataspaceFlags dataspaceFlag = getDataspace(
|
||||
static_cast<PixelFormat>(it.format));
|
||||
stream3_2 = {streamId++,
|
||||
StreamType::OUTPUT,
|
||||
static_cast<uint32_t>(it.width),
|
||||
|
@ -5901,6 +5883,23 @@ Status CameraHidlTest::getSystemCameraKind(const camera_metadata_t* staticMeta,
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Select an appropriate dataspace given a specific pixel format.
|
||||
V3_2::DataspaceFlags CameraHidlTest::getDataspace(PixelFormat format) {
|
||||
switch (format) {
|
||||
case PixelFormat::BLOB:
|
||||
return static_cast<V3_2::DataspaceFlags>(Dataspace::V0_JFIF);
|
||||
case PixelFormat::Y16:
|
||||
return static_cast<V3_2::DataspaceFlags>(Dataspace::DEPTH);
|
||||
case PixelFormat::RAW16:
|
||||
case PixelFormat::RAW_OPAQUE:
|
||||
case PixelFormat::RAW10:
|
||||
case PixelFormat::RAW12:
|
||||
return static_cast<V3_2::DataspaceFlags>(Dataspace::ARBITRARY);
|
||||
default:
|
||||
return static_cast<V3_2::DataspaceFlags>(Dataspace::UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether this is a monochrome camera using the static camera characteristics.
|
||||
Status CameraHidlTest::isMonochromeCamera(const camera_metadata_t *staticMeta) {
|
||||
Status ret = Status::METHOD_NOT_SUPPORTED;
|
||||
|
@ -6275,17 +6274,8 @@ void CameraHidlTest::configureOfflineStillStream(const std::string &name,
|
|||
ASSERT_EQ(Status::OK, rc);
|
||||
ASSERT_FALSE(outputStreams.empty());
|
||||
|
||||
V3_2::DataspaceFlags dataspaceFlag = 0;
|
||||
switch (static_cast<PixelFormat>(outputStreams[idx].format)) {
|
||||
case PixelFormat::BLOB:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::V0_JFIF);
|
||||
break;
|
||||
case PixelFormat::Y16:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::DEPTH);
|
||||
break;
|
||||
default:
|
||||
dataspaceFlag = static_cast<V3_2::DataspaceFlags>(Dataspace::UNKNOWN);
|
||||
}
|
||||
V3_2::DataspaceFlags dataspaceFlag = getDataspace(
|
||||
static_cast<PixelFormat>(outputStreams[idx].format));
|
||||
|
||||
::android::hardware::hidl_vec<V3_4::Stream> streams3_4(/*size*/1);
|
||||
V3_4::Stream stream3_4 = {{ 0 /*streamId*/, StreamType::OUTPUT,
|
||||
|
|
Loading…
Reference in a new issue