camera: allow GPU usage for isSurfaceForHwVideoEncoder
Modern video encoders rely on GPU for some of their preprocessing, so video encoder buffers will be allocated with GPU usage set. Bug: 193772557 Bug: 204504047 Change-Id: I84b60fdd3f9d511b39185c1a31799f2b1514e166
This commit is contained in:
committed by
Rucha Katakwar
parent
92530e0a49
commit
959bb219da
@@ -78,7 +78,7 @@ public class SurfaceUtils {
|
||||
public static boolean isSurfaceForHwVideoEncoder(Surface surface) {
|
||||
checkNotNull(surface);
|
||||
long usageFlags = nativeDetectSurfaceUsageFlags(surface);
|
||||
long disallowedFlags = HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE | USAGE_HW_COMPOSER
|
||||
long disallowedFlags = USAGE_HW_COMPOSER
|
||||
| USAGE_RENDERSCRIPT | HardwareBuffer.USAGE_CPU_READ_OFTEN;
|
||||
long allowedFlags = HardwareBuffer.USAGE_VIDEO_ENCODE;
|
||||
boolean videoEncoderConsumer = ((usageFlags & disallowedFlags) == 0
|
||||
|
||||
Reference in New Issue
Block a user