Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd3c483a authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

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
parent c9fa6a8e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -6318,8 +6318,6 @@ Status CameraHidlTest::getAvailableOutputStreams(const camera_metadata_t* static
                                                 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,7 +6343,11 @@ Status CameraHidlTest::getAvailableOutputStreams(const camera_metadata_t* static
    }

    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);
    }

+5 −3
Original line number Diff line number Diff line
@@ -751,8 +751,6 @@ Status CameraAidlTest::getAvailableOutputStreams(const camera_metadata_t* static
                                                 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 @@ Status CameraAidlTest::getAvailableOutputStreams(const camera_metadata_t* static
    }

    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);
    }