From b903e3b18557b115263b3e819a3737a05fe00a5b Mon Sep 17 00:00:00 2001 From: Sergey Silkin Date: Mon, 14 Feb 2022 17:16:19 +0100 Subject: [PATCH] Use isHardwareAccelerated on Q+ Bug: none Change-Id: Ic3f478c5cde12e8a4d1d121749c0414b254a3ea3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251695 Reviewed-by: Stefan Holmer Commit-Queue: Sergey Silkin Cr-Commit-Position: refs/heads/main@{#36014} --- sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java b/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java index 9cd4aa2d37..2ac61cb6b0 100644 --- a/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java +++ b/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java @@ -195,6 +195,10 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory { // Returns true if the given MediaCodecInfo indicates a hardware module that is supported on the // current SDK. private boolean isHardwareSupportedInCurrentSdk(MediaCodecInfo info, VideoCodecMimeType type) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + return info.isHardwareAccelerated(); + } + switch (type) { case VP8: return isHardwareSupportedInCurrentSdkVp8(info);