Rabbit-R1/switch port/smali/smali_classes3/org/webrtc/MediaCodecUtils.smali
2024-05-21 17:08:36 -04:00

331 lines
6.7 KiB
Smali

.class Lorg/webrtc/MediaCodecUtils;
.super Ljava/lang/Object;
.source "MediaCodecUtils.java"
# static fields
.field static final COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m:I = 0x7fa30c04
.field static final COLOR_QCOM_FORMATYVU420PackedSemiPlanar16m4ka:I = 0x7fa30c02
.field static final COLOR_QCOM_FORMATYVU420PackedSemiPlanar32m4ka:I = 0x7fa30c01
.field static final COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka:I = 0x7fa30c03
.field static final DECODER_COLOR_FORMATS:[I
.field static final ENCODER_COLOR_FORMATS:[I
.field static final EXYNOS_PREFIX:Ljava/lang/String; = "OMX.Exynos."
.field static final INTEL_PREFIX:Ljava/lang/String; = "OMX.Intel."
.field static final NVIDIA_PREFIX:Ljava/lang/String; = "OMX.Nvidia."
.field static final QCOM_PREFIX:Ljava/lang/String; = "OMX.qcom."
.field static final SOFTWARE_IMPLEMENTATION_PREFIXES:[Ljava/lang/String;
.field private static final TAG:Ljava/lang/String; = "MediaCodecUtils"
.field static final TEXTURE_COLOR_FORMATS:[I
# direct methods
.method static constructor <clinit>()V
.locals 4
const-string v0, "OMX.SEC."
const-string v1, "c2.android"
const-string v2, "OMX.google."
.line 32
filled-new-array {v2, v0, v1}, [Ljava/lang/String;
move-result-object v0
sput-object v0, Lorg/webrtc/MediaCodecUtils;->SOFTWARE_IMPLEMENTATION_PREFIXES:[Ljava/lang/String;
const/4 v0, 0x7
new-array v0, v0, [I
fill-array-data v0, :array_0
sput-object v0, Lorg/webrtc/MediaCodecUtils;->DECODER_COLOR_FORMATS:[I
const v0, 0x7fa30c00
const v1, 0x7fa30c04
const/16 v2, 0x13
const/16 v3, 0x15
filled-new-array {v2, v3, v0, v1}, [I
move-result-object v0
sput-object v0, Lorg/webrtc/MediaCodecUtils;->ENCODER_COLOR_FORMATS:[I
.line 59
invoke-static {}, Lorg/webrtc/MediaCodecUtils;->getTextureColorFormats()[I
move-result-object v0
sput-object v0, Lorg/webrtc/MediaCodecUtils;->TEXTURE_COLOR_FORMATS:[I
return-void
nop
:array_0
.array-data 4
0x13
0x15
0x7fa30c00
0x7fa30c01
0x7fa30c02
0x7fa30c03
0x7fa30c04
.end array-data
.end method
.method private constructor <init>()V
.locals 0
.line 133
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method static codecSupportsType(Landroid/media/MediaCodecInfo;Lorg/webrtc/VideoCodecMimeType;)Z
.locals 5
.line 82
invoke-virtual {p0}, Landroid/media/MediaCodecInfo;->getSupportedTypes()[Ljava/lang/String;
move-result-object p0
array-length v0, p0
const/4 v1, 0x0
move v2, v1
:goto_0
if-ge v2, v0, :cond_1
aget-object v3, p0, v2
.line 83
invoke-virtual {p1}, Lorg/webrtc/VideoCodecMimeType;->mimeType()Ljava/lang/String;
move-result-object v4
invoke-virtual {v4, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_0
const/4 p0, 0x1
return p0
:cond_0
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_1
return v1
.end method
.method static getCodecProperties(Lorg/webrtc/VideoCodecMimeType;Z)Ljava/util/Map;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/webrtc/VideoCodecMimeType;",
"Z)",
"Ljava/util/Map<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;"
}
.end annotation
.line 91
sget-object v0, Lorg/webrtc/MediaCodecUtils$1;->$SwitchMap$org$webrtc$VideoCodecMimeType:[I
invoke-virtual {p0}, Lorg/webrtc/VideoCodecMimeType;->ordinal()I
move-result v1
aget v0, v0, v1
const/4 v1, 0x1
if-eq v0, v1, :cond_1
const/4 v1, 0x2
if-eq v0, v1, :cond_1
const/4 v1, 0x3
if-eq v0, v1, :cond_1
const/4 v1, 0x4
if-ne v0, v1, :cond_0
.line 97
invoke-static {p1}, Lorg/webrtc/H264Utils;->getDefaultH264Params(Z)Ljava/util/Map;
move-result-object p0
return-object p0
.line 99
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "Unsupported codec: "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.line 95
:cond_1
new-instance p0, Ljava/util/HashMap;
invoke-direct {p0}, Ljava/util/HashMap;-><init>()V
return-object p0
.end method
.method private static getTextureColorFormats()[I
.locals 1
const v0, 0x7f000789
filled-new-array {v0}, [I
move-result-object v0
return-object v0
.end method
.method static isHardwareAccelerated(Landroid/media/MediaCodecInfo;)Z
.locals 0
.line 105
invoke-static {p0}, Lorg/webrtc/MediaCodecUtils;->isHardwareAcceleratedQOrHigher(Landroid/media/MediaCodecInfo;)Z
move-result p0
return p0
.end method
.method private static isHardwareAcceleratedQOrHigher(Landroid/media/MediaCodecInfo;)Z
.locals 0
.line 112
invoke-virtual {p0}, Landroid/media/MediaCodecInfo;->isHardwareAccelerated()Z
move-result p0
return p0
.end method
.method static isSoftwareOnly(Landroid/media/MediaCodecInfo;)Z
.locals 0
.line 117
invoke-static {p0}, Lorg/webrtc/MediaCodecUtils;->isSoftwareOnlyQOrHigher(Landroid/media/MediaCodecInfo;)Z
move-result p0
return p0
.end method
.method private static isSoftwareOnlyQOrHigher(Landroid/media/MediaCodecInfo;)Z
.locals 0
.line 130
invoke-virtual {p0}, Landroid/media/MediaCodecInfo;->isSoftwareOnly()Z
move-result p0
return p0
.end method
.method static selectColorFormat([ILandroid/media/MediaCodecInfo$CodecCapabilities;)Ljava/lang/Integer;
.locals 8
.line 71
array-length v0, p0
const/4 v1, 0x0
move v2, v1
:goto_0
if-ge v2, v0, :cond_2
aget v3, p0, v2
.line 72
iget-object v4, p1, Landroid/media/MediaCodecInfo$CodecCapabilities;->colorFormats:[I
array-length v5, v4
move v6, v1
:goto_1
if-ge v6, v5, :cond_1
aget v7, v4, v6
if-ne v7, v3, :cond_0
.line 74
invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p0
return-object p0
:cond_0
add-int/lit8 v6, v6, 0x1
goto :goto_1
:cond_1
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_2
const/4 p0, 0x0
return-object p0
.end method