apkfuckery/com.discord/smali_classes2/org/webrtc/TextureBufferImpl.smali

368 lines
9.2 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Lorg/webrtc/TextureBufferImpl;
2019-07-24 11:27:29 +00:00
.super Ljava/lang/Object;
.source "TextureBufferImpl.java"
# interfaces
.implements Lorg/webrtc/VideoFrame$TextureBuffer;
# instance fields
2019-12-06 03:29:40 +00:00
.field public final height:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final id:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final refCountDelegate:Lorg/webrtc/RefCountDelegate;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final toI420Handler:Landroid/os/Handler;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final transformMatrix:Landroid/graphics/Matrix;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final unscaledHeight:I
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
.field public final unscaledWidth:I
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
.field public final width:I
.field public final yuvConverter:Lorg/webrtc/YuvConverter;
2019-07-24 11:27:29 +00:00
# direct methods
2019-12-06 03:29:40 +00:00
.method public constructor <init>(IIIILorg/webrtc/VideoFrame$TextureBuffer$Type;ILandroid/graphics/Matrix;Landroid/os/Handler;Lorg/webrtc/YuvConverter;Ljava/lang/Runnable;)V
.locals 0
2019-07-24 11:27:29 +00:00
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
2019-12-06 03:29:40 +00:00
iput p1, p0, Lorg/webrtc/TextureBufferImpl;->unscaledWidth:I
iput p2, p0, Lorg/webrtc/TextureBufferImpl;->unscaledHeight:I
iput p3, p0, Lorg/webrtc/TextureBufferImpl;->width:I
iput p4, p0, Lorg/webrtc/TextureBufferImpl;->height:I
iput-object p5, p0, Lorg/webrtc/TextureBufferImpl;->type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
iput p6, p0, Lorg/webrtc/TextureBufferImpl;->id:I
iput-object p7, p0, Lorg/webrtc/TextureBufferImpl;->transformMatrix:Landroid/graphics/Matrix;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-object p8, p0, Lorg/webrtc/TextureBufferImpl;->toI420Handler:Landroid/os/Handler;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-object p9, p0, Lorg/webrtc/TextureBufferImpl;->yuvConverter:Lorg/webrtc/YuvConverter;
new-instance p1, Lorg/webrtc/RefCountDelegate;
invoke-direct {p1, p10}, Lorg/webrtc/RefCountDelegate;-><init>(Ljava/lang/Runnable;)V
iput-object p1, p0, Lorg/webrtc/TextureBufferImpl;->refCountDelegate:Lorg/webrtc/RefCountDelegate;
return-void
.end method
.method public constructor <init>(IILorg/webrtc/VideoFrame$TextureBuffer$Type;ILandroid/graphics/Matrix;Landroid/os/Handler;Lorg/webrtc/YuvConverter;Ljava/lang/Runnable;)V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput p1, p0, Lorg/webrtc/TextureBufferImpl;->unscaledWidth:I
iput p2, p0, Lorg/webrtc/TextureBufferImpl;->unscaledHeight:I
2019-07-24 11:27:29 +00:00
iput p1, p0, Lorg/webrtc/TextureBufferImpl;->width:I
iput p2, p0, Lorg/webrtc/TextureBufferImpl;->height:I
iput-object p3, p0, Lorg/webrtc/TextureBufferImpl;->type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
iput p4, p0, Lorg/webrtc/TextureBufferImpl;->id:I
iput-object p5, p0, Lorg/webrtc/TextureBufferImpl;->transformMatrix:Landroid/graphics/Matrix;
2019-12-06 03:29:40 +00:00
iput-object p6, p0, Lorg/webrtc/TextureBufferImpl;->toI420Handler:Landroid/os/Handler;
iput-object p7, p0, Lorg/webrtc/TextureBufferImpl;->yuvConverter:Lorg/webrtc/YuvConverter;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance p1, Lorg/webrtc/RefCountDelegate;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {p1, p8}, Lorg/webrtc/RefCountDelegate;-><init>(Ljava/lang/Runnable;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-object p1, p0, Lorg/webrtc/TextureBufferImpl;->refCountDelegate:Lorg/webrtc/RefCountDelegate;
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method private applyTransformMatrix(Landroid/graphics/Matrix;IIII)Lorg/webrtc/TextureBufferImpl;
.locals 13
move-object v0, p0
new-instance v8, Landroid/graphics/Matrix;
iget-object v1, v0, Lorg/webrtc/TextureBufferImpl;->transformMatrix:Landroid/graphics/Matrix;
invoke-direct {v8, v1}, Landroid/graphics/Matrix;-><init>(Landroid/graphics/Matrix;)V
move-object v1, p1
invoke-virtual {v8, p1}, Landroid/graphics/Matrix;->preConcat(Landroid/graphics/Matrix;)Z
invoke-virtual {p0}, Lorg/webrtc/TextureBufferImpl;->retain()V
new-instance v12, Lorg/webrtc/TextureBufferImpl;
iget-object v6, v0, Lorg/webrtc/TextureBufferImpl;->type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
iget v7, v0, Lorg/webrtc/TextureBufferImpl;->id:I
iget-object v9, v0, Lorg/webrtc/TextureBufferImpl;->toI420Handler:Landroid/os/Handler;
iget-object v10, v0, Lorg/webrtc/TextureBufferImpl;->yuvConverter:Lorg/webrtc/YuvConverter;
2019-12-21 01:41:59 +00:00
new-instance v11, Lz/d/b;
2019-12-06 03:29:40 +00:00
2019-12-21 01:41:59 +00:00
invoke-direct {v11, p0}, Lz/d/b;-><init>(Lorg/webrtc/TextureBufferImpl;)V
2019-12-06 03:29:40 +00:00
move-object v1, v12
move v2, p2
move/from16 v3, p3
move/from16 v4, p4
move/from16 v5, p5
invoke-direct/range {v1 .. v11}, Lorg/webrtc/TextureBufferImpl;-><init>(IIIILorg/webrtc/VideoFrame$TextureBuffer$Type;ILandroid/graphics/Matrix;Landroid/os/Handler;Lorg/webrtc/YuvConverter;Ljava/lang/Runnable;)V
return-object v12
.end method
2019-07-24 11:27:29 +00:00
# virtual methods
2019-12-06 03:29:40 +00:00
.method public synthetic a()Lorg/webrtc/VideoFrame$I420Buffer;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->yuvConverter:Lorg/webrtc/YuvConverter;
invoke-virtual {v0, p0}, Lorg/webrtc/YuvConverter;->convert(Lorg/webrtc/VideoFrame$TextureBuffer;)Lorg/webrtc/VideoFrame$I420Buffer;
move-result-object v0
return-object v0
.end method
.method public applyTransformMatrix(Landroid/graphics/Matrix;II)Lorg/webrtc/TextureBufferImpl;
.locals 6
move-object v0, p0
move-object v1, p1
move v2, p2
move v3, p3
move v4, p2
move v5, p3
invoke-direct/range {v0 .. v5}, Lorg/webrtc/TextureBufferImpl;->applyTransformMatrix(Landroid/graphics/Matrix;IIII)Lorg/webrtc/TextureBufferImpl;
move-result-object p1
return-object p1
.end method
2019-07-24 11:27:29 +00:00
.method public cropAndScale(IIIIII)Lorg/webrtc/VideoFrame$Buffer;
2019-12-06 03:29:40 +00:00
.locals 6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance v1, Landroid/graphics/Matrix;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v1}, Landroid/graphics/Matrix;-><init>()V
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->height:I
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr p2, p4
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
sub-int p2, v0, p2
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
int-to-float p1, p1
iget v2, p0, Lorg/webrtc/TextureBufferImpl;->width:I
int-to-float v2, v2
div-float/2addr p1, v2
int-to-float p2, p2
2019-07-24 11:27:29 +00:00
int-to-float v0, v0
2019-12-06 03:29:40 +00:00
div-float/2addr p2, v0
invoke-virtual {v1, p1, p2}, Landroid/graphics/Matrix;->preTranslate(FF)Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-float p1, p3
iget p2, p0, Lorg/webrtc/TextureBufferImpl;->width:I
int-to-float p2, p2
div-float/2addr p1, p2
int-to-float p2, p4
2019-07-24 11:27:29 +00:00
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->height:I
int-to-float v0, v0
2019-12-06 03:29:40 +00:00
div-float/2addr p2, v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v1, p1, p2}, Landroid/graphics/Matrix;->preScale(FF)Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget p1, p0, Lorg/webrtc/TextureBufferImpl;->unscaledWidth:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-int p1, p1, p3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-float p1, p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget p2, p0, Lorg/webrtc/TextureBufferImpl;->width:I
2019-07-24 11:27:29 +00:00
2019-12-06 01:29:57 +00:00
int-to-float p2, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
div-float/2addr p1, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p1}, Ljava/lang/Math;->round(F)I
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
move-result v2
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
iget p1, p0, Lorg/webrtc/TextureBufferImpl;->unscaledHeight:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-int p1, p1, p4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-float p1, p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget p2, p0, Lorg/webrtc/TextureBufferImpl;->height:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-float p2, p2
div-float/2addr p1, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p1}, Ljava/lang/Math;->round(F)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-object v0, p0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move v4, p5
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move v5, p6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct/range {v0 .. v5}, Lorg/webrtc/TextureBufferImpl;->applyTransformMatrix(Landroid/graphics/Matrix;IIII)Lorg/webrtc/TextureBufferImpl;
move-result-object p1
2019-07-24 11:27:29 +00:00
return-object p1
.end method
.method public getHeight()I
.locals 1
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->height:I
return v0
.end method
.method public getTextureId()I
.locals 1
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->id:I
return v0
.end method
.method public getTransformMatrix()Landroid/graphics/Matrix;
.locals 1
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->transformMatrix:Landroid/graphics/Matrix;
return-object v0
.end method
.method public getType()Lorg/webrtc/VideoFrame$TextureBuffer$Type;
.locals 1
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
return-object v0
.end method
2019-12-06 03:29:40 +00:00
.method public getUnscaledHeight()I
2019-07-24 11:27:29 +00:00
.locals 1
2019-12-06 03:29:40 +00:00
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->unscaledHeight:I
2019-07-24 11:27:29 +00:00
return v0
.end method
2019-12-06 03:29:40 +00:00
.method public getUnscaledWidth()I
.locals 1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->unscaledWidth:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
return v0
.end method
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.method public getWidth()I
.locals 1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->width:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
return v0
.end method
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.method public release()V
.locals 1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->refCountDelegate:Lorg/webrtc/RefCountDelegate;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v0}, Lorg/webrtc/RefCountDelegate;->release()V
2019-07-24 11:27:29 +00:00
2019-12-06 01:29:57 +00:00
return-void
2019-07-24 11:27:29 +00:00
.end method
.method public retain()V
2019-12-06 03:29:40 +00:00
.locals 1
2019-12-06 01:29:57 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->refCountDelegate:Lorg/webrtc/RefCountDelegate;
2019-12-06 01:29:57 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v0}, Lorg/webrtc/RefCountDelegate;->retain()V
2019-07-24 11:27:29 +00:00
return-void
2019-12-06 01:29:57 +00:00
.end method
2019-12-04 22:43:03 +00:00
2019-12-06 01:29:57 +00:00
.method public toI420()Lorg/webrtc/VideoFrame$I420Buffer;
2019-12-06 03:29:40 +00:00
.locals 2
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->toI420Handler:Landroid/os/Handler;
2019-07-24 11:27:29 +00:00
2019-12-21 01:41:59 +00:00
new-instance v1, Lz/d/x;
2019-12-06 03:29:40 +00:00
2019-12-21 01:41:59 +00:00
invoke-direct {v1, p0}, Lz/d/x;-><init>(Lorg/webrtc/TextureBufferImpl;)V
2019-12-06 03:29:40 +00:00
invoke-static {v0, v1}, Lorg/webrtc/ThreadUtils;->invokeAtFrontUninterruptibly(Landroid/os/Handler;Ljava/util/concurrent/Callable;)Ljava/lang/Object;
2019-07-24 11:27:29 +00:00
2019-12-06 01:29:57 +00:00
move-result-object v0
2019-12-04 22:43:03 +00:00
2019-12-06 03:29:40 +00:00
check-cast v0, Lorg/webrtc/VideoFrame$I420Buffer;
2019-07-24 11:27:29 +00:00
return-object v0
.end method