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

Commit 093cf050 authored by Toni Heidenreich's avatar Toni Heidenreich
Browse files

Remove level check from codec support check

The checks for codec profile and level were added to ensure only codecs with the correct profile are used to avoid unnecessary retries. However, level checks can be overly strict because codecs often support higher levels of the same profile. Enforcing these level checks means that some playbacks that could have been supported by a HW codec unnecessaily fallback to a SW codec. This change removes the level check to ensure the HW codec for the correct profile is always tried first before falling back to SW codecs.


Bug: 242671467
Change-Id: I0453cd67356ae4815aae56292c988b1c3f4973c9
parent 36acc831
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -511,8 +511,6 @@ bool MediaCodecList::codecHandlesFormat(const char *mime, sp<MediaCodecInfo> inf

        int32_t profile = -1;
        if (format->findInt32("profile", &profile)) {
            int32_t level = -1;
            format->findInt32("level", &level);
            Vector<MediaCodecInfo::ProfileLevel> profileLevels;
            capabilities->getSupportedProfileLevels(&profileLevels);
            auto it = profileLevels.begin();
@@ -520,14 +518,11 @@ bool MediaCodecList::codecHandlesFormat(const char *mime, sp<MediaCodecInfo> inf
                if (profile != it->mProfile) {
                    continue;
                }
                if (level > -1 && level > it->mLevel) {
                    continue;
                }
                break;
            }

            if (it == profileLevels.end()) {
                ALOGV("Codec does not support profile %d with level %d", profile, level);
                ALOGV("Codec does not support profile %d", profile);
                return false;
            }
        }