271 lines
5.6 KiB
Smali
271 lines
5.6 KiB
Smali
.class public Lorg/webrtc/MediaCodecUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "MediaCodecUtils.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m:I = 0x7fa30c04
|
|
|
|
.field public static final COLOR_QCOM_FORMATYVU420PackedSemiPlanar16m4ka:I = 0x7fa30c02
|
|
|
|
.field public static final COLOR_QCOM_FORMATYVU420PackedSemiPlanar32m4ka:I = 0x7fa30c01
|
|
|
|
.field public static final COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka:I = 0x7fa30c03
|
|
|
|
.field public static final DECODER_COLOR_FORMATS:[I
|
|
|
|
.field public static final ENCODER_COLOR_FORMATS:[I
|
|
|
|
.field public static final EXYNOS_PREFIX:Ljava/lang/String; = "OMX.Exynos."
|
|
|
|
.field public static final INTEL_PREFIX:Ljava/lang/String; = "OMX.Intel."
|
|
|
|
.field public static final NVIDIA_PREFIX:Ljava/lang/String; = "OMX.Nvidia."
|
|
|
|
.field public static final QCOM_PREFIX:Ljava/lang/String; = "OMX.qcom."
|
|
|
|
.field public static final SOFTWARE_IMPLEMENTATION_PREFIXES:[Ljava/lang/String;
|
|
|
|
.field public static final TAG:Ljava/lang/String; = "MediaCodecUtils"
|
|
|
|
.field public static final TEXTURE_COLOR_FORMATS:[I
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
const-string v0, "OMX.google."
|
|
|
|
const-string v1, "OMX.SEC."
|
|
|
|
filled-new-array {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/4 v0, 0x4
|
|
|
|
new-array v0, v0, [I
|
|
|
|
fill-array-data v0, :array_1
|
|
|
|
sput-object v0, Lorg/webrtc/MediaCodecUtils;->ENCODER_COLOR_FORMATS:[I
|
|
|
|
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
|
|
|
|
:array_1
|
|
.array-data 4
|
|
0x13
|
|
0x15
|
|
0x7fa30c00
|
|
0x7fa30c04
|
|
.end array-data
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static codecSupportsType(Landroid/media/MediaCodecInfo;Lorg/webrtc/VideoCodecType;)Z
|
|
.locals 5
|
|
|
|
invoke-virtual {p0}, Landroid/media/MediaCodecInfo;->getSupportedTypes()[Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_1
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
invoke-virtual {p1}, Lorg/webrtc/VideoCodecType;->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 public static getCodecProperties(Lorg/webrtc/VideoCodecType;Z)Ljava/util/Map;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lorg/webrtc/VideoCodecType;",
|
|
"Z)",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
invoke-static {p1}, Lorg/webrtc/H264Utils;->getDefaultH264Params(Z)Ljava/util/Map;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Unsupported codec: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, 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
|
|
|
|
:cond_1
|
|
new-instance p0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getTextureColorFormats()[I
|
|
.locals 3
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const v2, 0x7f000789
|
|
|
|
aput v2, v0, v1
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static selectColorFormat([ILandroid/media/MediaCodecInfo$CodecCapabilities;)Ljava/lang/Integer;
|
|
.locals 8
|
|
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_2
|
|
|
|
aget v3, p0, v2
|
|
|
|
iget-object v4, p1, Landroid/media/MediaCodecInfo$CodecCapabilities;->colorFormats:[I
|
|
|
|
array-length v5, v4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
:goto_1
|
|
if-ge v6, v5, :cond_1
|
|
|
|
aget v7, v4, v6
|
|
|
|
if-ne v7, v3, :cond_0
|
|
|
|
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
|