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

Commit 4c77ca7b authored by Emilian Peev's avatar Emilian Peev Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: resolve merge conflicts of...

DO NOT MERGE: resolve merge conflicts of 458d1544 to tm-dev-plus-aosp am: 2b7ab9d3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/18605236



Change-Id: Id3659789c607b3806a5e22397723df6c639693d6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2bc728f1 2b7ab9d3
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -453,6 +453,28 @@ class Camera3Device :
                // Verify buffer caches
                std::vector<uint64_t> bufIds(offlineStream.circulatingBufferIds.begin(),
                        offlineStream.circulatingBufferIds.end());
                {
                    // Due to timing it is possible that we may not have any remaining pending
                    // capture requests that can update the caches on Hal side. This can result in
                    // buffer cache mismatch between the service and the Hal and must be accounted
                    // for.
                    std::lock_guard<std::mutex> l(mFreedBuffersLock);
                    for (const auto& it : mFreedBuffers) {
                        if (it.first == id) {
                            ALOGV("%s: stream ID %d buffer id %" PRIu64 " cache removal still "
                                    "pending", __FUNCTION__, id, it.second);
                            const auto& cachedEntry = std::find(bufIds.begin(), bufIds.end(),
                                    it.second);
                            if (cachedEntry != bufIds.end()) {
                                bufIds.erase(cachedEntry);
                            } else {
                                ALOGE("%s: stream ID %d buffer id %" PRIu64 " cache removal still "
                                        "pending however buffer is no longer in the offline stream "
                                        "info!", __FUNCTION__, id, it.second);
                            }
                        }
                    }
                }
                if (!verifyBufferIds(id, bufIds)) {
                    ALOGE("%s: stream ID %d buffer cache records mismatch!", __FUNCTION__, id);
                    return UNKNOWN_ERROR;