2716 lines
75 KiB
Smali
2716 lines
75 KiB
Smali
.class public Lorg/webrtc/MediaCodecVideoDecoder;
|
|
.super Ljava/lang/Object;
|
|
.source "MediaCodecVideoDecoder.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;,
|
|
Lorg/webrtc/MediaCodecVideoDecoder$DecodedTextureBuffer;,
|
|
Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;,
|
|
Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;,
|
|
Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;,
|
|
Lorg/webrtc/MediaCodecVideoDecoder$MediaCodecVideoDecoderErrorCallback;,
|
|
Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;,
|
|
Lorg/webrtc/MediaCodecVideoDecoder$HwDecoderFactory;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/Deprecated;
|
|
.end annotation
|
|
|
|
|
|
# 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 DEQUEUE_INPUT_TIMEOUT:I = 0x7a120
|
|
|
|
.field public static final FORMAT_KEY_CROP_BOTTOM:Ljava/lang/String; = "crop-bottom"
|
|
|
|
.field public static final FORMAT_KEY_CROP_LEFT:Ljava/lang/String; = "crop-left"
|
|
|
|
.field public static final FORMAT_KEY_CROP_RIGHT:Ljava/lang/String; = "crop-right"
|
|
|
|
.field public static final FORMAT_KEY_CROP_TOP:Ljava/lang/String; = "crop-top"
|
|
|
|
.field public static final FORMAT_KEY_SLICE_HEIGHT:Ljava/lang/String; = "slice-height"
|
|
|
|
.field public static final FORMAT_KEY_STRIDE:Ljava/lang/String; = "stride"
|
|
|
|
.field public static final H264_MIME_TYPE:Ljava/lang/String; = "video/avc"
|
|
|
|
.field public static final MAX_DECODE_TIME_MS:J = 0xc8L
|
|
|
|
.field public static final MAX_QUEUED_OUTPUTBUFFERS:I = 0x3
|
|
|
|
.field public static final MEDIA_CODEC_RELEASE_TIMEOUT_MS:I = 0x1388
|
|
|
|
.field public static final TAG:Ljava/lang/String; = "MediaCodecVideoDecoder"
|
|
|
|
.field public static final VP8_MIME_TYPE:Ljava/lang/String; = "video/x-vnd.on2.vp8"
|
|
|
|
.field public static final VP9_MIME_TYPE:Ljava/lang/String; = "video/x-vnd.on2.vp9"
|
|
|
|
.field public static codecErrors:I = 0x0
|
|
|
|
.field public static eglBase:Lorg/webrtc/EglBase; = null
|
|
|
|
.field public static errorCallback:Lorg/webrtc/MediaCodecVideoDecoder$MediaCodecVideoDecoderErrorCallback; = null
|
|
|
|
.field public static hwDecoderDisabledTypes:Ljava/util/Set; = null
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static runningInstance:Lorg/webrtc/MediaCodecVideoDecoder; = null
|
|
|
|
.field public static final supportedColorList:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static final supportedExynosH264HighProfileHwCodecPrefix:Ljava/lang/String; = "OMX.Exynos."
|
|
|
|
.field public static final supportedMediaTekH264HighProfileHwCodecPrefix:Ljava/lang/String; = "OMX.MTK."
|
|
|
|
.field public static final supportedQcomH264HighProfileHwCodecPrefix:Ljava/lang/String; = "OMX.qcom."
|
|
|
|
.field public static final supportedVp9HwCodecPrefixes:[Ljava/lang/String;
|
|
|
|
|
|
# instance fields
|
|
.field public colorFormat:I
|
|
|
|
.field public final decodeStartTimeMs:Ljava/util/Queue;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Queue<",
|
|
"Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Queue<",
|
|
"Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public droppedFrames:I
|
|
|
|
.field public hasDecodedFirstFrame:Z
|
|
|
|
.field public height:I
|
|
|
|
.field public inputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
.field public mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
.field public mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
.field public outputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
.field public sliceHeight:I
|
|
|
|
.field public stride:I
|
|
|
|
.field public surface:Landroid/view/Surface;
|
|
|
|
.field public textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
.field public width:I
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
sput-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v0, "OMX.qcom."
|
|
|
|
const-string v1, "OMX.Exynos."
|
|
|
|
filled-new-array {v0, v1}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->supportedVp9HwCodecPrefixes:[Ljava/lang/String;
|
|
|
|
const/4 v0, 0x7
|
|
|
|
new-array v0, v0, [Ljava/lang/Integer;
|
|
|
|
const/16 v1, 0x13
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
const/16 v1, 0x15
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
const v1, 0x7fa30c00
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x2
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
const v1, 0x7fa30c01
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x3
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
const v1, 0x7fa30c02
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x4
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
const v1, 0x7fa30c03
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x5
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
const v1, 0x7fa30c04
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x6
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->supportedColorList:Ljava/util/List;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/ArrayDeque;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->decodeStartTimeMs:Ljava/util/Queue;
|
|
|
|
new-instance v0, Ljava/util/ArrayDeque;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private MaybeRenderDecodedTextureBuffer()V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {v0}, Ljava/util/Queue;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;->isWaitingForTexture()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {v0}, Ljava/util/Queue;->remove()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;
|
|
|
|
iget-object v1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
invoke-virtual {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;->addBufferToRender(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)V
|
|
|
|
iget-object v1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-static {v0}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$1000(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)I
|
|
|
|
move-result v0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v1, v0, v2}, Landroid/media/MediaCodec;->releaseOutputBuffer(IZ)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic access$000(Ljava/lang/String;Z)J
|
|
.locals 0
|
|
|
|
invoke-static {p0, p1}, Lorg/webrtc/MediaCodecVideoDecoder;->nativeCreateDecoder(Ljava/lang/String;Z)J
|
|
|
|
move-result-wide p0
|
|
|
|
return-wide p0
|
|
.end method
|
|
|
|
.method public static synthetic access$100(Lorg/webrtc/MediaCodecVideoDecoder;)Landroid/media/MediaCodec;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private checkOnMediaCodecThread()V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/IllegalStateException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Thread;->getId()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Thread;->getId()J
|
|
|
|
move-result-wide v2
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "MediaCodecVideoDecoder previously operated on "
|
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, " but is now called on "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static createFactory()Lorg/webrtc/VideoDecoderFactory;
|
|
.locals 2
|
|
|
|
new-instance v0, Lorg/webrtc/DefaultVideoDecoderFactory;
|
|
|
|
new-instance v1, Lorg/webrtc/MediaCodecVideoDecoder$HwDecoderFactory;
|
|
|
|
invoke-direct {v1}, Lorg/webrtc/MediaCodecVideoDecoder$HwDecoderFactory;-><init>()V
|
|
|
|
invoke-direct {v0, v1}, Lorg/webrtc/DefaultVideoDecoderFactory;-><init>(Lorg/webrtc/VideoDecoderFactory;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private dequeueInputBuffer()I
|
|
.locals 3
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/MediaCodecVideoDecoder;->checkOnMediaCodecThread()V
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
const-wide/32 v1, 0x7a120
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/media/MediaCodec;->dequeueInputBuffer(J)I
|
|
|
|
move-result v0
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return v0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
const-string v1, "MediaCodecVideoDecoder"
|
|
|
|
const-string v2, "dequeueIntputBuffer failed"
|
|
|
|
invoke-static {v1, v2, v0}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
const/4 v0, -0x2
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private dequeueOutputBuffer(I)Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;
|
|
.locals 22
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
invoke-direct/range {p0 .. p0}, Lorg/webrtc/MediaCodecVideoDecoder;->checkOnMediaCodecThread()V
|
|
|
|
iget-object v1, v0, Lorg/webrtc/MediaCodecVideoDecoder;->decodeStartTimeMs:Ljava/util/Queue;
|
|
|
|
invoke-interface {v1}, Ljava/util/Queue;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
return-object v2
|
|
|
|
:cond_0
|
|
new-instance v1, Landroid/media/MediaCodec$BufferInfo;
|
|
|
|
invoke-direct {v1}, Landroid/media/MediaCodec$BufferInfo;-><init>()V
|
|
|
|
:goto_0
|
|
iget-object v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
sget-object v4, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
move/from16 v5, p1
|
|
|
|
int-to-long v6, v5
|
|
|
|
invoke-virtual {v4, v6, v7}, Ljava/util/concurrent/TimeUnit;->toMicros(J)J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-virtual {v3, v1, v6, v7}, Landroid/media/MediaCodec;->dequeueOutputBuffer(Landroid/media/MediaCodec$BufferInfo;J)I
|
|
|
|
move-result v9
|
|
|
|
const/4 v3, -0x3
|
|
|
|
const-string v4, "MediaCodecVideoDecoder"
|
|
|
|
if-eq v9, v3, :cond_c
|
|
|
|
const/4 v3, -0x2
|
|
|
|
const/4 v6, 0x1
|
|
|
|
if-eq v9, v3, :cond_3
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-eq v9, v3, :cond_2
|
|
|
|
iput-boolean v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->hasDecodedFirstFrame:Z
|
|
|
|
iget-object v2, v0, Lorg/webrtc/MediaCodecVideoDecoder;->decodeStartTimeMs:Ljava/util/Queue;
|
|
|
|
invoke-interface {v2}, Ljava/util/Queue;->remove()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;
|
|
|
|
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
|
|
|
|
move-result-wide v5
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;->access$700(Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;)J
|
|
|
|
move-result-wide v7
|
|
|
|
sub-long/2addr v5, v7
|
|
|
|
const-wide/16 v7, 0xc8
|
|
|
|
cmp-long v3, v5, v7
|
|
|
|
if-lez v3, :cond_1
|
|
|
|
const-string v3, "Very high decode time: "
|
|
|
|
const-string v10, "ms. Q size: "
|
|
|
|
invoke-static {v3, v5, v6, v10}, Lf/e/b/a/a;->a(Ljava/lang/String;JLjava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v5, v0, Lorg/webrtc/MediaCodecVideoDecoder;->decodeStartTimeMs:Ljava/util/Queue;
|
|
|
|
invoke-interface {v5}, Ljava/util/Queue;->size()I
|
|
|
|
move-result v5
|
|
|
|
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, ". Might be caused by resuming H264 decoding after a pause."
|
|
|
|
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v4, v3}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
move-wide/from16 v18, v7
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move-wide/from16 v18, v5
|
|
|
|
:goto_1
|
|
new-instance v3, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;
|
|
|
|
iget v10, v1, Landroid/media/MediaCodec$BufferInfo;->offset:I
|
|
|
|
iget v11, v1, Landroid/media/MediaCodec$BufferInfo;->size:I
|
|
|
|
sget-object v4, Ljava/util/concurrent/TimeUnit;->MICROSECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
iget-wide v5, v1, Landroid/media/MediaCodec$BufferInfo;->presentationTimeUs:J
|
|
|
|
invoke-virtual {v4, v5, v6}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
|
|
|
|
move-result-wide v12
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;->access$800(Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;)J
|
|
|
|
move-result-wide v14
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;->access$900(Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;)J
|
|
|
|
move-result-wide v16
|
|
|
|
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
|
|
|
|
move-result-wide v20
|
|
|
|
move-object v8, v3
|
|
|
|
invoke-direct/range {v8 .. v21}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;-><init>(IIIJJJJJ)V
|
|
|
|
return-object v3
|
|
|
|
:cond_2
|
|
return-object v2
|
|
|
|
:cond_3
|
|
iget-object v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-virtual {v3}, Landroid/media/MediaCodec;->getOutputFormat()Landroid/media/MediaFormat;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v7, "Decoder format changed: "
|
|
|
|
invoke-static {v7}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {v3}, Landroid/media/MediaFormat;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-static {v4, v7}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v7, "crop-left"
|
|
|
|
invoke-virtual {v3, v7}, Landroid/media/MediaFormat;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_4
|
|
|
|
const-string v8, "crop-right"
|
|
|
|
invoke-virtual {v3, v8}, Landroid/media/MediaFormat;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v9
|
|
|
|
if-eqz v9, :cond_4
|
|
|
|
const-string v9, "crop-bottom"
|
|
|
|
invoke-virtual {v3, v9}, Landroid/media/MediaFormat;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v10
|
|
|
|
if-eqz v10, :cond_4
|
|
|
|
const-string v10, "crop-top"
|
|
|
|
invoke-virtual {v3, v10}, Landroid/media/MediaFormat;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v11
|
|
|
|
if-eqz v11, :cond_4
|
|
|
|
invoke-virtual {v3, v8}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v8
|
|
|
|
add-int/2addr v8, v6
|
|
|
|
invoke-virtual {v3, v7}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v7
|
|
|
|
sub-int/2addr v8, v7
|
|
|
|
invoke-virtual {v3, v9}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v7
|
|
|
|
add-int/2addr v7, v6
|
|
|
|
invoke-virtual {v3, v10}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v6
|
|
|
|
sub-int/2addr v7, v6
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
const-string v6, "width"
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v8
|
|
|
|
const-string v6, "height"
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v7
|
|
|
|
:goto_2
|
|
iget-boolean v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->hasDecodedFirstFrame:Z
|
|
|
|
if-eqz v6, :cond_6
|
|
|
|
iget v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
if-ne v8, v6, :cond_5
|
|
|
|
iget v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
if-ne v7, v6, :cond_5
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
new-instance v1, Ljava/lang/RuntimeException;
|
|
|
|
const-string v2, "Unexpected size change. Configured "
|
|
|
|
invoke-static {v2}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
iget v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "*"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v4, v0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, ". New "
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_6
|
|
:goto_3
|
|
iput v8, v0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
iput v7, v0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
iget-object v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
if-eqz v6, :cond_7
|
|
|
|
iget v7, v0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
iget v8, v0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
invoke-virtual {v6, v7, v8}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;->setSize(II)V
|
|
|
|
:cond_7
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->useSurface()Z
|
|
|
|
move-result v6
|
|
|
|
if-nez v6, :cond_9
|
|
|
|
const-string v6, "color-format"
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_9
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v6
|
|
|
|
iput v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->colorFormat:I
|
|
|
|
const-string v6, "Color: 0x"
|
|
|
|
invoke-static {v6}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v6
|
|
|
|
iget v7, v0, Lorg/webrtc/MediaCodecVideoDecoder;->colorFormat:I
|
|
|
|
invoke-static {v7}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-static {v4, v6}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v6, Lorg/webrtc/MediaCodecVideoDecoder;->supportedColorList:Ljava/util/List;
|
|
|
|
iget v7, v0, Lorg/webrtc/MediaCodecVideoDecoder;->colorFormat:I
|
|
|
|
invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-interface {v6, v7}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_8
|
|
|
|
goto :goto_4
|
|
|
|
:cond_8
|
|
new-instance v1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v2, "Non supported color format: "
|
|
|
|
invoke-static {v2}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
iget v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->colorFormat:I
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_9
|
|
:goto_4
|
|
const-string v6, "stride"
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_a
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v6
|
|
|
|
iput v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->stride:I
|
|
|
|
:cond_a
|
|
const-string v6, "slice-height"
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->containsKey(Ljava/lang/String;)Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_b
|
|
|
|
invoke-virtual {v3, v6}, Landroid/media/MediaFormat;->getInteger(Ljava/lang/String;)I
|
|
|
|
move-result v3
|
|
|
|
iput v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->sliceHeight:I
|
|
|
|
:cond_b
|
|
const-string v3, "Frame stride and slice height: "
|
|
|
|
invoke-static {v3}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
iget v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->stride:I
|
|
|
|
invoke-virtual {v3, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v6, " x "
|
|
|
|
invoke-virtual {v3, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->sliceHeight:I
|
|
|
|
invoke-virtual {v3, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v4, v3}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
iget v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
iget v4, v0, Lorg/webrtc/MediaCodecVideoDecoder;->stride:I
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v3
|
|
|
|
iput v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->stride:I
|
|
|
|
iget v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
iget v4, v0, Lorg/webrtc/MediaCodecVideoDecoder;->sliceHeight:I
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v3
|
|
|
|
iput v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->sliceHeight:I
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_c
|
|
iget-object v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-virtual {v3}, Landroid/media/MediaCodec;->getOutputBuffers()[Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object v3
|
|
|
|
iput-object v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->outputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
const-string v3, "Decoder output buffers changed: "
|
|
|
|
invoke-static {v3}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v6, v0, Lorg/webrtc/MediaCodecVideoDecoder;->outputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
array-length v6, v6
|
|
|
|
invoke-virtual {v3, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v4, v3}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
iget-boolean v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->hasDecodedFirstFrame:Z
|
|
|
|
if-nez v3, :cond_d
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_d
|
|
new-instance v1, Ljava/lang/RuntimeException;
|
|
|
|
const-string v2, "Unexpected output buffer change event."
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private dequeueTextureBuffer(I)Lorg/webrtc/MediaCodecVideoDecoder$DecodedTextureBuffer;
|
|
.locals 17
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move/from16 v1, p1
|
|
|
|
invoke-direct/range {p0 .. p0}, Lorg/webrtc/MediaCodecVideoDecoder;->checkOnMediaCodecThread()V
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->useSurface()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
invoke-direct/range {p0 .. p1}, Lorg/webrtc/MediaCodecVideoDecoder;->dequeueOutputBuffer(I)Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
iget-object v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {v3, v2}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
invoke-direct/range {p0 .. p0}, Lorg/webrtc/MediaCodecVideoDecoder;->MaybeRenderDecodedTextureBuffer()V
|
|
|
|
iget-object v2, v0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
invoke-virtual {v2, v1}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;->dequeueTextureBuffer(I)Lorg/webrtc/MediaCodecVideoDecoder$DecodedTextureBuffer;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-direct/range {p0 .. p0}, Lorg/webrtc/MediaCodecVideoDecoder;->MaybeRenderDecodedTextureBuffer()V
|
|
|
|
return-object v2
|
|
|
|
:cond_1
|
|
iget-object v2, v0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {v2}, Ljava/util/Queue;->size()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x3
|
|
|
|
iget-object v4, v0, Lorg/webrtc/MediaCodecVideoDecoder;->outputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
array-length v4, v4
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v3
|
|
|
|
if-ge v2, v3, :cond_3
|
|
|
|
if-lez v1, :cond_2
|
|
|
|
iget-object v2, v0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {v2}, Ljava/util/Queue;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 v1, 0x0
|
|
|
|
return-object v1
|
|
|
|
:cond_3
|
|
:goto_0
|
|
iget v2, v0, Lorg/webrtc/MediaCodecVideoDecoder;->droppedFrames:I
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
iput v2, v0, Lorg/webrtc/MediaCodecVideoDecoder;->droppedFrames:I
|
|
|
|
iget-object v2, v0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {v2}, Ljava/util/Queue;->remove()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;
|
|
|
|
const-string v3, ". Total number of dropped frames: "
|
|
|
|
const-string v4, "MediaCodecVideoDecoder"
|
|
|
|
if-lez v1, :cond_4
|
|
|
|
const-string v1, "Draining decoder. Dropping frame with TS: "
|
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$200(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)J
|
|
|
|
move-result-wide v5
|
|
|
|
invoke-virtual {v1, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->droppedFrames:I
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v4, v1}, Lorg/webrtc/Logging;->w(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
const-string v1, "Too many output buffers "
|
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v5, v0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {v5}, Ljava/util/Queue;->size()I
|
|
|
|
move-result v5
|
|
|
|
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, ". Dropping frame with TS: "
|
|
|
|
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$200(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)J
|
|
|
|
move-result-wide v5
|
|
|
|
invoke-virtual {v1, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v3, v0, Lorg/webrtc/MediaCodecVideoDecoder;->droppedFrames:I
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v4, v1}, Lorg/webrtc/Logging;->w(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:goto_1
|
|
iget-object v1, v0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$1000(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)I
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-virtual {v1, v3, v4}, Landroid/media/MediaCodec;->releaseOutputBuffer(IZ)V
|
|
|
|
new-instance v1, Lorg/webrtc/MediaCodecVideoDecoder$DecodedTextureBuffer;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$200(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)J
|
|
|
|
move-result-wide v7
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$300(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)J
|
|
|
|
move-result-wide v9
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$400(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)J
|
|
|
|
move-result-wide v11
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$500(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)J
|
|
|
|
move-result-wide v13
|
|
|
|
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v2}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;->access$600(Lorg/webrtc/MediaCodecVideoDecoder$DecodedOutputBuffer;)J
|
|
|
|
move-result-wide v15
|
|
|
|
sub-long v15, v3, v15
|
|
|
|
move-object v5, v1
|
|
|
|
invoke-direct/range {v5 .. v16}, Lorg/webrtc/MediaCodecVideoDecoder$DecodedTextureBuffer;-><init>(Lorg/webrtc/VideoFrame$Buffer;JJJJJ)V
|
|
|
|
return-object v1
|
|
|
|
:cond_5
|
|
new-instance v1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v2, "dequeueTexture() called for byte buffer decoding."
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public static disableH264HwCodec()V
|
|
.locals 2
|
|
|
|
const-string v0, "MediaCodecVideoDecoder"
|
|
|
|
const-string v1, "H.264 decoding is disabled by application."
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->w(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v1, "video/avc"
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static disableVp8HwCodec()V
|
|
.locals 2
|
|
|
|
const-string v0, "MediaCodecVideoDecoder"
|
|
|
|
const-string v1, "VP8 decoding is disabled by application."
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->w(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v1, "video/x-vnd.on2.vp8"
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static disableVp9HwCodec()V
|
|
.locals 2
|
|
|
|
const-string v0, "MediaCodecVideoDecoder"
|
|
|
|
const-string v1, "VP9 decoding is disabled by application."
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->w(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v1, "video/x-vnd.on2.vp9"
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static disposeEglContext()V
|
|
.locals 1
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/EglBase;->release()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
sput-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
.locals 10
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Trying to find HW decoder for mime "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "MediaCodecVideoDecoder"
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
invoke-static {}, Landroid/media/MediaCodecList;->getCodecCount()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-ge v0, v2, :cond_b
|
|
|
|
:try_start_0
|
|
invoke-static {v0}, Landroid/media/MediaCodecList;->getCodecInfoAt(I)Landroid/media/MediaCodecInfo;
|
|
|
|
move-result-object v2
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception v2
|
|
|
|
const-string v4, "Cannot retrieve decoder codec info"
|
|
|
|
invoke-static {v1, v4, v2}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
move-object v2, v3
|
|
|
|
:goto_1
|
|
if-eqz v2, :cond_a
|
|
|
|
invoke-virtual {v2}, Landroid/media/MediaCodecInfo;->isEncoder()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
goto/16 :goto_8
|
|
|
|
:cond_0
|
|
invoke-virtual {v2}, Landroid/media/MediaCodecInfo;->getSupportedTypes()[Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
array-length v5, v4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
:goto_2
|
|
if-ge v6, v5, :cond_2
|
|
|
|
aget-object v7, v4, v6
|
|
|
|
invoke-virtual {v7, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_1
|
|
|
|
invoke-virtual {v2}, Landroid/media/MediaCodecInfo;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_1
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
:goto_3
|
|
if-nez v3, :cond_3
|
|
|
|
goto/16 :goto_8
|
|
|
|
:cond_3
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v5, "Found candidate decoder "
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {v1, v4}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
array-length v4, p1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
:goto_4
|
|
if-ge v5, v4, :cond_5
|
|
|
|
aget-object v6, p1, v5
|
|
|
|
invoke-virtual {v3, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_4
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_5
|
|
|
|
:cond_4
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
goto :goto_4
|
|
|
|
:cond_5
|
|
const/4 v4, 0x0
|
|
|
|
:goto_5
|
|
if-nez v4, :cond_6
|
|
|
|
goto :goto_8
|
|
|
|
:cond_6
|
|
:try_start_1
|
|
invoke-virtual {v2, p0}, Landroid/media/MediaCodecInfo;->getCapabilitiesForType(Ljava/lang/String;)Landroid/media/MediaCodecInfo$CodecCapabilities;
|
|
|
|
move-result-object v2
|
|
:try_end_1
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
iget-object v4, v2, Landroid/media/MediaCodecInfo$CodecCapabilities;->colorFormats:[I
|
|
|
|
array-length v5, v4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
:goto_6
|
|
if-ge v6, v5, :cond_7
|
|
|
|
aget v7, v4, v6
|
|
|
|
const-string v8, " Color: 0x"
|
|
|
|
invoke-static {v8}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-static {v7}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {v8, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-static {v1, v7}, Lorg/webrtc/Logging;->v(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
goto :goto_6
|
|
|
|
:cond_7
|
|
sget-object v4, Lorg/webrtc/MediaCodecVideoDecoder;->supportedColorList:Ljava/util/List;
|
|
|
|
invoke-interface {v4}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v4
|
|
|
|
:cond_8
|
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_a
|
|
|
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/Integer;
|
|
|
|
invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v5
|
|
|
|
iget-object v6, v2, Landroid/media/MediaCodecInfo$CodecCapabilities;->colorFormats:[I
|
|
|
|
array-length v7, v6
|
|
|
|
const/4 v8, 0x0
|
|
|
|
:goto_7
|
|
if-ge v8, v7, :cond_8
|
|
|
|
aget v9, v6, v8
|
|
|
|
if-ne v9, v5, :cond_9
|
|
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string p1, "Found target decoder "
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, ". Color: 0x"
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {v9}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v1, p0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
new-instance p0, Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
invoke-direct {p0, v3, v9}, Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;-><init>(Ljava/lang/String;I)V
|
|
|
|
return-object p0
|
|
|
|
:cond_9
|
|
add-int/lit8 v8, v8, 0x1
|
|
|
|
goto :goto_7
|
|
|
|
:catch_1
|
|
move-exception v2
|
|
|
|
const-string v3, "Cannot retrieve decoder capabilities"
|
|
|
|
invoke-static {v1, v3, v2}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:cond_a
|
|
:goto_8
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_b
|
|
new-instance p1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "No HW decoder found for mime "
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v1, p0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-object v3
|
|
.end method
|
|
|
|
.method private initDecode(Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;II)Z
|
|
.locals 5
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
if-nez v0, :cond_7
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;->VIDEO_CODEC_VP8:Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->supportedVp8HwCodecPrefixes()[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "video/x-vnd.on2.vp8"
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;->VIDEO_CODEC_VP9:Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;
|
|
|
|
if-ne p1, v0, :cond_1
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->supportedVp9HwCodecPrefixes:[Ljava/lang/String;
|
|
|
|
const-string v1, "video/x-vnd.on2.vp9"
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;->VIDEO_CODEC_H264:Lorg/webrtc/MediaCodecVideoDecoder$VideoCodecType;
|
|
|
|
if-ne p1, v0, :cond_6
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->supportedH264HwCodecPrefixes()[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "video/avc"
|
|
|
|
:goto_0
|
|
invoke-static {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder;->findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "Java initDecode: "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " : "
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " x "
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, ". Color: 0x"
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget p1, v0, Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;->colorFormat:I
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, ". Use Surface: "
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->useSurface()Z
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v2, "MediaCodecVideoDecoder"
|
|
|
|
invoke-static {v2, p1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sput-object p0, Lorg/webrtc/MediaCodecVideoDecoder;->runningInstance:Lorg/webrtc/MediaCodecVideoDecoder;
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:try_start_0
|
|
iput p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
iput p3, p0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
iput p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->stride:I
|
|
|
|
iput p3, p0, Lorg/webrtc/MediaCodecVideoDecoder;->sliceHeight:I
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->useSurface()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
const-string v3, "Decoder SurfaceTextureHelper"
|
|
|
|
sget-object v4, Lorg/webrtc/MediaCodecVideoDecoder;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
invoke-interface {v4}, Lorg/webrtc/EglBase;->getEglBaseContext()Lorg/webrtc/EglBase$Context;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {v3, v4}, Lorg/webrtc/SurfaceTextureHelper;->create(Ljava/lang/String;Lorg/webrtc/EglBase$Context;)Lorg/webrtc/SurfaceTextureHelper;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
new-instance v4, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
invoke-direct {v4, p0, v3}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;-><init>(Lorg/webrtc/MediaCodecVideoDecoder;Lorg/webrtc/SurfaceTextureHelper;)V
|
|
|
|
iput-object v4, p0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
iget-object v4, p0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
invoke-virtual {v4, p2, p3}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;->setSize(II)V
|
|
|
|
new-instance v4, Landroid/view/Surface;
|
|
|
|
invoke-virtual {v3}, Lorg/webrtc/SurfaceTextureHelper;->getSurfaceTexture()Landroid/graphics/SurfaceTexture;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v4, v3}, Landroid/view/Surface;-><init>(Landroid/graphics/SurfaceTexture;)V
|
|
|
|
iput-object v4, p0, Lorg/webrtc/MediaCodecVideoDecoder;->surface:Landroid/view/Surface;
|
|
|
|
:cond_2
|
|
invoke-static {v1, p2, p3}, Landroid/media/MediaFormat;->createVideoFormat(Ljava/lang/String;II)Landroid/media/MediaFormat;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->useSurface()Z
|
|
|
|
move-result p3
|
|
|
|
if-nez p3, :cond_3
|
|
|
|
const-string p3, "color-format"
|
|
|
|
iget v1, v0, Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;->colorFormat:I
|
|
|
|
invoke-virtual {p2, p3, v1}, Landroid/media/MediaFormat;->setInteger(Ljava/lang/String;I)V
|
|
|
|
:cond_3
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, " Format: "
|
|
|
|
invoke-virtual {p3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-static {v2, p3}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
iget-object p3, v0, Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;->codecName:Ljava/lang/String;
|
|
|
|
invoke-static {p3}, Lorg/webrtc/MediaCodecVideoEncoder;->createByCodecName(Ljava/lang/String;)Landroid/media/MediaCodec;
|
|
|
|
move-result-object p3
|
|
|
|
iput-object p3, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
iget-object p3, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
if-nez p3, :cond_4
|
|
|
|
const-string p2, "Can not create media decoder"
|
|
|
|
invoke-static {v2, p2}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return p1
|
|
|
|
:cond_4
|
|
iget-object p3, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
iget-object v1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->surface:Landroid/view/Surface;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {p3, p2, v1, v3, p1}, Landroid/media/MediaCodec;->configure(Landroid/media/MediaFormat;Landroid/view/Surface;Landroid/media/MediaCrypto;I)V
|
|
|
|
iget-object p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-virtual {p2}, Landroid/media/MediaCodec;->start()V
|
|
|
|
iget p2, v0, Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;->colorFormat:I
|
|
|
|
iput p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->colorFormat:I
|
|
|
|
iget-object p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-virtual {p2}, Landroid/media/MediaCodec;->getOutputBuffers()[Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object p2
|
|
|
|
iput-object p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->outputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-virtual {p2}, Landroid/media/MediaCodec;->getInputBuffers()[Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object p2
|
|
|
|
iput-object p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->inputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
iget-object p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->decodeStartTimeMs:Ljava/util/Queue;
|
|
|
|
invoke-interface {p2}, Ljava/util/Queue;->clear()V
|
|
|
|
iput-boolean p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->hasDecodedFirstFrame:Z
|
|
|
|
iget-object p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {p2}, Ljava/util/Queue;->clear()V
|
|
|
|
iput p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->droppedFrames:I
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string p3, "Input buffers: "
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object p3, p0, Lorg/webrtc/MediaCodecVideoDecoder;->inputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
array-length p3, p3
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string p3, ". Output buffers: "
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object p3, p0, Lorg/webrtc/MediaCodecVideoDecoder;->outputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
array-length p3, p3
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {v2, p2}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:catch_0
|
|
move-exception p2
|
|
|
|
const-string p3, "initDecode failed"
|
|
|
|
invoke-static {v2, p3, p2}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
return p1
|
|
|
|
:cond_5
|
|
new-instance p2, Ljava/lang/RuntimeException;
|
|
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "Cannot find HW decoder for "
|
|
|
|
invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_6
|
|
new-instance p2, Ljava/lang/RuntimeException;
|
|
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "initDecode: Non-supported codec "
|
|
|
|
invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_7
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "initDecode: Forgot to release()?"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static isH264HighProfileHwSupported()Z
|
|
.locals 5
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v1, "video/avc"
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return v2
|
|
|
|
:cond_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const-string v0, "OMX.qcom."
|
|
|
|
filled-new-array {v0}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder;->findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
return v3
|
|
|
|
:cond_1
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v4, 0x17
|
|
|
|
if-lt v0, v4, :cond_2
|
|
|
|
const-string v0, "OMX.Exynos."
|
|
|
|
filled-new-array {v0}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder;->findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
return v3
|
|
|
|
:cond_2
|
|
const-string v0, "WebRTC-MediaTekH264"
|
|
|
|
invoke-static {v0}, Lorg/webrtc/PeerConnectionFactory;->fieldTrialsFindFullName(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v4, "Enabled"
|
|
|
|
invoke-virtual {v0, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v4, 0x1b
|
|
|
|
if-lt v0, v4, :cond_3
|
|
|
|
const-string v0, "OMX.MTK."
|
|
|
|
filled-new-array {v0}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder;->findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
return v3
|
|
|
|
:cond_3
|
|
return v2
|
|
.end method
|
|
|
|
.method public static isH264HwSupported()Z
|
|
.locals 2
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v1, "video/avc"
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->supportedH264HwCodecPrefixes()[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder;->findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isVp8HwSupported()Z
|
|
.locals 2
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v1, "video/x-vnd.on2.vp8"
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->supportedVp8HwCodecPrefixes()[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder;->findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isVp9HwSupported()Z
|
|
.locals 2
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->hwDecoderDisabledTypes:Ljava/util/Set;
|
|
|
|
const-string v1, "video/x-vnd.on2.vp9"
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->supportedVp9HwCodecPrefixes:[Ljava/lang/String;
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/MediaCodecVideoDecoder;->findDecoder(Ljava/lang/String;[Ljava/lang/String;)Lorg/webrtc/MediaCodecVideoDecoder$DecoderProperties;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static native nativeCreateDecoder(Ljava/lang/String;Z)J
|
|
.end method
|
|
|
|
.method public static printStackTrace()V
|
|
.locals 5
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->runningInstance:Lorg/webrtc/MediaCodecVideoDecoder;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, v0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Thread;->getStackTrace()[Ljava/lang/StackTraceElement;
|
|
|
|
move-result-object v0
|
|
|
|
array-length v1, v0
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
const-string v1, "MediaCodecVideoDecoder"
|
|
|
|
const-string v2, "MediaCodecVideoDecoder stacks trace:"
|
|
|
|
invoke-static {v1, v2}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
array-length v2, v0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-ge v3, v2, :cond_0
|
|
|
|
aget-object v4, v0, v3
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StackTraceElement;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {v1, v4}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private queueInputBuffer(IIJJJ)Z
|
|
.locals 17
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
move-object/from16 v1, p0
|
|
|
|
invoke-direct/range {p0 .. p0}, Lorg/webrtc/MediaCodecVideoDecoder;->checkOnMediaCodecThread()V
|
|
|
|
const/4 v9, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v0, v1, Lorg/webrtc/MediaCodecVideoDecoder;->inputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
aget-object v0, v0, p1
|
|
|
|
invoke-virtual {v0, v9}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
|
|
|
|
iget-object v0, v1, Lorg/webrtc/MediaCodecVideoDecoder;->inputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
aget-object v0, v0, p1
|
|
|
|
move/from16 v5, p2
|
|
|
|
invoke-virtual {v0, v5}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;
|
|
|
|
iget-object v0, v1, Lorg/webrtc/MediaCodecVideoDecoder;->decodeStartTimeMs:Ljava/util/Queue;
|
|
|
|
new-instance v2, Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;
|
|
|
|
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
|
|
|
|
move-result-wide v11
|
|
|
|
move-object v10, v2
|
|
|
|
move-wide/from16 v13, p5
|
|
|
|
move-wide/from16 v15, p7
|
|
|
|
invoke-direct/range {v10 .. v16}, Lorg/webrtc/MediaCodecVideoDecoder$TimeStamps;-><init>(JJJ)V
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z
|
|
|
|
iget-object v2, v1, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move/from16 v3, p1
|
|
|
|
move/from16 v5, p2
|
|
|
|
move-wide/from16 v6, p3
|
|
|
|
invoke-virtual/range {v2 .. v8}, Landroid/media/MediaCodec;->queueInputBuffer(IIIJI)V
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
const-string v2, "MediaCodecVideoDecoder"
|
|
|
|
const-string v3, "decode failed"
|
|
|
|
invoke-static {v2, v3, v0}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
return v9
|
|
.end method
|
|
|
|
.method private release()V
|
|
.locals 5
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
const-string v0, "Java releaseDecoder. Total number of dropped frames: "
|
|
|
|
invoke-static {v0}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
iget v1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->droppedFrames:I
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "MediaCodecVideoDecoder"
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/MediaCodecVideoDecoder;->checkOnMediaCodecThread()V
|
|
|
|
new-instance v0, Ljava/util/concurrent/CountDownLatch;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-direct {v0, v2}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
|
|
|
|
new-instance v3, Lorg/webrtc/MediaCodecVideoDecoder$1;
|
|
|
|
invoke-direct {v3, p0, v0}, Lorg/webrtc/MediaCodecVideoDecoder$1;-><init>(Lorg/webrtc/MediaCodecVideoDecoder;Ljava/util/concurrent/CountDownLatch;)V
|
|
|
|
new-instance v4, Ljava/lang/Thread;
|
|
|
|
invoke-direct {v4, v3}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V
|
|
|
|
invoke-virtual {v4}, Ljava/lang/Thread;->start()V
|
|
|
|
const-wide/16 v3, 0x1388
|
|
|
|
invoke-static {v0, v3, v4}, Lorg/webrtc/ThreadUtils;->awaitUninterruptibly(Ljava/util/concurrent/CountDownLatch;J)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string v0, "Media decoder release timeout"
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget v0, Lorg/webrtc/MediaCodecVideoDecoder;->codecErrors:I
|
|
|
|
add-int/2addr v0, v2
|
|
|
|
sput v0, Lorg/webrtc/MediaCodecVideoDecoder;->codecErrors:I
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->errorCallback:Lorg/webrtc/MediaCodecVideoDecoder$MediaCodecVideoDecoderErrorCallback;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, "Invoke codec error callback. Errors: "
|
|
|
|
invoke-static {v0}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
sget v2, Lorg/webrtc/MediaCodecVideoDecoder;->codecErrors:I
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->errorCallback:Lorg/webrtc/MediaCodecVideoDecoder$MediaCodecVideoDecoderErrorCallback;
|
|
|
|
sget v2, Lorg/webrtc/MediaCodecVideoDecoder;->codecErrors:I
|
|
|
|
invoke-interface {v0, v2}, Lorg/webrtc/MediaCodecVideoDecoder$MediaCodecVideoDecoderErrorCallback;->onMediaCodecVideoDecoderCriticalError(I)V
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
iput-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
sput-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->runningInstance:Lorg/webrtc/MediaCodecVideoDecoder;
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->useSurface()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
iget-object v2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->surface:Landroid/view/Surface;
|
|
|
|
invoke-virtual {v2}, Landroid/view/Surface;->release()V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->surface:Landroid/view/Surface;
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;->release()V
|
|
|
|
:cond_1
|
|
const-string v0, "Java releaseDecoder done"
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private reset(II)V
|
|
.locals 2
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodecThread:Ljava/lang/Thread;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Java reset: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " x "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "MediaCodecVideoDecoder"
|
|
|
|
invoke-static {v1, v0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
invoke-virtual {v0}, Landroid/media/MediaCodec;->flush()V
|
|
|
|
iput p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
iput p2, p0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->textureListener:Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0, p1, p2}, Lorg/webrtc/MediaCodecVideoDecoder$TextureListener;->setSize(II)V
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->decodeStartTimeMs:Ljava/util/Queue;
|
|
|
|
invoke-interface {p1}, Ljava/util/Queue;->clear()V
|
|
|
|
iget-object p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->dequeuedSurfaceOutputBuffers:Ljava/util/Queue;
|
|
|
|
invoke-interface {p1}, Ljava/util/Queue;->clear()V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput-boolean p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->hasDecodedFirstFrame:Z
|
|
|
|
iput p1, p0, Lorg/webrtc/MediaCodecVideoDecoder;->droppedFrames:I
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "Incorrect reset call for non-initialized decoder."
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private returnDecodedOutputBuffer(I)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/IllegalStateException;,
|
|
Landroid/media/MediaCodec$CodecException;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation build Lorg/webrtc/CalledByNativeUnchecked;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/MediaCodecVideoDecoder;->checkOnMediaCodecThread()V
|
|
|
|
invoke-static {}, Lorg/webrtc/MediaCodecVideoDecoder;->useSurface()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->mediaCodec:Landroid/media/MediaCodec;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroid/media/MediaCodec;->releaseOutputBuffer(IZ)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v0, "returnDecodedOutputBuffer() called for surface decoding."
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static setEglContext(Lorg/webrtc/EglBase$Context;)V
|
|
.locals 2
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, "MediaCodecVideoDecoder"
|
|
|
|
const-string v1, "Egl context already set."
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->w(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/EglBase;->release()V
|
|
|
|
:cond_0
|
|
invoke-static {p0}, Le0/d/i0;->a(Lorg/webrtc/EglBase$Context;)Lorg/webrtc/EglBase;
|
|
|
|
move-result-object p0
|
|
|
|
sput-object p0, Lorg/webrtc/MediaCodecVideoDecoder;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static setErrorCallback(Lorg/webrtc/MediaCodecVideoDecoder$MediaCodecVideoDecoderErrorCallback;)V
|
|
.locals 2
|
|
|
|
const-string v0, "MediaCodecVideoDecoder"
|
|
|
|
const-string v1, "Set error callback"
|
|
|
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sput-object p0, Lorg/webrtc/MediaCodecVideoDecoder;->errorCallback:Lorg/webrtc/MediaCodecVideoDecoder$MediaCodecVideoDecoderErrorCallback;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final supportedH264HwCodecPrefixes()[Ljava/lang/String;
|
|
.locals 3
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
const-string v1, "OMX.qcom."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v1, "OMX.Intel."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v1, "OMX.Exynos."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v1, "WebRTC-MediaTekH264"
|
|
|
|
invoke-static {v1}, Lorg/webrtc/PeerConnectionFactory;->fieldTrialsFindFullName(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "Enabled"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0x1b
|
|
|
|
if-lt v1, v2, :cond_0
|
|
|
|
const-string v1, "OMX.MTK."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v1
|
|
|
|
new-array v1, v1, [Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final supportedVp8HwCodecPrefixes()[Ljava/lang/String;
|
|
.locals 3
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
const-string v1, "OMX.qcom."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v1, "OMX.Nvidia."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v1, "OMX.Exynos."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v1, "OMX.Intel."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v1, "WebRTC-MediaTekVP8"
|
|
|
|
invoke-static {v1}, Lorg/webrtc/PeerConnectionFactory;->fieldTrialsFindFullName(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "Enabled"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0x18
|
|
|
|
if-lt v1, v2, :cond_0
|
|
|
|
const-string v1, "OMX.MTK."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v1
|
|
|
|
new-array v1, v1, [Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static useSurface()Z
|
|
.locals 1
|
|
|
|
sget-object v0, Lorg/webrtc/MediaCodecVideoDecoder;->eglBase:Lorg/webrtc/EglBase;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getColorFormat()I
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->colorFormat:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getHeight()I
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->height:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getInputBuffers()[Ljava/nio/ByteBuffer;
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->inputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getOutputBuffers()[Ljava/nio/ByteBuffer;
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->outputBuffers:[Ljava/nio/ByteBuffer;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getSliceHeight()I
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->sliceHeight:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getStride()I
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->stride:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getWidth()I
|
|
.locals 1
|
|
.annotation build Lorg/webrtc/CalledByNative;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lorg/webrtc/MediaCodecVideoDecoder;->width:I
|
|
|
|
return v0
|
|
.end method
|