Skip to content

Commit

Permalink
Remove Android version check for software canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn committed Aug 12, 2024
1 parent 5b00207 commit 3c0ae2f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ internal class SimpleVideoEncoder(

fun encode(image: Bitmap) {
// it seems that Xiaomi devices have problems with hardware canvas, so we have to use
// lockCanvas instead (Android 12 or above)
val canvas = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && Build.MANUFACTURER.contains("xiaomi", ignoreCase = true)) {
// lockCanvas instead
val canvas = if (Build.MANUFACTURER.contains("xiaomi", ignoreCase = true)) {
surface?.lockCanvas(null)
} else {
surface?.lockHardwareCanvas()
Expand Down

0 comments on commit 3c0ae2f

Please sign in to comment.