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

Commit 4c9fcc72 authored by Shuzhen Wang's avatar Shuzhen Wang Committed by android-build-merger
Browse files

Merge "Camera: Avoid Metadata re-allocation during shrinkCaptureResult" into pi-dev am: 62e310cb

am: a7a4f5bd

Change-Id: Id84b160a1bcbdb8a1c9f0d062ecabe1f8a30c871
parents 1be9461f a7a4f5bd
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1391,6 +1391,8 @@ void CameraDeviceSession::sShrinkCaptureResult(
        std::vector<const camera_metadata_t*>* physCamMdArray,
        std::vector<const camera_metadata_t*>* physCamMdArray,
        bool handlePhysCam) {
        bool handlePhysCam) {
    *dst = *src;
    *dst = *src;
    // Reserve maximum number of entries to avoid metadata re-allocation.
    mds->reserve(1 + (handlePhysCam ? src->num_physcam_metadata : 0));
    if (sShouldShrink(src->result)) {
    if (sShouldShrink(src->result)) {
        mds->emplace_back(sCreateCompactCopy(src->result));
        mds->emplace_back(sCreateCompactCopy(src->result));
        dst->result = mds->back().getAndLock();
        dst->result = mds->back().getAndLock();