Skip to content

Commit

Permalink
fix: Fix "Invalid pixel format 35" HardwareBuffer crash (mrousavy#2547)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy authored Feb 13, 2024
1 parent a599592 commit d1c321c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ class VideoPipeline(
@RequiresApi(Build.VERSION_CODES.Q)
private fun supportsHardwareBufferFlags(flags: Long): Boolean {
val hardwareBufferFormat = format.toHardwareBufferFormat()
return HardwareBuffer.isSupported(width, height, hardwareBufferFormat, 1, flags)
try {
return HardwareBuffer.isSupported(width, height, hardwareBufferFormat, 1, flags)
} catch (_: Throwable) {
return false
}
}

private external fun getInputTextureId(): Int
Expand Down

0 comments on commit d1c321c

Please sign in to comment.