795 lines
22 KiB
Smali
795 lines
22 KiB
Smali
|
.class public Lorg/webrtc/SurfaceTextureHelper;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "SurfaceTextureHelper.java"
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field public static final TAG:Ljava/lang/String; = "SurfaceTextureHelper"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public final eglBase:Lorg/webrtc/EglBase;
|
||
|
|
||
|
.field public frameRotation:I
|
||
|
|
||
|
.field public final handler:Landroid/os/Handler;
|
||
|
|
||
|
.field public hasPendingTexture:Z
|
||
|
|
||
|
.field public isQuitting:Z
|
||
|
|
||
|
.field public volatile isTextureInUse:Z
|
||
|
|
||
|
.field public listener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
.field public final oesTextureId:I
|
||
|
|
||
|
.field public pendingListener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
.field public final setListenerRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
.field public final surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
.field public textureHeight:I
|
||
|
|
||
|
.field public textureWidth:I
|
||
|
|
||
|
.field public final timestampAligner:Lorg/webrtc/TimestampAligner;
|
||
|
|
||
|
.field public final yuvConverter:Lorg/webrtc/YuvConverter;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>(Lorg/webrtc/EglBase$Context;Landroid/os/Handler;Z)V
|
||
|
.locals 2
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
new-instance v0, Lorg/webrtc/YuvConverter;
|
||
|
|
||
|
invoke-direct {v0}, Lorg/webrtc/YuvConverter;-><init>()V
|
||
|
|
||
|
iput-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->yuvConverter:Lorg/webrtc/YuvConverter;
|
||
|
|
||
|
new-instance v0, Lorg/webrtc/SurfaceTextureHelper$2;
|
||
|
|
||
|
invoke-direct {v0, p0}, Lorg/webrtc/SurfaceTextureHelper$2;-><init>(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
|
||
|
iput-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->setListenerRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
invoke-virtual {p2}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
if-ne v0, v1, :cond_1
|
||
|
|
||
|
iput-object p2, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
if-eqz p3, :cond_0
|
||
|
|
||
|
new-instance p3, Lorg/webrtc/TimestampAligner;
|
||
|
|
||
|
invoke-direct {p3}, Lorg/webrtc/TimestampAligner;-><init>()V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
const/4 p3, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
iput-object p3, p0, Lorg/webrtc/SurfaceTextureHelper;->timestampAligner:Lorg/webrtc/TimestampAligner;
|
||
|
|
||
|
sget-object p3, Lorg/webrtc/EglBase;->CONFIG_PIXEL_BUFFER:[I
|
||
|
|
||
|
invoke-static {p1, p3}, Lf0/c/i0;->c(Lorg/webrtc/EglBase$Context;[I)Lorg/webrtc/EglBase;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
iput-object p1, p0, Lorg/webrtc/SurfaceTextureHelper;->eglBase:Lorg/webrtc/EglBase;
|
||
|
|
||
|
:try_start_0
|
||
|
invoke-interface {p1}, Lorg/webrtc/EglBase;->createDummyPbufferSurface()V
|
||
|
|
||
|
iget-object p1, p0, Lorg/webrtc/SurfaceTextureHelper;->eglBase:Lorg/webrtc/EglBase;
|
||
|
|
||
|
invoke-interface {p1}, Lorg/webrtc/EglBase;->makeCurrent()V
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
const p1, 0x8d65
|
||
|
|
||
|
invoke-static {p1}, Lorg/webrtc/GlUtil;->generateTexture(I)I
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
iput p1, p0, Lorg/webrtc/SurfaceTextureHelper;->oesTextureId:I
|
||
|
|
||
|
new-instance p1, Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
iget p3, p0, Lorg/webrtc/SurfaceTextureHelper;->oesTextureId:I
|
||
|
|
||
|
invoke-direct {p1, p3}, Landroid/graphics/SurfaceTexture;-><init>(I)V
|
||
|
|
||
|
iput-object p1, p0, Lorg/webrtc/SurfaceTextureHelper;->surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
new-instance p3, Lf0/c/p;
|
||
|
|
||
|
invoke-direct {p3, p0}, Lf0/c/p;-><init>(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
|
||
|
invoke-static {p1, p3, p2}, Lorg/webrtc/SurfaceTextureHelper;->setOnFrameAvailableListener(Landroid/graphics/SurfaceTexture;Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;Landroid/os/Handler;)V
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:catch_0
|
||
|
move-exception p1
|
||
|
|
||
|
iget-object p3, p0, Lorg/webrtc/SurfaceTextureHelper;->eglBase:Lorg/webrtc/EglBase;
|
||
|
|
||
|
invoke-interface {p3}, Lorg/webrtc/EglBase;->release()V
|
||
|
|
||
|
invoke-virtual {p2}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
invoke-virtual {p2}, Landroid/os/Looper;->quit()V
|
||
|
|
||
|
throw p1
|
||
|
|
||
|
:cond_1
|
||
|
new-instance p1, Ljava/lang/IllegalStateException;
|
||
|
|
||
|
const-string p2, "SurfaceTextureHelper must be created on the handler thread"
|
||
|
|
||
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public synthetic constructor <init>(Lorg/webrtc/EglBase$Context;Landroid/os/Handler;ZLorg/webrtc/SurfaceTextureHelper$1;)V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct {p0, p1, p2, p3}, Lorg/webrtc/SurfaceTextureHelper;-><init>(Lorg/webrtc/EglBase$Context;Landroid/os/Handler;Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static synthetic access$100(Lorg/webrtc/SurfaceTextureHelper;)Lorg/webrtc/VideoSink;
|
||
|
.locals 0
|
||
|
|
||
|
iget-object p0, p0, Lorg/webrtc/SurfaceTextureHelper;->pendingListener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
return-object p0
|
||
|
.end method
|
||
|
|
||
|
.method public static synthetic access$102(Lorg/webrtc/SurfaceTextureHelper;Lorg/webrtc/VideoSink;)Lorg/webrtc/VideoSink;
|
||
|
.locals 0
|
||
|
|
||
|
iput-object p1, p0, Lorg/webrtc/SurfaceTextureHelper;->pendingListener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
return-object p1
|
||
|
.end method
|
||
|
|
||
|
.method public static synthetic access$202(Lorg/webrtc/SurfaceTextureHelper;Lorg/webrtc/VideoSink;)Lorg/webrtc/VideoSink;
|
||
|
.locals 0
|
||
|
|
||
|
iput-object p1, p0, Lorg/webrtc/SurfaceTextureHelper;->listener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
return-object p1
|
||
|
.end method
|
||
|
|
||
|
.method public static synthetic access$300(Lorg/webrtc/SurfaceTextureHelper;)Z
|
||
|
.locals 0
|
||
|
|
||
|
iget-boolean p0, p0, Lorg/webrtc/SurfaceTextureHelper;->hasPendingTexture:Z
|
||
|
|
||
|
return p0
|
||
|
.end method
|
||
|
|
||
|
.method public static synthetic access$302(Lorg/webrtc/SurfaceTextureHelper;Z)Z
|
||
|
.locals 0
|
||
|
|
||
|
iput-boolean p1, p0, Lorg/webrtc/SurfaceTextureHelper;->hasPendingTexture:Z
|
||
|
|
||
|
return p1
|
||
|
.end method
|
||
|
|
||
|
.method public static synthetic access$400(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct {p0}, Lorg/webrtc/SurfaceTextureHelper;->updateTexImage()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static synthetic b(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct {p0}, Lorg/webrtc/SurfaceTextureHelper;->returnTextureFrame()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static create(Ljava/lang/String;Lorg/webrtc/EglBase$Context;)Lorg/webrtc/SurfaceTextureHelper;
|
||
|
.locals 1
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
invoke-static {p0, p1, v0}, Lorg/webrtc/SurfaceTextureHelper;->create(Ljava/lang/String;Lorg/webrtc/EglBase$Context;Z)Lorg/webrtc/SurfaceTextureHelper;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
return-object p0
|
||
|
.end method
|
||
|
|
||
|
.method public static create(Ljava/lang/String;Lorg/webrtc/EglBase$Context;Z)Lorg/webrtc/SurfaceTextureHelper;
|
||
|
.locals 2
|
||
|
|
||
|
new-instance v0, Landroid/os/HandlerThread;
|
||
|
|
||
|
invoke-direct {v0, p0}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/HandlerThread;->start()V
|
||
|
|
||
|
new-instance v1, Landroid/os/Handler;
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-direct {v1, v0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
|
||
|
|
||
|
new-instance v0, Lorg/webrtc/SurfaceTextureHelper$1;
|
||
|
|
||
|
invoke-direct {v0, p1, v1, p2, p0}, Lorg/webrtc/SurfaceTextureHelper$1;-><init>(Lorg/webrtc/EglBase$Context;Landroid/os/Handler;ZLjava/lang/String;)V
|
||
|
|
||
|
invoke-static {v1, v0}, Lorg/webrtc/ThreadUtils;->invokeAtFrontUninterruptibly(Landroid/os/Handler;Ljava/util/concurrent/Callable;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
check-cast p0, Lorg/webrtc/SurfaceTextureHelper;
|
||
|
|
||
|
return-object p0
|
||
|
.end method
|
||
|
|
||
|
.method private release()V
|
||
|
.locals 4
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
if-ne v0, v1, :cond_2
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isTextureInUse:Z
|
||
|
|
||
|
if-nez v0, :cond_1
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isQuitting:Z
|
||
|
|
||
|
if-eqz v0, :cond_1
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->yuvConverter:Lorg/webrtc/YuvConverter;
|
||
|
|
||
|
invoke-virtual {v0}, Lorg/webrtc/YuvConverter;->release()V
|
||
|
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
new-array v1, v0, [I
|
||
|
|
||
|
iget v2, p0, Lorg/webrtc/SurfaceTextureHelper;->oesTextureId:I
|
||
|
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
aput v2, v1, v3
|
||
|
|
||
|
invoke-static {v0, v1, v3}, Landroid/opengl/GLES20;->glDeleteTextures(I[II)V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/graphics/SurfaceTexture;->release()V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->eglBase:Lorg/webrtc/EglBase;
|
||
|
|
||
|
invoke-interface {v0}, Lorg/webrtc/EglBase;->release()V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/Looper;->quit()V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->timestampAligner:Lorg/webrtc/TimestampAligner;
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-virtual {v0}, Lorg/webrtc/TimestampAligner;->dispose()V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
new-instance v0, Ljava/lang/IllegalStateException;
|
||
|
|
||
|
const-string v1, "Unexpected release."
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw v0
|
||
|
|
||
|
:cond_2
|
||
|
new-instance v0, Ljava/lang/IllegalStateException;
|
||
|
|
||
|
const-string v1, "Wrong thread."
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw v0
|
||
|
.end method
|
||
|
|
||
|
.method private returnTextureFrame()V
|
||
|
.locals 2
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
new-instance v1, Lf0/c/u;
|
||
|
|
||
|
invoke-direct {v1, p0}, Lf0/c/u;-><init>(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
|
||
|
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static setOnFrameAvailableListener(Landroid/graphics/SurfaceTexture;Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;Landroid/os/Handler;)V
|
||
|
.locals 0
|
||
|
.annotation build Landroid/annotation/TargetApi;
|
||
|
value = 0x15
|
||
|
.end annotation
|
||
|
|
||
|
invoke-virtual {p0, p1, p2}, Landroid/graphics/SurfaceTexture;->setOnFrameAvailableListener(Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;Landroid/os/Handler;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private tryDeliverTextureFrame()V
|
||
|
.locals 13
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
if-ne v0, v1, :cond_4
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isQuitting:Z
|
||
|
|
||
|
if-nez v0, :cond_3
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->hasPendingTexture:Z
|
||
|
|
||
|
if-eqz v0, :cond_3
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isTextureInUse:Z
|
||
|
|
||
|
if-nez v0, :cond_3
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->listener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
iput-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isTextureInUse:Z
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->hasPendingTexture:Z
|
||
|
|
||
|
invoke-direct {p0}, Lorg/webrtc/SurfaceTextureHelper;->updateTexImage()V
|
||
|
|
||
|
const/16 v0, 0x10
|
||
|
|
||
|
new-array v0, v0, [F
|
||
|
|
||
|
iget-object v1, p0, Lorg/webrtc/SurfaceTextureHelper;->surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
invoke-virtual {v1, v0}, Landroid/graphics/SurfaceTexture;->getTransformMatrix([F)V
|
||
|
|
||
|
iget-object v1, p0, Lorg/webrtc/SurfaceTextureHelper;->surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
invoke-virtual {v1}, Landroid/graphics/SurfaceTexture;->getTimestamp()J
|
||
|
|
||
|
move-result-wide v1
|
||
|
|
||
|
iget-object v3, p0, Lorg/webrtc/SurfaceTextureHelper;->timestampAligner:Lorg/webrtc/TimestampAligner;
|
||
|
|
||
|
if-eqz v3, :cond_1
|
||
|
|
||
|
invoke-virtual {v3, v1, v2}, Lorg/webrtc/TimestampAligner;->translateTimestamp(J)J
|
||
|
|
||
|
move-result-wide v1
|
||
|
|
||
|
:cond_1
|
||
|
iget v4, p0, Lorg/webrtc/SurfaceTextureHelper;->textureWidth:I
|
||
|
|
||
|
if-eqz v4, :cond_2
|
||
|
|
||
|
iget v5, p0, Lorg/webrtc/SurfaceTextureHelper;->textureHeight:I
|
||
|
|
||
|
if-eqz v5, :cond_2
|
||
|
|
||
|
new-instance v12, Lorg/webrtc/TextureBufferImpl;
|
||
|
|
||
|
sget-object v6, Lorg/webrtc/VideoFrame$TextureBuffer$Type;->OES:Lorg/webrtc/VideoFrame$TextureBuffer$Type;
|
||
|
|
||
|
iget v7, p0, Lorg/webrtc/SurfaceTextureHelper;->oesTextureId:I
|
||
|
|
||
|
invoke-static {v0}, Lorg/webrtc/RendererCommon;->convertMatrixToAndroidGraphicsMatrix([F)Landroid/graphics/Matrix;
|
||
|
|
||
|
move-result-object v8
|
||
|
|
||
|
iget-object v9, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
iget-object v10, p0, Lorg/webrtc/SurfaceTextureHelper;->yuvConverter:Lorg/webrtc/YuvConverter;
|
||
|
|
||
|
new-instance v11, Lf0/c/t;
|
||
|
|
||
|
invoke-direct {v11, p0}, Lf0/c/t;-><init>(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
|
||
|
move-object v3, v12
|
||
|
|
||
|
invoke-direct/range {v3 .. v11}, Lorg/webrtc/TextureBufferImpl;-><init>(IILorg/webrtc/VideoFrame$TextureBuffer$Type;ILandroid/graphics/Matrix;Landroid/os/Handler;Lorg/webrtc/YuvConverter;Ljava/lang/Runnable;)V
|
||
|
|
||
|
new-instance v0, Lorg/webrtc/VideoFrame;
|
||
|
|
||
|
iget v3, p0, Lorg/webrtc/SurfaceTextureHelper;->frameRotation:I
|
||
|
|
||
|
invoke-direct {v0, v12, v3, v1, v2}, Lorg/webrtc/VideoFrame;-><init>(Lorg/webrtc/VideoFrame$Buffer;IJ)V
|
||
|
|
||
|
iget-object v1, p0, Lorg/webrtc/SurfaceTextureHelper;->listener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
invoke-interface {v1, v0}, Lorg/webrtc/VideoSink;->onFrame(Lorg/webrtc/VideoFrame;)V
|
||
|
|
||
|
invoke-virtual {v0}, Lorg/webrtc/VideoFrame;->release()V
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_2
|
||
|
new-instance v0, Ljava/lang/RuntimeException;
|
||
|
|
||
|
const-string v1, "Texture size has not been set."
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw v0
|
||
|
|
||
|
:cond_3
|
||
|
:goto_0
|
||
|
return-void
|
||
|
|
||
|
:cond_4
|
||
|
new-instance v0, Ljava/lang/IllegalStateException;
|
||
|
|
||
|
const-string v1, "Wrong thread."
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw v0
|
||
|
.end method
|
||
|
|
||
|
.method private updateTexImage()V
|
||
|
.locals 2
|
||
|
|
||
|
sget-object v0, Lorg/webrtc/EglBase;->lock:Ljava/lang/Object;
|
||
|
|
||
|
monitor-enter v0
|
||
|
|
||
|
:try_start_0
|
||
|
iget-object v1, p0, Lorg/webrtc/SurfaceTextureHelper;->surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
invoke-virtual {v1}, Landroid/graphics/SurfaceTexture;->updateTexImage()V
|
||
|
|
||
|
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
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public synthetic a()V
|
||
|
.locals 1
|
||
|
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
iput-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isQuitting:Z
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isTextureInUse:Z
|
||
|
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
invoke-direct {p0}, Lorg/webrtc/SurfaceTextureHelper;->release()V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public synthetic c(Landroid/graphics/SurfaceTexture;)V
|
||
|
.locals 0
|
||
|
|
||
|
const/4 p1, 0x1
|
||
|
|
||
|
iput-boolean p1, p0, Lorg/webrtc/SurfaceTextureHelper;->hasPendingTexture:Z
|
||
|
|
||
|
invoke-direct {p0}, Lorg/webrtc/SurfaceTextureHelper;->tryDeliverTextureFrame()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public synthetic d()V
|
||
|
.locals 1
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isTextureInUse:Z
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isQuitting:Z
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-direct {p0}, Lorg/webrtc/SurfaceTextureHelper;->release()V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
invoke-direct {p0}, Lorg/webrtc/SurfaceTextureHelper;->tryDeliverTextureFrame()V
|
||
|
|
||
|
:goto_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public dispose()V
|
||
|
.locals 2
|
||
|
|
||
|
const-string v0, "SurfaceTextureHelper"
|
||
|
|
||
|
const-string v1, "dispose()"
|
||
|
|
||
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
new-instance v1, Lf0/c/s;
|
||
|
|
||
|
invoke-direct {v1, p0}, Lf0/c/s;-><init>(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
|
||
|
invoke-static {v0, v1}, Lorg/webrtc/ThreadUtils;->invokeAtFrontUninterruptibly(Landroid/os/Handler;Ljava/lang/Runnable;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public synthetic e(I)V
|
||
|
.locals 0
|
||
|
|
||
|
iput p1, p0, Lorg/webrtc/SurfaceTextureHelper;->frameRotation:I
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public synthetic f(II)V
|
||
|
.locals 0
|
||
|
|
||
|
iput p1, p0, Lorg/webrtc/SurfaceTextureHelper;->textureWidth:I
|
||
|
|
||
|
iput p2, p0, Lorg/webrtc/SurfaceTextureHelper;->textureHeight:I
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public synthetic g()V
|
||
|
.locals 1
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->listener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
iput-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->pendingListener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public getHandler()Landroid/os/Handler;
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getSurfaceTexture()Landroid/graphics/SurfaceTexture;
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public isTextureInUse()Z
|
||
|
.locals 1
|
||
|
|
||
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceTextureHelper;->isTextureInUse:Z
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method public setFrameRotation(I)V
|
||
|
.locals 2
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
new-instance v1, Lf0/c/q;
|
||
|
|
||
|
invoke-direct {v1, p0, p1}, Lf0/c/q;-><init>(Lorg/webrtc/SurfaceTextureHelper;I)V
|
||
|
|
||
|
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setTextureSize(II)V
|
||
|
.locals 2
|
||
|
|
||
|
if-lez p1, :cond_1
|
||
|
|
||
|
if-lez p2, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->surfaceTexture:Landroid/graphics/SurfaceTexture;
|
||
|
|
||
|
invoke-virtual {v0, p1, p2}, Landroid/graphics/SurfaceTexture;->setDefaultBufferSize(II)V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
new-instance v1, Lf0/c/v;
|
||
|
|
||
|
invoke-direct {v1, p0, p1, p2}, Lf0/c/v;-><init>(Lorg/webrtc/SurfaceTextureHelper;II)V
|
||
|
|
||
|
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string v0, "Texture height must be positive, but was "
|
||
|
|
||
|
invoke-static {v0, p2}, Lf/e/c/a/a;->i(Ljava/lang/String;I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p1
|
||
|
|
||
|
:cond_1
|
||
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string v0, "Texture width must be positive, but was "
|
||
|
|
||
|
invoke-static {v0, p1}, Lf/e/c/a/a;->i(Ljava/lang/String;I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p2
|
||
|
.end method
|
||
|
|
||
|
.method public startListening(Lorg/webrtc/VideoSink;)V
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->listener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->pendingListener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
iput-object p1, p0, Lorg/webrtc/SurfaceTextureHelper;->pendingListener:Lorg/webrtc/VideoSink;
|
||
|
|
||
|
iget-object p1, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->setListenerRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
invoke-virtual {p1, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p1, Ljava/lang/IllegalStateException;
|
||
|
|
||
|
const-string v0, "SurfaceTextureHelper listener has already been set."
|
||
|
|
||
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public stopListening()V
|
||
|
.locals 2
|
||
|
|
||
|
const-string v0, "SurfaceTextureHelper"
|
||
|
|
||
|
const-string v1, "stopListening()"
|
||
|
|
||
|
invoke-static {v0, v1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
iget-object v1, p0, Lorg/webrtc/SurfaceTextureHelper;->setListenerRunnable:Ljava/lang/Runnable;
|
||
|
|
||
|
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
|
||
|
|
||
|
iget-object v0, p0, Lorg/webrtc/SurfaceTextureHelper;->handler:Landroid/os/Handler;
|
||
|
|
||
|
new-instance v1, Lf0/c/r;
|
||
|
|
||
|
invoke-direct {v1, p0}, Lf0/c/r;-><init>(Lorg/webrtc/SurfaceTextureHelper;)V
|
||
|
|
||
|
invoke-static {v0, v1}, Lorg/webrtc/ThreadUtils;->invokeAtFrontUninterruptibly(Landroid/os/Handler;Ljava/lang/Runnable;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public textureToYuv(Lorg/webrtc/VideoFrame$TextureBuffer;)Lorg/webrtc/VideoFrame$I420Buffer;
|
||
|
.locals 0
|
||
|
.annotation runtime Ljava/lang/Deprecated;
|
||
|
.end annotation
|
||
|
|
||
|
invoke-interface {p1}, Lorg/webrtc/VideoFrame$Buffer;->toI420()Lorg/webrtc/VideoFrame$I420Buffer;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
return-object p1
|
||
|
.end method
|