Rabbit-R1/switch port/smali/smali_classes3/org/webrtc/EglRenderer.smali
2024-05-21 17:08:36 -04:00

2742 lines
65 KiB
Smali

.class public Lorg/webrtc/EglRenderer;
.super Ljava/lang/Object;
.source "EglRenderer.java"
# interfaces
.implements Lorg/webrtc/VideoSink;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lorg/webrtc/EglRenderer$HandlerWithExceptionCallback;,
Lorg/webrtc/EglRenderer$EglSurfaceCreation;,
Lorg/webrtc/EglRenderer$FrameListenerAndParams;,
Lorg/webrtc/EglRenderer$ErrorCallback;,
Lorg/webrtc/EglRenderer$FrameListener;
}
.end annotation
# static fields
.field private static final LOG_INTERVAL_SEC:J = 0x4L
.field private static final TAG:Ljava/lang/String; = "EglRenderer"
# instance fields
.field private final bitmapTextureFramebuffer:Lorg/webrtc/GlTextureFrameBuffer;
.field private final drawMatrix:Landroid/graphics/Matrix;
.field private drawer:Lorg/webrtc/RendererCommon$GlDrawer;
.field private eglBase:Lorg/webrtc/EglBase;
.field private final eglSurfaceCreationRunnable:Lorg/webrtc/EglRenderer$EglSurfaceCreation;
.field private volatile errorCallback:Lorg/webrtc/EglRenderer$ErrorCallback;
.field private final fpsReductionLock:Ljava/lang/Object;
.field private final frameDrawer:Lorg/webrtc/VideoFrameDrawer;
.field private final frameListeners:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Lorg/webrtc/EglRenderer$FrameListenerAndParams;",
">;"
}
.end annotation
.end field
.field private final frameLock:Ljava/lang/Object;
.field private framesDropped:I
.field private framesReceived:I
.field private framesRendered:I
.field private final handlerLock:Ljava/lang/Object;
.field private layoutAspectRatio:F
.field private final layoutLock:Ljava/lang/Object;
.field private final logStatisticsRunnable:Ljava/lang/Runnable;
.field private minRenderPeriodNs:J
.field private mirrorHorizontally:Z
.field private mirrorVertically:Z
.field protected final name:Ljava/lang/String;
.field private nextFrameTimeNs:J
.field private pendingFrame:Lorg/webrtc/VideoFrame;
.field private renderSwapBufferTimeNs:J
.field private renderThreadHandler:Landroid/os/Handler;
.field private renderTimeNs:J
.field private final statisticsLock:Ljava/lang/Object;
.field private statisticsStartTimeNs:J
.field private usePresentationTimeStamp:Z
# direct methods
.method public static synthetic $r8$lambda$im8Sa54i366ODPy-soB9Bg4O-w4(Lorg/webrtc/EglRenderer;)V
.locals 0
invoke-direct {p0}, Lorg/webrtc/EglRenderer;->renderFrameOnRenderThread()V
return-void
.end method
.method public constructor <init>(Ljava/lang/String;)V
.locals 1
.line 192
new-instance v0, Lorg/webrtc/VideoFrameDrawer;
invoke-direct {v0}, Lorg/webrtc/VideoFrameDrawer;-><init>()V
invoke-direct {p0, p1, v0}, Lorg/webrtc/EglRenderer;-><init>(Ljava/lang/String;Lorg/webrtc/VideoFrameDrawer;)V
return-void
.end method
.method public constructor <init>(Ljava/lang/String;Lorg/webrtc/VideoFrameDrawer;)V
.locals 2
.line 195
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 116
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 119
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->frameListeners:Ljava/util/ArrayList;
.line 124
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->fpsReductionLock:Ljava/lang/Object;
.line 137
new-instance v0, Landroid/graphics/Matrix;
invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
.line 140
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->frameLock:Ljava/lang/Object;
.line 144
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->layoutLock:Ljava/lang/Object;
.line 152
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->statisticsLock:Ljava/lang/Object;
.line 168
new-instance v0, Lorg/webrtc/GlTextureFrameBuffer;
const/16 v1, 0x1908
invoke-direct {v0, v1}, Lorg/webrtc/GlTextureFrameBuffer;-><init>(I)V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->bitmapTextureFramebuffer:Lorg/webrtc/GlTextureFrameBuffer;
.line 171
new-instance v0, Lorg/webrtc/EglRenderer$1;
invoke-direct {v0, p0}, Lorg/webrtc/EglRenderer$1;-><init>(Lorg/webrtc/EglRenderer;)V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->logStatisticsRunnable:Ljava/lang/Runnable;
.line 185
new-instance v0, Lorg/webrtc/EglRenderer$EglSurfaceCreation;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Lorg/webrtc/EglRenderer$EglSurfaceCreation;-><init>(Lorg/webrtc/EglRenderer;Lorg/webrtc/EglRenderer$1;)V
iput-object v0, p0, Lorg/webrtc/EglRenderer;->eglSurfaceCreationRunnable:Lorg/webrtc/EglRenderer$EglSurfaceCreation;
iput-object p1, p0, Lorg/webrtc/EglRenderer;->name:Ljava/lang/String;
iput-object p2, p0, Lorg/webrtc/EglRenderer;->frameDrawer:Lorg/webrtc/VideoFrameDrawer;
return-void
.end method
.method static synthetic access$000(Lorg/webrtc/EglRenderer;)Lorg/webrtc/EglBase;
.locals 0
.line 34
iget-object p0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
return-object p0
.end method
.method static synthetic access$100(Lorg/webrtc/EglRenderer;)V
.locals 0
.line 34
invoke-direct {p0}, Lorg/webrtc/EglRenderer;->logStatistics()V
return-void
.end method
.method static synthetic access$200(Lorg/webrtc/EglRenderer;)Ljava/lang/Object;
.locals 0
.line 34
iget-object p0, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
return-object p0
.end method
.method static synthetic access$300(Lorg/webrtc/EglRenderer;)Landroid/os/Handler;
.locals 0
.line 34
iget-object p0, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
return-object p0
.end method
.method static synthetic access$302(Lorg/webrtc/EglRenderer;Landroid/os/Handler;)Landroid/os/Handler;
.locals 0
.line 34
iput-object p1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
return-object p1
.end method
.method static synthetic access$400(Lorg/webrtc/EglRenderer;)Ljava/lang/Runnable;
.locals 0
.line 34
iget-object p0, p0, Lorg/webrtc/EglRenderer;->logStatisticsRunnable:Ljava/lang/Runnable;
return-object p0
.end method
.method private averageTimeAsString(JI)Ljava/lang/String;
.locals 3
if-gtz p3, :cond_0
const-string p0, "NA"
goto :goto_0
.line 752
:cond_0
new-instance p0, Ljava/lang/StringBuilder;
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
sget-object v0, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
int-to-long v1, p3
div-long/2addr p1, v1
invoke-virtual {v0, p1, p2}, Ljava/util/concurrent/TimeUnit;->toMicros(J)J
move-result-wide p1
invoke-virtual {p0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object p0
const-string p1, " us"
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
:goto_0
return-object p0
.end method
.method private clearSurfaceOnRenderThread(FFFF)V
.locals 1
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
if-eqz v0, :cond_0
.line 567
invoke-interface {v0}, Lorg/webrtc/EglBase;->hasSurface()Z
move-result v0
if-eqz v0, :cond_0
const-string v0, "clearSurface"
.line 568
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 569
invoke-static {p1, p2, p3, p4}, Landroid/opengl/GLES20;->glClearColor(FFFF)V
const/16 p1, 0x4000
.line 570
invoke-static {p1}, Landroid/opengl/GLES20;->glClear(I)V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
.line 571
invoke-interface {p0}, Lorg/webrtc/EglBase;->swapBuffers()V
:cond_0
return-void
.end method
.method private createEglSurfaceInternal(Ljava/lang/Object;)V
.locals 1
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglSurfaceCreationRunnable:Lorg/webrtc/EglRenderer$EglSurfaceCreation;
.line 271
invoke-virtual {v0, p1}, Lorg/webrtc/EglRenderer$EglSurfaceCreation;->setSurface(Ljava/lang/Object;)V
iget-object p1, p0, Lorg/webrtc/EglRenderer;->eglSurfaceCreationRunnable:Lorg/webrtc/EglRenderer$EglSurfaceCreation;
.line 272
invoke-direct {p0, p1}, Lorg/webrtc/EglRenderer;->postToRenderThread(Ljava/lang/Runnable;)V
return-void
.end method
.method private logD(Ljava/lang/String;)V
.locals 1
.line 781
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->name:Ljava/lang/String;
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
const-string p1, "EglRenderer"
invoke-static {p1, p0}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method private logE(Ljava/lang/String;Ljava/lang/Throwable;)V
.locals 1
.line 777
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->name:Ljava/lang/String;
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
const-string p1, "EglRenderer"
invoke-static {p1, p0, p2}, Lorg/webrtc/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
return-void
.end method
.method private logStatistics()V
.locals 12
const-string v0, "Duration: "
.line 756
new-instance v1, Ljava/text/DecimalFormat;
const-string v2, "#.0"
invoke-direct {v1, v2}, Ljava/text/DecimalFormat;-><init>(Ljava/lang/String;)V
.line 757
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v2
iget-object v4, p0, Lorg/webrtc/EglRenderer;->statisticsLock:Ljava/lang/Object;
.line 758
monitor-enter v4
:try_start_0
iget-wide v5, p0, Lorg/webrtc/EglRenderer;->statisticsStartTimeNs:J
sub-long v5, v2, v5
const-wide/16 v7, 0x0
cmp-long v7, v5, v7
if-lez v7, :cond_1
iget-wide v7, p0, Lorg/webrtc/EglRenderer;->minRenderPeriodNs:J
const-wide v9, 0x7fffffffffffffffL
cmp-long v7, v7, v9
if-nez v7, :cond_0
iget v7, p0, Lorg/webrtc/EglRenderer;->framesReceived:I
if-nez v7, :cond_0
goto/16 :goto_0
:cond_0
iget v7, p0, Lorg/webrtc/EglRenderer;->framesRendered:I
int-to-long v7, v7
.line 763
sget-object v9, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
const-wide/16 v10, 0x1
invoke-virtual {v9, v10, v11}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide v9
mul-long/2addr v7, v9
long-to-float v7, v7
long-to-float v8, v5
div-float/2addr v7, v8
.line 764
new-instance v8, Ljava/lang/StringBuilder;
invoke-direct {v8, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
sget-object v0, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {v0, v5, v6}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
move-result-wide v5
invoke-virtual {v8, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v0
const-string v5, " ms. Frames received: "
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget v5, p0, Lorg/webrtc/EglRenderer;->framesReceived:I
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v5, ". Dropped: "
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget v5, p0, Lorg/webrtc/EglRenderer;->framesDropped:I
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v5, ". Rendered: "
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget v5, p0, Lorg/webrtc/EglRenderer;->framesRendered:I
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v5, ". Render fps: "
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
float-to-double v5, v7
.line 768
invoke-virtual {v1, v5, v6}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ". Average render time: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-wide v5, p0, Lorg/webrtc/EglRenderer;->renderTimeNs:J
iget v1, p0, Lorg/webrtc/EglRenderer;->framesRendered:I
.line 769
invoke-direct {p0, v5, v6, v1}, Lorg/webrtc/EglRenderer;->averageTimeAsString(JI)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ". Average swapBuffer time: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-wide v5, p0, Lorg/webrtc/EglRenderer;->renderSwapBufferTimeNs:J
iget v1, p0, Lorg/webrtc/EglRenderer;->framesRendered:I
.line 771
invoke-direct {p0, v5, v6, v1}, Lorg/webrtc/EglRenderer;->averageTimeAsString(JI)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, "."
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
.line 764
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 772
invoke-direct {p0, v2, v3}, Lorg/webrtc/EglRenderer;->resetStatistics(J)V
.line 773
monitor-exit v4
return-void
.line 761
:cond_1
:goto_0
monitor-exit v4
return-void
:catchall_0
move-exception p0
.line 773
monitor-exit v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method private logW(Ljava/lang/String;)V
.locals 1
.line 785
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->name:Ljava/lang/String;
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
const-string p1, "EglRenderer"
invoke-static {p1, p0}, Lorg/webrtc/Logging;->w(Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method private notifyCallbacks(Lorg/webrtc/VideoFrame;Z)V
.locals 15
move-object v0, p0
iget-object v1, v0, Lorg/webrtc/EglRenderer;->frameListeners:Ljava/util/ArrayList;
.line 701
invoke-virtual {v1}, Ljava/util/ArrayList;->isEmpty()Z
move-result v1
if-eqz v1, :cond_0
return-void
:cond_0
iget-object v1, v0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
.line 704
invoke-virtual {v1}, Landroid/graphics/Matrix;->reset()V
iget-object v1, v0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
const/high16 v2, 0x3f000000 # 0.5f
.line 705
invoke-virtual {v1, v2, v2}, Landroid/graphics/Matrix;->preTranslate(FF)Z
iget-object v1, v0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
iget-boolean v2, v0, Lorg/webrtc/EglRenderer;->mirrorHorizontally:Z
const/high16 v3, -0x40800000 # -1.0f
const/high16 v4, 0x3f800000 # 1.0f
if-eqz v2, :cond_1
move v2, v3
goto :goto_0
:cond_1
move v2, v4
:goto_0
iget-boolean v5, v0, Lorg/webrtc/EglRenderer;->mirrorVertically:Z
if-eqz v5, :cond_2
move v5, v3
goto :goto_1
:cond_2
move v5, v4
.line 706
:goto_1
invoke-virtual {v1, v2, v5}, Landroid/graphics/Matrix;->preScale(FF)Z
iget-object v1, v0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
.line 707
invoke-virtual {v1, v4, v3}, Landroid/graphics/Matrix;->preScale(FF)Z
iget-object v1, v0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
const/high16 v2, -0x41000000 # -0.5f
.line 708
invoke-virtual {v1, v2, v2}, Landroid/graphics/Matrix;->preTranslate(FF)Z
iget-object v1, v0, Lorg/webrtc/EglRenderer;->frameListeners:Ljava/util/ArrayList;
.line 710
invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v1
.line 711
:goto_2
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_6
.line 712
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lorg/webrtc/EglRenderer$FrameListenerAndParams;
if-nez p2, :cond_3
.line 713
iget-boolean v3, v2, Lorg/webrtc/EglRenderer$FrameListenerAndParams;->applyFpsReduction:Z
if-eqz v3, :cond_3
goto :goto_2
.line 716
:cond_3
invoke-interface {v1}, Ljava/util/Iterator;->remove()V
.line 718
iget v3, v2, Lorg/webrtc/EglRenderer$FrameListenerAndParams;->scale:F
invoke-virtual/range {p1 .. p1}, Lorg/webrtc/VideoFrame;->getRotatedWidth()I
move-result v4
int-to-float v4, v4
mul-float/2addr v3, v4
float-to-int v3, v3
.line 719
iget v4, v2, Lorg/webrtc/EglRenderer$FrameListenerAndParams;->scale:F
invoke-virtual/range {p1 .. p1}, Lorg/webrtc/VideoFrame;->getRotatedHeight()I
move-result v5
int-to-float v5, v5
mul-float/2addr v4, v5
float-to-int v12, v4
if-eqz v3, :cond_5
if-nez v12, :cond_4
goto :goto_3
:cond_4
iget-object v4, v0, Lorg/webrtc/EglRenderer;->bitmapTextureFramebuffer:Lorg/webrtc/GlTextureFrameBuffer;
.line 726
invoke-virtual {v4, v3, v12}, Lorg/webrtc/GlTextureFrameBuffer;->setSize(II)V
iget-object v4, v0, Lorg/webrtc/EglRenderer;->bitmapTextureFramebuffer:Lorg/webrtc/GlTextureFrameBuffer;
.line 728
invoke-virtual {v4}, Lorg/webrtc/GlTextureFrameBuffer;->getFrameBufferId()I
move-result v4
const v13, 0x8d40
invoke-static {v13, v4}, Landroid/opengl/GLES20;->glBindFramebuffer(II)V
iget-object v4, v0, Lorg/webrtc/EglRenderer;->bitmapTextureFramebuffer:Lorg/webrtc/GlTextureFrameBuffer;
.line 730
invoke-virtual {v4}, Lorg/webrtc/GlTextureFrameBuffer;->getTextureId()I
move-result v4
const v5, 0x8ce0
const/16 v6, 0xde1
const/4 v14, 0x0
.line 729
invoke-static {v13, v5, v6, v4, v14}, Landroid/opengl/GLES20;->glFramebufferTexture2D(IIIII)V
const/4 v4, 0x0
.line 732
invoke-static {v4, v4, v4, v4}, Landroid/opengl/GLES20;->glClearColor(FFFF)V
const/16 v4, 0x4000
.line 733
invoke-static {v4}, Landroid/opengl/GLES20;->glClear(I)V
iget-object v4, v0, Lorg/webrtc/EglRenderer;->frameDrawer:Lorg/webrtc/VideoFrameDrawer;
.line 734
iget-object v6, v2, Lorg/webrtc/EglRenderer$FrameListenerAndParams;->drawer:Lorg/webrtc/RendererCommon$GlDrawer;
iget-object v7, v0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
const/4 v8, 0x0
const/4 v9, 0x0
move-object/from16 v5, p1
move v10, v3
move v11, v12
invoke-virtual/range {v4 .. v11}, Lorg/webrtc/VideoFrameDrawer;->drawFrame(Lorg/webrtc/VideoFrame;Lorg/webrtc/RendererCommon$GlDrawer;Landroid/graphics/Matrix;IIII)V
mul-int v4, v3, v12
mul-int/lit8 v4, v4, 0x4
.line 737
invoke-static {v4}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;
move-result-object v11
.line 738
invoke-static {v14, v14, v3, v12}, Landroid/opengl/GLES20;->glViewport(IIII)V
const/4 v4, 0x0
const/4 v5, 0x0
const/16 v8, 0x1908
const/16 v9, 0x1401
move v6, v3
move v7, v12
move-object v10, v11
.line 739
invoke-static/range {v4 .. v10}, Landroid/opengl/GLES20;->glReadPixels(IIIIIILjava/nio/Buffer;)V
.line 742
invoke-static {v13, v14}, Landroid/opengl/GLES20;->glBindFramebuffer(II)V
const-string v4, "EglRenderer.notifyCallbacks"
.line 743
invoke-static {v4}, Lorg/webrtc/GlUtil;->checkNoGLES2Error(Ljava/lang/String;)V
.line 745
sget-object v4, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
invoke-static {v3, v12, v4}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
move-result-object v3
.line 746
invoke-virtual {v3, v11}, Landroid/graphics/Bitmap;->copyPixelsFromBuffer(Ljava/nio/Buffer;)V
.line 747
iget-object v2, v2, Lorg/webrtc/EglRenderer$FrameListenerAndParams;->listener:Lorg/webrtc/EglRenderer$FrameListener;
invoke-interface {v2, v3}, Lorg/webrtc/EglRenderer$FrameListener;->onFrame(Landroid/graphics/Bitmap;)V
goto/16 :goto_2
.line 722
:cond_5
:goto_3
iget-object v2, v2, Lorg/webrtc/EglRenderer$FrameListenerAndParams;->listener:Lorg/webrtc/EglRenderer$FrameListener;
const/4 v3, 0x0
invoke-interface {v2, v3}, Lorg/webrtc/EglRenderer$FrameListener;->onFrame(Landroid/graphics/Bitmap;)V
goto/16 :goto_2
:cond_6
return-void
.end method
.method private postToRenderThread(Ljava/lang/Runnable;)V
.locals 1
iget-object v0, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 559
monitor-enter v0
:try_start_0
iget-object p0, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-eqz p0, :cond_0
.line 561
invoke-virtual {p0, p1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
.line 563
:cond_0
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method private renderFrameOnRenderThread()V
.locals 14
iget-object v0, p0, Lorg/webrtc/EglRenderer;->frameLock:Ljava/lang/Object;
.line 600
monitor-enter v0
:try_start_0
iget-object v9, p0, Lorg/webrtc/EglRenderer;->pendingFrame:Lorg/webrtc/VideoFrame;
if-nez v9, :cond_0
.line 602
monitor-exit v0
return-void
:cond_0
const/4 v1, 0x0
iput-object v1, p0, Lorg/webrtc/EglRenderer;->pendingFrame:Lorg/webrtc/VideoFrame;
.line 606
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_4
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
if-eqz v0, :cond_c
.line 607
invoke-interface {v0}, Lorg/webrtc/EglBase;->hasSurface()Z
move-result v0
if-nez v0, :cond_1
goto/16 :goto_b
:cond_1
iget-object v0, p0, Lorg/webrtc/EglRenderer;->fpsReductionLock:Ljava/lang/Object;
.line 614
monitor-enter v0
:try_start_1
iget-wide v1, p0, Lorg/webrtc/EglRenderer;->minRenderPeriodNs:J
const-wide v3, 0x7fffffffffffffffL
cmp-long v3, v1, v3
const/4 v4, 0x0
const/4 v10, 0x1
if-nez v3, :cond_2
:goto_0
move v11, v4
goto :goto_2
:cond_2
const-wide/16 v5, 0x0
cmp-long v1, v1, v5
if-gtz v1, :cond_3
:goto_1
move v11, v10
goto :goto_2
.line 622
:cond_3
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v1
iget-wide v5, p0, Lorg/webrtc/EglRenderer;->nextFrameTimeNs:J
cmp-long v3, v1, v5
if-gez v3, :cond_4
const-string v1, "Skipping frame rendering - fps reduction is active."
.line 624
invoke-direct {p0, v1}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
goto :goto_0
:cond_4
iget-wide v3, p0, Lorg/webrtc/EglRenderer;->minRenderPeriodNs:J
add-long/2addr v5, v3
iput-wide v5, p0, Lorg/webrtc/EglRenderer;->nextFrameTimeNs:J
.line 629
invoke-static {v5, v6, v1, v2}, Ljava/lang/Math;->max(JJ)J
move-result-wide v1
iput-wide v1, p0, Lorg/webrtc/EglRenderer;->nextFrameTimeNs:J
goto :goto_1
.line 633
:goto_2
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_3
.line 635
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v12
.line 637
invoke-virtual {v9}, Lorg/webrtc/VideoFrame;->getRotatedWidth()I
move-result v0
int-to-float v0, v0
invoke-virtual {v9}, Lorg/webrtc/VideoFrame;->getRotatedHeight()I
move-result v1
int-to-float v1, v1
div-float/2addr v0, v1
iget-object v1, p0, Lorg/webrtc/EglRenderer;->layoutLock:Ljava/lang/Object;
.line 639
monitor-enter v1
:try_start_2
iget v2, p0, Lorg/webrtc/EglRenderer;->layoutAspectRatio:F
const/4 v3, 0x0
cmpl-float v4, v2, v3
if-eqz v4, :cond_5
goto :goto_3
:cond_5
move v2, v0
.line 641
:goto_3
monitor-exit v1
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_2
cmpl-float v1, v0, v2
const/high16 v4, 0x3f800000 # 1.0f
if-lez v1, :cond_6
div-float/2addr v2, v0
move v0, v4
goto :goto_4
:cond_6
div-float/2addr v0, v2
move v2, v4
:goto_4
iget-object v1, p0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
.line 654
invoke-virtual {v1}, Landroid/graphics/Matrix;->reset()V
iget-object v1, p0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
const/high16 v5, 0x3f000000 # 0.5f
.line 655
invoke-virtual {v1, v5, v5}, Landroid/graphics/Matrix;->preTranslate(FF)Z
iget-object v1, p0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
iget-boolean v5, p0, Lorg/webrtc/EglRenderer;->mirrorHorizontally:Z
const/high16 v6, -0x40800000 # -1.0f
if-eqz v5, :cond_7
move v5, v6
goto :goto_5
:cond_7
move v5, v4
:goto_5
iget-boolean v7, p0, Lorg/webrtc/EglRenderer;->mirrorVertically:Z
if-eqz v7, :cond_8
move v4, v6
.line 656
:cond_8
invoke-virtual {v1, v5, v4}, Landroid/graphics/Matrix;->preScale(FF)Z
iget-object v1, p0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
.line 657
invoke-virtual {v1, v2, v0}, Landroid/graphics/Matrix;->preScale(FF)Z
iget-object v0, p0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
const/high16 v1, -0x41000000 # -0.5f
.line 658
invoke-virtual {v0, v1, v1}, Landroid/graphics/Matrix;->preTranslate(FF)Z
if-eqz v11, :cond_a
.line 662
:try_start_3
invoke-static {v3, v3, v3, v3}, Landroid/opengl/GLES20;->glClearColor(FFFF)V
const/16 v0, 0x4000
.line 663
invoke-static {v0}, Landroid/opengl/GLES20;->glClear(I)V
iget-object v1, p0, Lorg/webrtc/EglRenderer;->frameDrawer:Lorg/webrtc/VideoFrameDrawer;
iget-object v3, p0, Lorg/webrtc/EglRenderer;->drawer:Lorg/webrtc/RendererCommon$GlDrawer;
iget-object v4, p0, Lorg/webrtc/EglRenderer;->drawMatrix:Landroid/graphics/Matrix;
const/4 v5, 0x0
const/4 v6, 0x0
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
.line 665
invoke-interface {v0}, Lorg/webrtc/EglBase;->surfaceWidth()I
move-result v7
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
invoke-interface {v0}, Lorg/webrtc/EglBase;->surfaceHeight()I
move-result v8
move-object v2, v9
.line 664
invoke-virtual/range {v1 .. v8}, Lorg/webrtc/VideoFrameDrawer;->drawFrame(Lorg/webrtc/VideoFrame;Lorg/webrtc/RendererCommon$GlDrawer;Landroid/graphics/Matrix;IIII)V
.line 667
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v0
iget-boolean v2, p0, Lorg/webrtc/EglRenderer;->usePresentationTimeStamp:Z
if-eqz v2, :cond_9
iget-object v2, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
.line 669
invoke-virtual {v9}, Lorg/webrtc/VideoFrame;->getTimestampNs()J
move-result-wide v3
invoke-interface {v2, v3, v4}, Lorg/webrtc/EglBase;->swapBuffers(J)V
goto :goto_6
:cond_9
iget-object v2, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
.line 671
invoke-interface {v2}, Lorg/webrtc/EglBase;->swapBuffers()V
.line 674
:goto_6
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v2
iget-object v4, p0, Lorg/webrtc/EglRenderer;->statisticsLock:Ljava/lang/Object;
.line 675
monitor-enter v4
:try_end_3
.catch Lorg/webrtc/GlUtil$GlOutOfMemoryException; {:try_start_3 .. :try_end_3} :catch_0
.catchall {:try_start_3 .. :try_end_3} :catchall_1
:try_start_4
iget v5, p0, Lorg/webrtc/EglRenderer;->framesRendered:I
add-int/2addr v5, v10
iput v5, p0, Lorg/webrtc/EglRenderer;->framesRendered:I
iget-wide v5, p0, Lorg/webrtc/EglRenderer;->renderTimeNs:J
sub-long v7, v2, v12
add-long/2addr v5, v7
iput-wide v5, p0, Lorg/webrtc/EglRenderer;->renderTimeNs:J
iget-wide v5, p0, Lorg/webrtc/EglRenderer;->renderSwapBufferTimeNs:J
sub-long/2addr v2, v0
add-long/2addr v5, v2
iput-wide v5, p0, Lorg/webrtc/EglRenderer;->renderSwapBufferTimeNs:J
.line 679
monitor-exit v4
goto :goto_7
:catchall_0
move-exception v0
monitor-exit v4
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
:try_start_5
throw v0
.line 682
:cond_a
:goto_7
invoke-direct {p0, v9, v11}, Lorg/webrtc/EglRenderer;->notifyCallbacks(Lorg/webrtc/VideoFrame;Z)V
:try_end_5
.catch Lorg/webrtc/GlUtil$GlOutOfMemoryException; {:try_start_5 .. :try_end_5} :catch_0
.catchall {:try_start_5 .. :try_end_5} :catchall_1
.line 696
:goto_8
invoke-virtual {v9}, Lorg/webrtc/VideoFrame;->release()V
goto :goto_9
:catchall_1
move-exception p0
goto :goto_a
:catch_0
move-exception v0
:try_start_6
const-string v1, "Error while drawing frame"
.line 684
invoke-direct {p0, v1, v0}, Lorg/webrtc/EglRenderer;->logE(Ljava/lang/String;Ljava/lang/Throwable;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->errorCallback:Lorg/webrtc/EglRenderer$ErrorCallback;
if-eqz v0, :cond_b
.line 687
invoke-interface {v0}, Lorg/webrtc/EglRenderer$ErrorCallback;->onGlOutOfMemory()V
:cond_b
iget-object v0, p0, Lorg/webrtc/EglRenderer;->drawer:Lorg/webrtc/RendererCommon$GlDrawer;
.line 690
invoke-interface {v0}, Lorg/webrtc/RendererCommon$GlDrawer;->release()V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->frameDrawer:Lorg/webrtc/VideoFrameDrawer;
.line 691
invoke-virtual {v0}, Lorg/webrtc/VideoFrameDrawer;->release()V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->bitmapTextureFramebuffer:Lorg/webrtc/GlTextureFrameBuffer;
.line 692
invoke-virtual {p0}, Lorg/webrtc/GlTextureFrameBuffer;->release()V
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_1
goto :goto_8
:goto_9
return-void
.line 696
:goto_a
invoke-virtual {v9}, Lorg/webrtc/VideoFrame;->release()V
.line 697
throw p0
:catchall_2
move-exception p0
.line 641
:try_start_7
monitor-exit v1
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_2
throw p0
:catchall_3
move-exception p0
.line 633
:try_start_8
monitor-exit v0
:try_end_8
.catchall {:try_start_8 .. :try_end_8} :catchall_3
throw p0
:cond_c
:goto_b
const-string v0, "Dropping frame - No surface"
.line 608
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 609
invoke-virtual {v9}, Lorg/webrtc/VideoFrame;->release()V
return-void
:catchall_4
move-exception p0
.line 606
:try_start_9
monitor-exit v0
:try_end_9
.catchall {:try_start_9 .. :try_end_9} :catchall_4
throw p0
.end method
.method private resetStatistics(J)V
.locals 1
iget-object v0, p0, Lorg/webrtc/EglRenderer;->statisticsLock:Ljava/lang/Object;
.line 335
monitor-enter v0
:try_start_0
iput-wide p1, p0, Lorg/webrtc/EglRenderer;->statisticsStartTimeNs:J
const/4 p1, 0x0
iput p1, p0, Lorg/webrtc/EglRenderer;->framesReceived:I
iput p1, p0, Lorg/webrtc/EglRenderer;->framesDropped:I
iput p1, p0, Lorg/webrtc/EglRenderer;->framesRendered:I
const-wide/16 p1, 0x0
iput-wide p1, p0, Lorg/webrtc/EglRenderer;->renderTimeNs:J
iput-wide p1, p0, Lorg/webrtc/EglRenderer;->renderSwapBufferTimeNs:J
.line 342
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
# virtual methods
.method public addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;F)V
.locals 2
const/4 v0, 0x0
const/4 v1, 0x0
.line 432
invoke-virtual {p0, p1, p2, v0, v1}, Lorg/webrtc/EglRenderer;->addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;FLorg/webrtc/RendererCommon$GlDrawer;Z)V
return-void
.end method
.method public addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;FLorg/webrtc/RendererCommon$GlDrawer;)V
.locals 1
const/4 v0, 0x0
.line 446
invoke-virtual {p0, p1, p2, p3, v0}, Lorg/webrtc/EglRenderer;->addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;FLorg/webrtc/RendererCommon$GlDrawer;Z)V
return-void
.end method
.method public addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;FLorg/webrtc/RendererCommon$GlDrawer;Z)V
.locals 7
.line 462
new-instance v6, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda4;
move-object v0, v6
move-object v1, p0
move-object v2, p3
move-object v3, p1
move v4, p2
move v5, p4
invoke-direct/range {v0 .. v5}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda4;-><init>(Lorg/webrtc/EglRenderer;Lorg/webrtc/RendererCommon$GlDrawer;Lorg/webrtc/EglRenderer$FrameListener;FZ)V
invoke-direct {p0, v6}, Lorg/webrtc/EglRenderer;->postToRenderThread(Ljava/lang/Runnable;)V
return-void
.end method
.method public clearImage()V
.locals 1
const/4 v0, 0x0
.line 579
invoke-virtual {p0, v0, v0, v0, v0}, Lorg/webrtc/EglRenderer;->clearImage(FFFF)V
return-void
.end method
.method public clearImage(FFFF)V
.locals 9
iget-object v0, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 586
monitor-enter v0
:try_start_0
iget-object v1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-nez v1, :cond_0
.line 588
monitor-exit v0
return-void
.line 590
:cond_0
new-instance v8, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda6;
move-object v2, v8
move-object v3, p0
move v4, p1
move v5, p2
move v6, p3
move v7, p4
invoke-direct/range {v2 .. v7}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda6;-><init>(Lorg/webrtc/EglRenderer;FFFF)V
invoke-virtual {v1, v8}, Landroid/os/Handler;->postAtFrontOfQueue(Ljava/lang/Runnable;)Z
.line 591
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method public createEglSurface(Landroid/graphics/SurfaceTexture;)V
.locals 0
.line 267
invoke-direct {p0, p1}, Lorg/webrtc/EglRenderer;->createEglSurfaceInternal(Ljava/lang/Object;)V
return-void
.end method
.method public createEglSurface(Landroid/view/Surface;)V
.locals 0
.line 263
invoke-direct {p0, p1}, Lorg/webrtc/EglRenderer;->createEglSurfaceInternal(Ljava/lang/Object;)V
return-void
.end method
.method public disableFpsReduction()V
.locals 1
const/high16 v0, 0x7f800000 # Float.POSITIVE_INFINITY
.line 415
invoke-virtual {p0, v0}, Lorg/webrtc/EglRenderer;->setFpsReduction(F)V
return-void
.end method
.method public init(Lorg/webrtc/EglBase$Context;[ILorg/webrtc/RendererCommon$GlDrawer;)V
.locals 1
const/4 v0, 0x0
.line 259
invoke-virtual {p0, p1, p2, p3, v0}, Lorg/webrtc/EglRenderer;->init(Lorg/webrtc/EglBase$Context;[ILorg/webrtc/RendererCommon$GlDrawer;Z)V
return-void
.end method
.method public init(Lorg/webrtc/EglBase$Context;[ILorg/webrtc/RendererCommon$GlDrawer;Z)V
.locals 2
iget-object v0, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 210
monitor-enter v0
:try_start_0
iget-object v1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-nez v1, :cond_0
const-string v1, "Initializing EglRenderer"
.line 214
invoke-direct {p0, v1}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
iput-object p3, p0, Lorg/webrtc/EglRenderer;->drawer:Lorg/webrtc/RendererCommon$GlDrawer;
iput-boolean p4, p0, Lorg/webrtc/EglRenderer;->usePresentationTimeStamp:Z
.line 218
new-instance p3, Landroid/os/HandlerThread;
new-instance p4, Ljava/lang/StringBuilder;
invoke-direct {p4}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lorg/webrtc/EglRenderer;->name:Ljava/lang/String;
invoke-virtual {p4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p4
const-string v1, "EglRenderer"
invoke-virtual {p4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p4
invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p4
invoke-direct {p3, p4}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V
.line 219
invoke-virtual {p3}, Landroid/os/HandlerThread;->start()V
.line 220
new-instance p4, Lorg/webrtc/EglRenderer$HandlerWithExceptionCallback;
.line 221
invoke-virtual {p3}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;
move-result-object p3
new-instance v1, Lorg/webrtc/EglRenderer$2;
invoke-direct {v1, p0}, Lorg/webrtc/EglRenderer$2;-><init>(Lorg/webrtc/EglRenderer;)V
invoke-direct {p4, p3, v1}, Lorg/webrtc/EglRenderer$HandlerWithExceptionCallback;-><init>(Landroid/os/Looper;Ljava/lang/Runnable;)V
iput-object p4, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
.line 232
new-instance p3, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda7;
invoke-direct {p3, p0, p1, p2}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda7;-><init>(Lorg/webrtc/EglRenderer;Lorg/webrtc/EglBase$Context;[I)V
invoke-static {p4, p3}, Lorg/webrtc/ThreadUtils;->invokeAtFrontUninterruptibly(Landroid/os/Handler;Ljava/lang/Runnable;)V
iget-object p1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
iget-object p2, p0, Lorg/webrtc/EglRenderer;->eglSurfaceCreationRunnable:Lorg/webrtc/EglRenderer$EglSurfaceCreation;
.line 244
invoke-virtual {p1, p2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
.line 245
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide p1
.line 246
invoke-direct {p0, p1, p2}, Lorg/webrtc/EglRenderer;->resetStatistics(J)V
iget-object p1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
iget-object p0, p0, Lorg/webrtc/EglRenderer;->logStatisticsRunnable:Ljava/lang/Runnable;
.line 247
sget-object p2, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
const-wide/16 p3, 0x4
.line 248
invoke-virtual {p2, p3, p4}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
move-result-wide p2
.line 247
invoke-virtual {p1, p0, p2, p3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
.line 249
monitor-exit v0
return-void
.line 212
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->name:Ljava/lang/String;
invoke-virtual {p2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
const-string p2, "Already initialized"
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:catchall_0
move-exception p0
.line 249
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method synthetic lambda$addFrameListener$3$org-webrtc-EglRenderer(Lorg/webrtc/RendererCommon$GlDrawer;Lorg/webrtc/EglRenderer$FrameListener;FZ)V
.locals 1
.line 0
if-nez p1, :cond_0
iget-object p1, p0, Lorg/webrtc/EglRenderer;->drawer:Lorg/webrtc/RendererCommon$GlDrawer;
:cond_0
iget-object p0, p0, Lorg/webrtc/EglRenderer;->frameListeners:Ljava/util/ArrayList;
.line 464
new-instance v0, Lorg/webrtc/EglRenderer$FrameListenerAndParams;
invoke-direct {v0, p2, p3, p1, p4}, Lorg/webrtc/EglRenderer$FrameListenerAndParams;-><init>(Lorg/webrtc/EglRenderer$FrameListener;FLorg/webrtc/RendererCommon$GlDrawer;Z)V
invoke-virtual {p0, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
return-void
.end method
.method synthetic lambda$clearImage$6$org-webrtc-EglRenderer(FFFF)V
.locals 0
.line 590
invoke-direct {p0, p1, p2, p3, p4}, Lorg/webrtc/EglRenderer;->clearSurfaceOnRenderThread(FFFF)V
return-void
.end method
.method synthetic lambda$init$0$org-webrtc-EglRenderer(Lorg/webrtc/EglBase$Context;[I)V
.locals 1
.line 0
if-nez p1, :cond_0
const-string p1, "EglBase10.create context"
.line 237
invoke-direct {p0, p1}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 238
invoke-static {p2}, Lorg/webrtc/EglBase;->createEgl10([I)Lorg/webrtc/EglBase10;
move-result-object p1
iput-object p1, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
goto :goto_0
:cond_0
const-string v0, "EglBase.create shared context"
.line 240
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 241
invoke-static {p1, p2}, Lorg/webrtc/EglBase;->create(Lorg/webrtc/EglBase$Context;[I)Lorg/webrtc/EglBase;
move-result-object p1
iput-object p1, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
:goto_0
return-void
.end method
.method synthetic lambda$release$1$org-webrtc-EglRenderer(Ljava/util/concurrent/CountDownLatch;)V
.locals 2
.line 293
sget-object v0, Lorg/webrtc/EglBase;->lock:Ljava/lang/Object;
monitor-enter v0
const/4 v1, 0x0
.line 294
:try_start_0
invoke-static {v1}, Landroid/opengl/GLES20;->glUseProgram(I)V
.line 295
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
iget-object v0, p0, Lorg/webrtc/EglRenderer;->drawer:Lorg/webrtc/RendererCommon$GlDrawer;
const/4 v1, 0x0
if-eqz v0, :cond_0
.line 297
invoke-interface {v0}, Lorg/webrtc/RendererCommon$GlDrawer;->release()V
iput-object v1, p0, Lorg/webrtc/EglRenderer;->drawer:Lorg/webrtc/RendererCommon$GlDrawer;
:cond_0
iget-object v0, p0, Lorg/webrtc/EglRenderer;->frameDrawer:Lorg/webrtc/VideoFrameDrawer;
.line 300
invoke-virtual {v0}, Lorg/webrtc/VideoFrameDrawer;->release()V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->bitmapTextureFramebuffer:Lorg/webrtc/GlTextureFrameBuffer;
.line 301
invoke-virtual {v0}, Lorg/webrtc/GlTextureFrameBuffer;->release()V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
if-eqz v0, :cond_1
const-string v0, "eglBase detach and release."
.line 303
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
.line 304
invoke-interface {v0}, Lorg/webrtc/EglBase;->detachCurrent()V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
.line 305
invoke-interface {v0}, Lorg/webrtc/EglBase;->release()V
iput-object v1, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
:cond_1
iget-object p0, p0, Lorg/webrtc/EglRenderer;->frameListeners:Ljava/util/ArrayList;
.line 308
invoke-virtual {p0}, Ljava/util/ArrayList;->clear()V
.line 309
invoke-virtual {p1}, Ljava/util/concurrent/CountDownLatch;->countDown()V
return-void
:catchall_0
move-exception p0
.line 295
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p0
.end method
.method synthetic lambda$release$2$org-webrtc-EglRenderer(Landroid/os/Looper;)V
.locals 1
.line 0
const-string v0, "Quitting render thread."
.line 314
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 315
invoke-virtual {p1}, Landroid/os/Looper;->quit()V
return-void
.end method
.method synthetic lambda$releaseEglSurface$5$org-webrtc-EglRenderer(Ljava/lang/Runnable;)V
.locals 1
.line 0
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
if-eqz v0, :cond_0
.line 544
invoke-interface {v0}, Lorg/webrtc/EglBase;->detachCurrent()V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->eglBase:Lorg/webrtc/EglBase;
.line 545
invoke-interface {p0}, Lorg/webrtc/EglBase;->releaseSurface()V
.line 547
:cond_0
invoke-interface {p1}, Ljava/lang/Runnable;->run()V
return-void
.end method
.method synthetic lambda$removeFrameListener$4$org-webrtc-EglRenderer(Ljava/util/concurrent/CountDownLatch;Lorg/webrtc/EglRenderer$FrameListener;)V
.locals 0
.line 486
invoke-virtual {p1}, Ljava/util/concurrent/CountDownLatch;->countDown()V
iget-object p0, p0, Lorg/webrtc/EglRenderer;->frameListeners:Ljava/util/ArrayList;
.line 487
invoke-virtual {p0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object p0
.line 488
:cond_0
:goto_0
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result p1
if-eqz p1, :cond_1
.line 489
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p1
check-cast p1, Lorg/webrtc/EglRenderer$FrameListenerAndParams;
iget-object p1, p1, Lorg/webrtc/EglRenderer$FrameListenerAndParams;->listener:Lorg/webrtc/EglRenderer$FrameListener;
if-ne p1, p2, :cond_0
.line 490
invoke-interface {p0}, Ljava/util/Iterator;->remove()V
goto :goto_0
:cond_1
return-void
.end method
.method public onFrame(Lorg/webrtc/VideoFrame;)V
.locals 5
iget-object v0, p0, Lorg/webrtc/EglRenderer;->statisticsLock:Ljava/lang/Object;
.line 506
monitor-enter v0
:try_start_0
iget v1, p0, Lorg/webrtc/EglRenderer;->framesReceived:I
const/4 v2, 0x1
add-int/2addr v1, v2
iput v1, p0, Lorg/webrtc/EglRenderer;->framesReceived:I
.line 508
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_3
iget-object v1, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 510
monitor-enter v1
:try_start_1
iget-object v0, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-nez v0, :cond_0
const-string p1, "Dropping frame - Not initialized or already released."
.line 512
invoke-direct {p0, p1}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 513
monitor-exit v1
return-void
:cond_0
iget-object v0, p0, Lorg/webrtc/EglRenderer;->frameLock:Ljava/lang/Object;
.line 515
monitor-enter v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_2
:try_start_2
iget-object v3, p0, Lorg/webrtc/EglRenderer;->pendingFrame:Lorg/webrtc/VideoFrame;
if-eqz v3, :cond_1
move v4, v2
goto :goto_0
:cond_1
const/4 v4, 0x0
:goto_0
if-eqz v4, :cond_2
.line 518
invoke-virtual {v3}, Lorg/webrtc/VideoFrame;->release()V
:cond_2
iput-object p1, p0, Lorg/webrtc/EglRenderer;->pendingFrame:Lorg/webrtc/VideoFrame;
.line 521
invoke-virtual {p1}, Lorg/webrtc/VideoFrame;->retain()V
iget-object p1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
.line 522
new-instance v3, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda0;
invoke-direct {v3, p0}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda0;-><init>(Lorg/webrtc/EglRenderer;)V
invoke-virtual {p1, v3}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
.line 523
monitor-exit v0
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
.line 524
:try_start_3
monitor-exit v1
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_2
if-eqz v4, :cond_3
iget-object p1, p0, Lorg/webrtc/EglRenderer;->statisticsLock:Ljava/lang/Object;
.line 526
monitor-enter p1
:try_start_4
iget v0, p0, Lorg/webrtc/EglRenderer;->framesDropped:I
add-int/2addr v0, v2
iput v0, p0, Lorg/webrtc/EglRenderer;->framesDropped:I
.line 528
monitor-exit p1
goto :goto_1
:catchall_0
move-exception p0
monitor-exit p1
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
throw p0
:cond_3
:goto_1
return-void
:catchall_1
move-exception p0
.line 523
:try_start_5
monitor-exit v0
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_1
:try_start_6
throw p0
:catchall_2
move-exception p0
.line 524
monitor-exit v1
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_2
throw p0
:catchall_3
move-exception p0
.line 508
:try_start_7
monitor-exit v0
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_3
throw p0
.end method
.method public pauseVideo()V
.locals 1
const/4 v0, 0x0
.line 419
invoke-virtual {p0, v0}, Lorg/webrtc/EglRenderer;->setFpsReduction(F)V
return-void
.end method
.method public printStackTrace()V
.locals 5
iget-object v0, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 346
monitor-enter v0
:try_start_0
iget-object v1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-nez v1, :cond_0
const/4 v1, 0x0
goto :goto_0
.line 348
:cond_0
invoke-virtual {v1}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
move-result-object v1
invoke-virtual {v1}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
move-result-object v1
:goto_0
if-eqz v1, :cond_1
.line 350
invoke-virtual {v1}, Ljava/lang/Thread;->getStackTrace()[Ljava/lang/StackTraceElement;
move-result-object v1
.line 351
array-length v2, v1
if-lez v2, :cond_1
const-string v2, "EglRenderer stack trace:"
.line 352
invoke-direct {p0, v2}, Lorg/webrtc/EglRenderer;->logW(Ljava/lang/String;)V
.line 353
array-length v2, v1
const/4 v3, 0x0
:goto_1
if-ge v3, v2, :cond_1
aget-object v4, v1, v3
.line 354
invoke-virtual {v4}, Ljava/lang/StackTraceElement;->toString()Ljava/lang/String;
move-result-object v4
invoke-direct {p0, v4}, Lorg/webrtc/EglRenderer;->logW(Ljava/lang/String;)V
add-int/lit8 v3, v3, 0x1
goto :goto_1
.line 358
:cond_1
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method public release()V
.locals 5
const-string v0, "Releasing."
.line 282
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 283
new-instance v0, Ljava/util/concurrent/CountDownLatch;
const/4 v1, 0x1
invoke-direct {v0, v1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
iget-object v1, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 284
monitor-enter v1
:try_start_0
iget-object v2, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-nez v2, :cond_0
const-string v0, "Already released"
.line 286
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
.line 287
monitor-exit v1
return-void
:cond_0
iget-object v3, p0, Lorg/webrtc/EglRenderer;->logStatisticsRunnable:Ljava/lang/Runnable;
.line 289
invoke-virtual {v2, v3}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v2, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
.line 291
new-instance v3, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda2;
invoke-direct {v3, p0, v0}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda2;-><init>(Lorg/webrtc/EglRenderer;Ljava/util/concurrent/CountDownLatch;)V
invoke-virtual {v2, v3}, Landroid/os/Handler;->postAtFrontOfQueue(Ljava/lang/Runnable;)Z
iget-object v2, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
.line 311
invoke-virtual {v2}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
move-result-object v2
iget-object v3, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
.line 313
new-instance v4, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda3;
invoke-direct {v4, p0, v2}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda3;-><init>(Lorg/webrtc/EglRenderer;Landroid/os/Looper;)V
invoke-virtual {v3, v4}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
const/4 v2, 0x0
iput-object v2, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
.line 319
monitor-exit v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
.line 321
invoke-static {v0}, Lorg/webrtc/ThreadUtils;->awaitUninterruptibly(Ljava/util/concurrent/CountDownLatch;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->frameLock:Ljava/lang/Object;
.line 322
monitor-enter v0
:try_start_1
iget-object v1, p0, Lorg/webrtc/EglRenderer;->pendingFrame:Lorg/webrtc/VideoFrame;
if-eqz v1, :cond_1
.line 324
invoke-virtual {v1}, Lorg/webrtc/VideoFrame;->release()V
iput-object v2, p0, Lorg/webrtc/EglRenderer;->pendingFrame:Lorg/webrtc/VideoFrame;
.line 327
:cond_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
const-string v0, "Releasing done."
.line 328
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
return-void
:catchall_0
move-exception p0
.line 327
:try_start_2
monitor-exit v0
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
throw p0
:catchall_1
move-exception p0
.line 319
:try_start_3
monitor-exit v1
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
throw p0
.end method
.method public releaseEglSurface(Ljava/lang/Runnable;)V
.locals 3
iget-object v0, p0, Lorg/webrtc/EglRenderer;->eglSurfaceCreationRunnable:Lorg/webrtc/EglRenderer$EglSurfaceCreation;
const/4 v1, 0x0
.line 538
invoke-virtual {v0, v1}, Lorg/webrtc/EglRenderer$EglSurfaceCreation;->setSurface(Ljava/lang/Object;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 539
monitor-enter v0
:try_start_0
iget-object v1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-eqz v1, :cond_0
iget-object v2, p0, Lorg/webrtc/EglRenderer;->eglSurfaceCreationRunnable:Lorg/webrtc/EglRenderer$EglSurfaceCreation;
.line 541
invoke-virtual {v1, v2}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v1, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
.line 542
new-instance v2, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda5;
invoke-direct {v2, p0, p1}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda5;-><init>(Lorg/webrtc/EglRenderer;Ljava/lang/Runnable;)V
invoke-virtual {v1, v2}, Landroid/os/Handler;->postAtFrontOfQueue(Ljava/lang/Runnable;)Z
.line 549
monitor-exit v0
return-void
.line 551
:cond_0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 552
invoke-interface {p1}, Ljava/lang/Runnable;->run()V
return-void
:catchall_0
move-exception p0
.line 551
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p0
.end method
.method public removeFrameListener(Lorg/webrtc/EglRenderer$FrameListener;)V
.locals 4
.line 477
new-instance v0, Ljava/util/concurrent/CountDownLatch;
const/4 v1, 0x1
invoke-direct {v0, v1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
iget-object v1, p0, Lorg/webrtc/EglRenderer;->handlerLock:Ljava/lang/Object;
.line 478
monitor-enter v1
:try_start_0
iget-object v2, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
if-nez v2, :cond_0
.line 480
monitor-exit v1
return-void
.line 482
:cond_0
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v2
iget-object v3, p0, Lorg/webrtc/EglRenderer;->renderThreadHandler:Landroid/os/Handler;
invoke-virtual {v3}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;
move-result-object v3
invoke-virtual {v3}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
move-result-object v3
if-eq v2, v3, :cond_1
.line 485
new-instance v2, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda1;
invoke-direct {v2, p0, v0, p1}, Lorg/webrtc/EglRenderer$$ExternalSyntheticLambda1;-><init>(Lorg/webrtc/EglRenderer;Ljava/util/concurrent/CountDownLatch;Lorg/webrtc/EglRenderer$FrameListener;)V
invoke-direct {p0, v2}, Lorg/webrtc/EglRenderer;->postToRenderThread(Ljava/lang/Runnable;)V
.line 494
monitor-exit v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 495
invoke-static {v0}, Lorg/webrtc/ThreadUtils;->awaitUninterruptibly(Ljava/util/concurrent/CountDownLatch;)V
return-void
.line 483
:cond_1
:try_start_1
new-instance p0, Ljava/lang/RuntimeException;
const-string p1, "removeFrameListener must not be called on the render thread."
invoke-direct {p0, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw p0
:catchall_0
move-exception p0
.line 494
monitor-exit v1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw p0
.end method
.method public setErrorCallback(Lorg/webrtc/EglRenderer$ErrorCallback;)V
.locals 0
iput-object p1, p0, Lorg/webrtc/EglRenderer;->errorCallback:Lorg/webrtc/EglRenderer$ErrorCallback;
return-void
.end method
.method public setFpsReduction(F)V
.locals 6
.line 399
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "setFpsReduction: "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->fpsReductionLock:Ljava/lang/Object;
.line 400
monitor-enter v0
:try_start_0
iget-wide v1, p0, Lorg/webrtc/EglRenderer;->minRenderPeriodNs:J
const/4 v3, 0x0
cmpg-float v3, p1, v3
if-gtz v3, :cond_0
const-wide v3, 0x7fffffffffffffffL
iput-wide v3, p0, Lorg/webrtc/EglRenderer;->minRenderPeriodNs:J
goto :goto_0
.line 405
:cond_0
sget-object v3, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
const-wide/16 v4, 0x1
invoke-virtual {v3, v4, v5}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide v3
long-to-float v3, v3
div-float/2addr v3, p1
float-to-long v3, v3
iput-wide v3, p0, Lorg/webrtc/EglRenderer;->minRenderPeriodNs:J
:goto_0
iget-wide v3, p0, Lorg/webrtc/EglRenderer;->minRenderPeriodNs:J
cmp-long p1, v3, v1
if-eqz p1, :cond_1
.line 409
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v1
iput-wide v1, p0, Lorg/webrtc/EglRenderer;->nextFrameTimeNs:J
.line 411
:cond_1
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method public setLayoutAspectRatio(F)V
.locals 2
.line 386
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "setLayoutAspectRatio: "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->layoutLock:Ljava/lang/Object;
.line 387
monitor-enter v0
:try_start_0
iput p1, p0, Lorg/webrtc/EglRenderer;->layoutAspectRatio:F
.line 389
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method public setMirror(Z)V
.locals 2
.line 365
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "setMirrorHorizontally: "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->layoutLock:Ljava/lang/Object;
.line 366
monitor-enter v0
:try_start_0
iput-boolean p1, p0, Lorg/webrtc/EglRenderer;->mirrorHorizontally:Z
.line 368
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method public setMirrorVertically(Z)V
.locals 2
.line 375
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "setMirrorVertically: "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lorg/webrtc/EglRenderer;->logD(Ljava/lang/String;)V
iget-object v0, p0, Lorg/webrtc/EglRenderer;->layoutLock:Ljava/lang/Object;
.line 376
monitor-enter v0
:try_start_0
iput-boolean p1, p0, Lorg/webrtc/EglRenderer;->mirrorVertically:Z
.line 378
monitor-exit v0
return-void
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method