Merge "Implement CodecProfileLevel.{equals|hashCode}" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-12 17:45:57 +00:00
committed by Android (Google) Code Review

View File

@@ -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);
}
};
/**