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

368 lines
9.2 KiB
Smali

.class public Lorg/webrtc/TextureBufferImpl;
.super Ljava/lang/Object;
.source "TextureBufferImpl.java"
# interfaces
.implements Lorg/webrtc/VideoFrame$TextureBuffer;
# instance fields
.field public final height:I
.field public final id:I
.field public final refCountDelegate:Lorg/webrtc/RefCountDelegate;
.field public final toI420Handler:Landroid/os/Handler;
.field public final transformMatrix:Landroid/graphics/Matrix;
.field public final type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
.field public final unscaledHeight:I
.field public final unscaledWidth:I
.field public final width:I
.field public final yuvConverter:Lorg/webrtc/YuvConverter;
# direct methods
.method public constructor <init>(IIIILorg/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
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;
iput-object p8, p0, Lorg/webrtc/TextureBufferImpl;->toI420Handler:Landroid/os/Handler;
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
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;
iput-object p6, p0, Lorg/webrtc/TextureBufferImpl;->toI420Handler:Landroid/os/Handler;
iput-object p7, p0, Lorg/webrtc/TextureBufferImpl;->yuvConverter:Lorg/webrtc/YuvConverter;
new-instance p1, Lorg/webrtc/RefCountDelegate;
invoke-direct {p1, p8}, Lorg/webrtc/RefCountDelegate;-><init>(Ljava/lang/Runnable;)V
iput-object p1, p0, Lorg/webrtc/TextureBufferImpl;->refCountDelegate:Lorg/webrtc/RefCountDelegate;
return-void
.end method
.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;
new-instance v11, Li0/c/b;
invoke-direct {v11, p0}, Li0/c/b;-><init>(Lorg/webrtc/TextureBufferImpl;)V
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
# virtual methods
.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
.method public cropAndScale(IIIIII)Lorg/webrtc/VideoFrame$Buffer;
.locals 6
new-instance v1, Landroid/graphics/Matrix;
invoke-direct {v1}, Landroid/graphics/Matrix;-><init>()V
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->height:I
add-int/2addr p2, p4
sub-int p2, v0, p2
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
int-to-float v0, v0
div-float/2addr p2, v0
invoke-virtual {v1, p1, p2}, Landroid/graphics/Matrix;->preTranslate(FF)Z
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
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->height:I
int-to-float v0, v0
div-float/2addr p2, v0
invoke-virtual {v1, p1, p2}, Landroid/graphics/Matrix;->preScale(FF)Z
iget p1, p0, Lorg/webrtc/TextureBufferImpl;->unscaledWidth:I
mul-int p1, p1, p3
int-to-float p1, p1
iget p2, p0, Lorg/webrtc/TextureBufferImpl;->width:I
int-to-float p2, p2
div-float/2addr p1, p2
invoke-static {p1}, Ljava/lang/Math;->round(F)I
move-result v2
iget p1, p0, Lorg/webrtc/TextureBufferImpl;->unscaledHeight:I
mul-int p1, p1, p4
int-to-float p1, p1
iget p2, p0, Lorg/webrtc/TextureBufferImpl;->height:I
int-to-float p2, p2
div-float/2addr p1, p2
invoke-static {p1}, Ljava/lang/Math;->round(F)I
move-result v3
move-object v0, p0
move v4, p5
move v5, p6
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
.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
.method public getUnscaledHeight()I
.locals 1
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->unscaledHeight:I
return v0
.end method
.method public getUnscaledWidth()I
.locals 1
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->unscaledWidth:I
return v0
.end method
.method public getWidth()I
.locals 1
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->width:I
return v0
.end method
.method public release()V
.locals 1
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->refCountDelegate:Lorg/webrtc/RefCountDelegate;
invoke-virtual {v0}, Lorg/webrtc/RefCountDelegate;->release()V
return-void
.end method
.method public retain()V
.locals 1
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->refCountDelegate:Lorg/webrtc/RefCountDelegate;
invoke-virtual {v0}, Lorg/webrtc/RefCountDelegate;->retain()V
return-void
.end method
.method public toI420()Lorg/webrtc/VideoFrame$I420Buffer;
.locals 2
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->toI420Handler:Landroid/os/Handler;
new-instance v1, Li0/c/x;
invoke-direct {v1, p0}, Li0/c/x;-><init>(Lorg/webrtc/TextureBufferImpl;)V
invoke-static {v0, v1}, Lorg/webrtc/ThreadUtils;->invokeAtFrontUninterruptibly(Landroid/os/Handler;Ljava/util/concurrent/Callable;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lorg/webrtc/VideoFrame$I420Buffer;
return-object v0
.end method