apkfuckery/com.discord/smali_classes2/org/webrtc/TextureBufferImpl.smali
2019-02-04 21:29:01 +01:00

251 lines
6 KiB
Smali

.class Lorg/webrtc/TextureBufferImpl;
.super Ljava/lang/Object;
.source "TextureBufferImpl.java"
# interfaces
.implements Lorg/webrtc/VideoFrame$TextureBuffer;
# instance fields
.field private final height:I
.field private final id:I
.field private refCount:I
.field private final refCountLock:Ljava/lang/Object;
.field private final releaseCallback:Ljava/lang/Runnable;
.field private final surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
.field private final transformMatrix:Landroid/graphics/Matrix;
.field private final type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
.field private final width:I
# direct methods
.method public constructor <init>(IILorg/webrtc/VideoFrame$TextureBuffer$Type;ILandroid/graphics/Matrix;Lorg/webrtc/SurfaceTextureHelper;Ljava/lang/Runnable;)V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lorg/webrtc/TextureBufferImpl;->refCountLock:Ljava/lang/Object;
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;->surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
iput-object p7, p0, Lorg/webrtc/TextureBufferImpl;->releaseCallback:Ljava/lang/Runnable;
const/4 p1, 0x1
iput p1, p0, Lorg/webrtc/TextureBufferImpl;->refCount:I
return-void
.end method
# virtual methods
.method public cropAndScale(IIIIII)Lorg/webrtc/VideoFrame$Buffer;
.locals 8
invoke-virtual {p0}, Lorg/webrtc/TextureBufferImpl;->retain()V
new-instance v5, Landroid/graphics/Matrix;
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->transformMatrix:Landroid/graphics/Matrix;
invoke-direct {v5, v0}, Landroid/graphics/Matrix;-><init>(Landroid/graphics/Matrix;)V
int-to-float p3, p3
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->width:I
int-to-float v0, v0
div-float/2addr p3, v0
int-to-float p4, p4
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->height:I
int-to-float v0, v0
div-float/2addr p4, v0
invoke-virtual {v5, p3, p4}, Landroid/graphics/Matrix;->postScale(FF)Z
int-to-float p1, p1
iget p3, p0, Lorg/webrtc/TextureBufferImpl;->width:I
int-to-float p3, p3
div-float/2addr p1, p3
int-to-float p2, p2
iget p3, p0, Lorg/webrtc/TextureBufferImpl;->height:I
int-to-float p3, p3
div-float/2addr p2, p3
invoke-virtual {v5, p1, p2}, Landroid/graphics/Matrix;->postTranslate(FF)Z
new-instance p1, Lorg/webrtc/TextureBufferImpl;
iget-object v3, p0, Lorg/webrtc/TextureBufferImpl;->type:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
iget v4, p0, Lorg/webrtc/TextureBufferImpl;->id:I
iget-object v6, p0, Lorg/webrtc/TextureBufferImpl;->surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
new-instance v7, Lorg/webrtc/TextureBufferImpl$1;
invoke-direct {v7, p0}, Lorg/webrtc/TextureBufferImpl$1;-><init>(Lorg/webrtc/TextureBufferImpl;)V
move-object v0, p1
move v1, p5
move v2, p6
invoke-direct/range {v0 .. v7}, Lorg/webrtc/TextureBufferImpl;-><init>(IILorg/webrtc/VideoFrame$TextureBuffer$Type;ILandroid/graphics/Matrix;Lorg/webrtc/SurfaceTextureHelper;Ljava/lang/Runnable;)V
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 getWidth()I
.locals 1
iget v0, p0, Lorg/webrtc/TextureBufferImpl;->width:I
return v0
.end method
.method public release()V
.locals 2
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->refCountLock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iget v1, p0, Lorg/webrtc/TextureBufferImpl;->refCount:I
add-int/lit8 v1, v1, -0x1
iput v1, p0, Lorg/webrtc/TextureBufferImpl;->refCount:I
if-nez v1, :cond_0
iget-object v1, p0, Lorg/webrtc/TextureBufferImpl;->releaseCallback:Ljava/lang/Runnable;
if-eqz v1, :cond_0
iget-object v1, p0, Lorg/webrtc/TextureBufferImpl;->releaseCallback:Ljava/lang/Runnable;
invoke-interface {v1}, Ljava/lang/Runnable;->run()V
:cond_0
monitor-exit v0
return-void
:catchall_0
move-exception v1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v1
.end method
.method public retain()V
.locals 2
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->refCountLock:Ljava/lang/Object;
monitor-enter v0
:try_start_0
iget v1, p0, Lorg/webrtc/TextureBufferImpl;->refCount:I
add-int/lit8 v1, v1, 0x1
iput v1, p0, Lorg/webrtc/TextureBufferImpl;->refCount:I
monitor-exit v0
return-void
:catchall_0
move-exception v1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v1
.end method
.method public toI420()Lorg/webrtc/VideoFrame$I420Buffer;
.locals 1
iget-object v0, p0, Lorg/webrtc/TextureBufferImpl;->surfaceTextureHelper:Lorg/webrtc/SurfaceTextureHelper;
invoke-virtual {v0, p0}, Lorg/webrtc/SurfaceTextureHelper;->textureToYuv(Lorg/webrtc/VideoFrame$TextureBuffer;)Lorg/webrtc/VideoFrame$I420Buffer;
move-result-object v0
return-object v0
.end method