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

Commit 2d716022 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix handling of H.263 level 45

H.263 level 45 only supports QCIF, so we shouldn't treat it as "higher"
than e.g. level 40, which also supports CIF.

Bug: 147922039
Test: CTS
Change-Id: I4a09b2362829b2f825dae7220155e14f54837b18
parent 9d7d8264
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -763,9 +763,15 @@ public final class MediaCodecInfo {
                int maxLevel = 0;
                for (CodecProfileLevel pl : profileLevels) {
                    if (pl.profile == profile && pl.level > maxLevel) {
                        // H.263 levels are not completely ordered:
                        // Level45 support only implies Level10 support
                        if (!mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_H263)
                                || pl.level != CodecProfileLevel.H263Level45
                                || maxLevel == CodecProfileLevel.H263Level10) {
                            maxLevel = pl.level;
                        }
                    }
                }
                levelCaps = createFromProfileLevel(mMime, profile, maxLevel);
                // remove profile from this format otherwise levelCaps.isFormatSupported will
                // get into this same conditon and loop forever.