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

Commit 62b01c7d authored by Wonsik Kim's avatar Wonsik Kim
Browse files

Implement CodecProfileLevel.{equals|hashCode}

Bug: 74435947
Test: atest CtsMediaTestCases:MediaCodecListTest
Change-Id: Ia77182538c5a151bb561f7d273f7cbaa29671a4c
parent 9aefc4fc
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -3078,6 +3078,23 @@ public final class MediaCodecInfo {
         * {@link VideoCapabilities} to determine the codec capabilities.
         */
        public int level;

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (obj instanceof CodecProfileLevel) {
                CodecProfileLevel other = (CodecProfileLevel)obj;
                return other.profile == profile && other.level == level;
            }
            return false;
        }

        @Override
        public int hashCode() {
            return Long.hashCode(((long)profile << Integer.SIZE) | level);
        }
    };

    /**