tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ae45ac5a963f8b0397243ca0f9f314302ec4dcb7
parent bb0a1dc041c8f8aa7f4482982f740fdfb240f34d
Author: Andrew Osmond <aosmond@gmail.com>
Date:   Wed, 24 Dec 2025 03:56:25 +0000

Bug 2005011 - Part 1. Expose AV1 and HEVC hardware codec support on Android. r=geckoview-reviewers,media-playback-reviewers,tcampbell,padenot

This will allow our reporting to be accurate about what the platform
actually supports in hardware.

Differential Revision: https://phabricator.services.mozilla.com/D275719

Diffstat:
Mmobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareCodecCapabilityUtils.java | 24+++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareCodecCapabilityUtils.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareCodecCapabilityUtils.java @@ -41,8 +41,8 @@ public final class HardwareCodecCapabilityUtils { "OMX.rk." }; private static final String VP9_MIME_TYPE = "video/x-vnd.on2.vp9"; - // List of supported HW H.264 codecs. - private static final String[] supportedH264HwCodecPrefixes = { + // List of supported HW AV1/HEVC/H.264 codecs. + private static final String[] supportedGenericHwCodecPrefixes = { "OMX.qcom.", "OMX.Intel.", "OMX.Exynos.", @@ -303,8 +303,10 @@ public final class HardwareCodecCapabilityUtils { // Check if MIME type string has HW prefix (encode or decode, VP8, VP9, and H264) private static String[] getSupportedHWCodecPrefixes( final String aMimeType, final boolean aIsEncoder) { - if (aMimeType.equals(H264_MIME_TYPE)) { - return supportedH264HwCodecPrefixes; + if (aMimeType.equals(H264_MIME_TYPE) + || aMimeType.equals(HEVC_MIME_TYPE) + || aMimeType.equals(AV1_MIME_TYPE)) { + return supportedGenericHwCodecPrefixes; } if (aMimeType.equals(VP9_MIME_TYPE)) { return supportedVp9HwCodecPrefixes; @@ -318,7 +320,9 @@ public final class HardwareCodecCapabilityUtils { // Return list of HW codec prefixes (encode or decode, VP8, VP9, and H264) private static String[] getAllSupportedHWCodecPrefixes(final boolean aIsEncoder) { final Set<String> prefixes = new HashSet<>(); - final String[] mimeTypes = {H264_MIME_TYPE, VP8_MIME_TYPE, VP9_MIME_TYPE}; + final String[] mimeTypes = { + H264_MIME_TYPE, HEVC_MIME_TYPE, AV1_MIME_TYPE, VP8_MIME_TYPE, VP9_MIME_TYPE + }; for (final String mt : mimeTypes) { prefixes.addAll(Arrays.asList(getSupportedHWCodecPrefixes(mt, aIsEncoder))); } @@ -336,6 +340,16 @@ public final class HardwareCodecCapabilityUtils { } @WrapForJNI + public static boolean hasHWAV1(final boolean aIsEncoder) { + return getHWCodecCapability(AV1_MIME_TYPE, aIsEncoder); + } + + @WrapForJNI + public static boolean hasHWHEVC(final boolean aIsEncoder) { + return getHWCodecCapability(HEVC_MIME_TYPE, aIsEncoder); + } + + @WrapForJNI public static boolean hasHWH264(final boolean aIsEncoder) { return getHWCodecCapability(H264_MIME_TYPE, aIsEncoder); }