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

Commit e75a2853 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Add support for composite stream combination queries

Composite streams only support existing surfaces during
stream combination queries.
Refactor the necessary logic and support both existing as
well as deferred composite stream queries.

Bug: 341403047
Test: Camera CTS
Change-Id: Idb6c7ec558c94fbf7fe3b18375aa858fee61be8c
parent 85c4fb21
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -517,6 +517,15 @@ bool DepthCompositeStream::isDepthCompositeStream(const sp<Surface> &surface) {
    return false;
}

bool DepthCompositeStream::isDepthCompositeStreamInfo(const OutputStreamInfo& streamInfo) {
    if ((streamInfo.dataSpace == static_cast<android_dataspace_t>(HAL_DATASPACE_DYNAMIC_DEPTH)) &&
            (streamInfo.format == HAL_PIXEL_FORMAT_BLOB)) {
        return true;
    }

    return false;
}

static bool setContains(std::unordered_set<int32_t> containerSet, int32_t value) {
    return containerSet.find(value) != containerSet.end();
}
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ public:
    ~DepthCompositeStream() override;

    static bool isDepthCompositeStream(const sp<Surface> &surface);
    static bool isDepthCompositeStreamInfo(const OutputStreamInfo& streamInfo);

    // CompositeStream overrides
    status_t createInternalStreams(const std::vector<sp<Surface>>& consumers,
+5 −0
Original line number Diff line number Diff line
@@ -94,6 +94,11 @@ HeicCompositeStream::~HeicCompositeStream() {
    mMainImageSurface.clear();
}

bool HeicCompositeStream::isHeicCompositeStreamInfo(const OutputStreamInfo& streamInfo) {
    return ((streamInfo.dataSpace == static_cast<android_dataspace_t>(HAL_DATASPACE_HEIF)) &&
            (streamInfo.format == HAL_PIXEL_FORMAT_BLOB));
}

bool HeicCompositeStream::isHeicCompositeStream(const sp<Surface> &surface) {
    ANativeWindow *anw = surface.get();
    status_t err;
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ public:
    ~HeicCompositeStream() override;

    static bool isHeicCompositeStream(const sp<Surface> &surface);
    static bool isHeicCompositeStreamInfo(const OutputStreamInfo& streamInfo);

    status_t createInternalStreams(const std::vector<sp<Surface>>& consumers,
            bool hasDeferredConsumer, uint32_t width, uint32_t height, int format,
+11 −2
Original line number Diff line number Diff line
@@ -520,6 +520,15 @@ bool JpegRCompositeStream::isJpegRCompositeStream(const sp<Surface> &surface) {
    return false;
}

bool JpegRCompositeStream::isJpegRCompositeStreamInfo(const OutputStreamInfo& streamInfo) {
    if ((streamInfo.format == HAL_PIXEL_FORMAT_BLOB) &&
            (streamInfo.dataSpace == static_cast<int>(kJpegRDataSpace))) {
        return true;
    }

    return false;
}

void JpegRCompositeStream::deriveDynamicRangeAndDataspace(int64_t dynamicProfile,
        int64_t* /*out*/dynamicRange, int64_t* /*out*/dataSpace) {
    if ((dynamicRange == nullptr) || (dataSpace == nullptr)) {
@@ -832,8 +841,8 @@ status_t JpegRCompositeStream::getCompositeStreamInfo(const OutputStreamInfo &st
    (*compositeOutput)[0].colorSpace =
        ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED;

    if (CameraProviderManager::isConcurrentDynamicRangeCaptureSupported(staticInfo,
                streamInfo.dynamicRangeProfile,
    if (CameraProviderManager::isConcurrentDynamicRangeCaptureSupported(
                staticInfo, dynamicRange,
                ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD)) {
        compositeOutput->push_back({});
        (*compositeOutput)[1].width = streamInfo.width;
Loading