2019-07-24 11:27:29 +00:00
|
|
|
.class public Lorg/webrtc/SurfaceViewRenderer;
|
|
|
|
.super Landroid/view/SurfaceView;
|
|
|
|
.source "SurfaceViewRenderer.java"
|
|
|
|
|
|
|
|
# interfaces
|
|
|
|
.implements Landroid/view/SurfaceHolder$Callback;
|
|
|
|
.implements Lorg/webrtc/VideoSink;
|
2019-12-06 03:29:40 +00:00
|
|
|
.implements Lorg/webrtc/RendererCommon$RendererEvents;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final TAG:Ljava/lang/String; = "SurfaceViewRenderer"
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public final eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public enableFixedSize:Z
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public rendererEvents:Lorg/webrtc/RendererCommon$RendererEvents;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public final resourceName:Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public rotatedFrameHeight:I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public rotatedFrameWidth:I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public surfaceHeight:I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public surfaceWidth:I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public final videoLayoutMeasure:Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Landroid/view/SurfaceView;-><init>(Landroid/content/Context;)V
|
|
|
|
|
|
|
|
new-instance p1, Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
|
|
|
|
|
|
|
invoke-direct {p1}, Lorg/webrtc/RendererCommon$VideoLayoutMeasure;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/SurfaceViewRenderer;->videoLayoutMeasure:Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/SurfaceViewRenderer;->getResourceName()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/SurfaceViewRenderer;->resourceName:Ljava/lang/String;
|
|
|
|
|
|
|
|
new-instance p1, Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->resourceName:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-direct {p1, v0}, Lorg/webrtc/SurfaceEglRenderer;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-interface {p1, p0}, Landroid/view/SurfaceHolder;->addCallback(Landroid/view/SurfaceHolder$Callback;)V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
invoke-interface {p1, v0}, Landroid/view/SurfaceHolder;->addCallback(Landroid/view/SurfaceHolder$Callback;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1, p2}, Landroid/view/SurfaceView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
|
|
|
|
new-instance p1, Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
|
|
|
|
|
|
|
invoke-direct {p1}, Lorg/webrtc/RendererCommon$VideoLayoutMeasure;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/SurfaceViewRenderer;->videoLayoutMeasure:Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/SurfaceViewRenderer;->getResourceName()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/SurfaceViewRenderer;->resourceName:Ljava/lang/String;
|
|
|
|
|
|
|
|
new-instance p1, Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
iget-object p2, p0, Lorg/webrtc/SurfaceViewRenderer;->resourceName:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-direct {p1, p2}, Lorg/webrtc/SurfaceEglRenderer;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-interface {p1, p0}, Landroid/view/SurfaceHolder;->addCallback(Landroid/view/SurfaceHolder$Callback;)V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iget-object p2, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
invoke-interface {p1, p2}, Landroid/view/SurfaceHolder;->addCallback(Landroid/view/SurfaceHolder$Callback;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private getResourceName()Ljava/lang/String;
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
:try_start_0
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getResources()Landroid/content/res/Resources;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getId()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getResourceEntryName(I)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
:try_end_0
|
|
|
|
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
const-string v0, ""
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private logD(Ljava/lang/String;)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lorg/webrtc/SurfaceViewRenderer;->resourceName:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v1, ": "
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string v0, "SurfaceViewRenderer"
|
|
|
|
|
|
|
|
invoke-static {v0, p1}, Lorg/webrtc/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private postOrRun(Ljava/lang/Runnable;)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/lang/Runnable;->run()V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_0
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0, p1}, Landroid/view/SurfaceView;->post(Ljava/lang/Runnable;)Z
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private updateSurfaceSize()V
|
|
|
|
.locals 5
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Lorg/webrtc/SurfaceViewRenderer;->enableFixedSize:Z
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget v0, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameWidth:I
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget v0, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameHeight:I
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getWidth()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHeight()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getWidth()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
int-to-float v0, v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHeight()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
int-to-float v1, v1
|
|
|
|
|
|
|
|
div-float/2addr v0, v1
|
|
|
|
|
|
|
|
iget v1, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameWidth:I
|
|
|
|
|
|
|
|
int-to-float v2, v1
|
|
|
|
|
|
|
|
iget v3, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameHeight:I
|
|
|
|
|
|
|
|
int-to-float v4, v3
|
|
|
|
|
|
|
|
div-float/2addr v2, v4
|
|
|
|
|
|
|
|
cmpl-float v2, v2, v0
|
|
|
|
|
|
|
|
if-lez v2, :cond_0
|
|
|
|
|
|
|
|
int-to-float v1, v3
|
|
|
|
|
|
|
|
mul-float v1, v1, v0
|
|
|
|
|
|
|
|
float-to-int v1, v1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
int-to-float v2, v1
|
|
|
|
|
|
|
|
div-float/2addr v2, v0
|
|
|
|
|
|
|
|
float-to-int v3, v2
|
|
|
|
|
|
|
|
:goto_0
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getWidth()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHeight()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-static {v1, v3}, Ljava/lang/Math;->min(II)I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const-string v2, "updateSurfaceSize. Layout size: "
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {v2}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result-object v2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getWidth()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v3, "x"
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHeight()I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v4, ", frame size: "
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget v4, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameWidth:I
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget v4, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameHeight:I
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v4, ", requested surface size: "
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v4, ", old surface size: "
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget v4, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceWidth:I
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget v3, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceHeight:I
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-direct {p0, v2}, Lorg/webrtc/SurfaceViewRenderer;->logD(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
iget v2, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceWidth:I
|
|
|
|
|
|
|
|
if-ne v0, v2, :cond_1
|
|
|
|
|
|
|
|
iget v2, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceHeight:I
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eq v1, v2, :cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iput v0, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceWidth:I
|
|
|
|
|
|
|
|
iput v1, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceHeight:I
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v2, v0, v1}, Landroid/view/SurfaceHolder;->setFixedSize(II)V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput v0, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceHeight:I
|
|
|
|
|
|
|
|
iput v0, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceWidth:I
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Landroid/view/SurfaceHolder;->setSizeFromLayout()V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_3
|
|
|
|
:goto_1
|
2019-07-24 11:27:29 +00:00
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public synthetic a(II)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput p1, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameWidth:I
|
|
|
|
|
|
|
|
iput p2, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameHeight:I
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/SurfaceViewRenderer;->updateSurfaceSize()V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->requestLayout()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
.method public addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;F)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0, p1, p2}, Lorg/webrtc/EglRenderer;->addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;F)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;FLorg/webrtc/RendererCommon$GlDrawer;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0, p1, p2, p3}, Lorg/webrtc/EglRenderer;->addFrameListener(Lorg/webrtc/EglRenderer$FrameListener;FLorg/webrtc/RendererCommon$GlDrawer;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public clearImage()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0}, Lorg/webrtc/EglRenderer;->clearImage()V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public disableFpsReduction()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/SurfaceEglRenderer;->disableFpsReduction()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public init(Lorg/webrtc/EglBase$Context;Lorg/webrtc/RendererCommon$RendererEvents;)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
sget-object v0, Lorg/webrtc/EglBase;->CONFIG_PLAIN:[I
|
|
|
|
|
|
|
|
new-instance v1, Lorg/webrtc/GlRectDrawer;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Lorg/webrtc/GlRectDrawer;-><init>()V
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1, p2, v0, v1}, Lorg/webrtc/SurfaceViewRenderer;->init(Lorg/webrtc/EglBase$Context;Lorg/webrtc/RendererCommon$RendererEvents;[ILorg/webrtc/RendererCommon$GlDrawer;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public init(Lorg/webrtc/EglBase$Context;Lorg/webrtc/RendererCommon$RendererEvents;[ILorg/webrtc/RendererCommon$GlDrawer;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
iput-object p2, p0, Lorg/webrtc/SurfaceViewRenderer;->rendererEvents:Lorg/webrtc/RendererCommon$RendererEvents;
|
|
|
|
|
|
|
|
const/4 p2, 0x0
|
|
|
|
|
|
|
|
iput p2, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameWidth:I
|
|
|
|
|
|
|
|
iput p2, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameHeight:I
|
|
|
|
|
|
|
|
iget-object p2, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
invoke-virtual {p2, p1, p0, p3, p4}, Lorg/webrtc/SurfaceEglRenderer;->init(Lorg/webrtc/EglBase$Context;Lorg/webrtc/RendererCommon$RendererEvents;[ILorg/webrtc/RendererCommon$GlDrawer;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onFirstFrameRendered()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->rendererEvents:Lorg/webrtc/RendererCommon$RendererEvents;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Lorg/webrtc/RendererCommon$RendererEvents;->onFirstFrameRendered()V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onFrame(Lorg/webrtc/VideoFrame;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Lorg/webrtc/SurfaceEglRenderer;->onFrame(Lorg/webrtc/VideoFrame;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onFrameResolutionChanged(III)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->rendererEvents:Lorg/webrtc/RendererCommon$RendererEvents;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {v0, p1, p2, p3}, Lorg/webrtc/RendererCommon$RendererEvents;->onFrameResolutionChanged(III)V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/16 v0, 0xb4
|
|
|
|
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
|
|
|
|
if-ne p3, v0, :cond_1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
move v1, p2
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
:goto_0
|
|
|
|
move v1, p1
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
if-eqz p3, :cond_3
|
|
|
|
|
|
|
|
if-ne p3, v0, :cond_4
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
move p1, p2
|
|
|
|
|
|
|
|
:cond_4
|
2019-12-21 01:41:59 +00:00
|
|
|
new-instance p2, Lz/d/w;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-direct {p2, p0, v1, p1}, Lz/d/w;-><init>(Lorg/webrtc/SurfaceViewRenderer;II)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0, p2}, Lorg/webrtc/SurfaceViewRenderer;->postOrRun(Ljava/lang/Runnable;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public onLayout(ZIIII)V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
iget-object p1, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
sub-int/2addr p4, p2
|
|
|
|
|
|
|
|
int-to-float p2, p4
|
|
|
|
|
|
|
|
sub-int/2addr p5, p3
|
|
|
|
|
|
|
|
int-to-float p3, p5
|
|
|
|
|
|
|
|
div-float/2addr p2, p3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p1, p2}, Lorg/webrtc/EglRenderer;->setLayoutAspectRatio(F)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/SurfaceViewRenderer;->updateSurfaceSize()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public onMeasure(II)V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 3
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->videoLayoutMeasure:Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
|
|
|
|
|
|
|
iget v1, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameWidth:I
|
|
|
|
|
|
|
|
iget v2, p0, Lorg/webrtc/SurfaceViewRenderer;->rotatedFrameHeight:I
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1, p2, v1, v2}, Lorg/webrtc/RendererCommon$VideoLayoutMeasure;->measure(IIII)Landroid/graphics/Point;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iget p2, p1, Landroid/graphics/Point;->x:I
|
|
|
|
|
|
|
|
iget v0, p1, Landroid/graphics/Point;->y:I
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0, p2, v0}, Landroid/view/SurfaceView;->setMeasuredDimension(II)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const-string p2, "onMeasure(). New size: "
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {p2}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result-object p2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget v0, p1, Landroid/graphics/Point;->x:I
|
|
|
|
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v0, "x"
|
|
|
|
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget p1, p1, Landroid/graphics/Point;->y:I
|
|
|
|
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lorg/webrtc/SurfaceViewRenderer;->logD(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public pauseVideo()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lorg/webrtc/SurfaceEglRenderer;->pauseVideo()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public release()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0}, Lorg/webrtc/EglRenderer;->release()V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public removeFrameListener(Lorg/webrtc/EglRenderer$FrameListener;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0, p1}, Lorg/webrtc/EglRenderer;->removeFrameListener(Lorg/webrtc/EglRenderer$FrameListener;)V
|
2019-12-06 01:29:57 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
.method public setEnableHardwareScaler(Z)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Lorg/webrtc/SurfaceViewRenderer;->enableFixedSize:Z
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/SurfaceViewRenderer;->updateSurfaceSize()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setFpsReduction(F)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Lorg/webrtc/SurfaceEglRenderer;->setFpsReduction(F)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setMirror(Z)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->eglRenderer:Lorg/webrtc/SurfaceEglRenderer;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0, p1}, Lorg/webrtc/EglRenderer;->setMirror(Z)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setScalingType(Lorg/webrtc/RendererCommon$ScalingType;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->videoLayoutMeasure:Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Lorg/webrtc/RendererCommon$VideoLayoutMeasure;->setScalingType(Lorg/webrtc/RendererCommon$ScalingType;)V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->requestLayout()V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setScalingType(Lorg/webrtc/RendererCommon$ScalingType;Lorg/webrtc/RendererCommon$ScalingType;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lorg/webrtc/SurfaceViewRenderer;->videoLayoutMeasure:Lorg/webrtc/RendererCommon$VideoLayoutMeasure;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1, p2}, Lorg/webrtc/RendererCommon$VideoLayoutMeasure;->setScalingType(Lorg/webrtc/RendererCommon$ScalingType;Lorg/webrtc/RendererCommon$ScalingType;)V
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroid/view/SurfaceView;->requestLayout()V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public surfaceChanged(Landroid/view/SurfaceHolder;III)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public surfaceCreated(Landroid/view/SurfaceHolder;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-static {}, Lorg/webrtc/ThreadUtils;->checkIsOnMainThread()V
|
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
iput p1, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceHeight:I
|
|
|
|
|
|
|
|
iput p1, p0, Lorg/webrtc/SurfaceViewRenderer;->surfaceWidth:I
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/SurfaceViewRenderer;->updateSurfaceSize()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public surfaceDestroyed(Landroid/view/SurfaceHolder;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|