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

Commit 59839fae authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "MediaCodec: update the resource availability" into main

parents 4a1e6e3a 6e9f75cc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ c2_status_t queryGlobalResources(const std::shared_ptr<Codec2Client>& client,
                    } else {
                        ALOGW("Excluded resources(%jd) can't be more than Available resources(%jd)",
                              excluded, found->mAvailable);
                        found->mAvailable = 0;
                    }
                } else {
                    ALOGW("Failed to find the resource [%s]", name.c_str());
+4 −3
Original line number Diff line number Diff line
@@ -1248,15 +1248,16 @@ status_t MediaCodec::getGloballyAvailableResources(std::vector<GlobalResourceInf
                                         return item.type == type; });

            if (used != currentResourceUsage.end() && used->value > 0) {
                // Exclude the used resources.
                if (res.mAvailable < used->value) {
                    ALOGW("%s: Resources used (%jd) is more than the Resource Capacity (%jd)!",
                          __func__, used->value, res.mAvailable);
                    continue;
                }
                // Exclude the used resources.
                    res.mAvailable = 0;
                } else {
                    res.mAvailable -= used->value;
                }
            }
        }

        return OK;
    }