fix: Fix crash on Samsung devices when using frameProcessor with YUV format (#2108)

Co-authored-by: rodrigo gomes <rodrigo.gomes@gamersafer.com>
This commit is contained in:
Rodrigo Gomes 2023-11-09 07:23:37 -03:00 committed by GitHub
parent 8f986a45ea
commit 1d13db25e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,8 +92,8 @@ class VideoPipeline(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Log.i(TAG, "Using API 29 for GPU ImageReader...") Log.i(TAG, "Using API 29 for GPU ImageReader...")
// GPU_SAMPLED because we redirect to OpenGL, CPU_READ because we read pixels before that. // GPU_SAMPLED because we redirect to OpenGL
val usage = HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE or HardwareBuffer.USAGE_CPU_READ_OFTEN val usage = HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE
imageReader = ImageReader.newInstance(width, height, format, MAX_IMAGES, usage) imageReader = ImageReader.newInstance(width, height, format, MAX_IMAGES, usage)
imageWriter = ImageWriter.newInstance(glSurface, MAX_IMAGES, format) imageWriter = ImageWriter.newInstance(glSurface, MAX_IMAGES, format)
} else { } else {