-
-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite MediaCodecCapabilitiesTest in Kotlin #2015
Rewrite MediaCodecCapabilitiesTest in Kotlin #2015
Conversation
CodecProfileLevel.AVCLevel4 | ||
) | ||
|
||
private fun hasDecoder(mime: String, profile: Int, level: Int): Boolean { |
Check notice
Code scanning
Excessive nesting leads to hidden complexity. Prefer extracting code to make it easier to understand.
// H.263 levels are not completely ordered: | ||
// Level45 support only implies Level10 support | ||
if (mime.equals(MediaFormat.MIMETYPE_VIDEO_H263, ignoreCase = true)) { | ||
if (profileLevel.level != level && profileLevel.level == CodecProfileLevel.H263Level45 && level > CodecProfileLevel.H263Level10) { |
Check notice
Code scanning
Line detected, which is longer than the defined maximum line length in the code style.
for (profileLevel in capabilities.profileLevels) { | ||
if (profileLevel.profile != profile) continue | ||
|
||
// H.263 levels are not completely ordered: | ||
// Level45 support only implies Level10 support | ||
if (mime.equals(MediaFormat.MIMETYPE_VIDEO_H263, ignoreCase = true)) { | ||
if (profileLevel.level != level && profileLevel.level == CodecProfileLevel.H263Level45 && level > CodecProfileLevel.H263Level10) { | ||
continue | ||
} | ||
} | ||
|
||
if (profileLevel.level >= level) return true | ||
} |
Check notice
Code scanning
The loop contains more than one break or continue statement. The code should be refactored to increase readability.
a361051
to
e9bba78
Compare
Changes
Issues