984 lines
29 KiB
Smali
984 lines
29 KiB
Smali
.class public Lorg/webrtc/EglBase10;
|
|
.super Ljava/lang/Object;
|
|
.source "EglBase10.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/webrtc/EglBase;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lorg/webrtc/EglBase10$Context;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final EGL_CONTEXT_CLIENT_VERSION:I = 0x3098
|
|
|
|
|
|
# instance fields
|
|
.field public final egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
.field public eglConfig:Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
.field public eglContext:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
.field public eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
.field public eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lorg/webrtc/EglBase10$Context;[I)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
sget-object v0, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
invoke-static {}, Ljavax/microedition/khronos/egl/EGLContext;->getEGL()Ljavax/microedition/khronos/egl/EGL;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/EglBase10;->getEglDisplay()Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
invoke-direct {p0, v0, p2}, Lorg/webrtc/EglBase10;->getEglConfig(Ljavax/microedition/khronos/egl/EGLDisplay;[I)Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
move-result-object p2
|
|
|
|
iput-object p2, p0, Lorg/webrtc/EglBase10;->eglConfig:Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
iget-object p2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglConfig:Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
invoke-direct {p0, p1, p2, v0}, Lorg/webrtc/EglBase10;->createEglContext(Lorg/webrtc/EglBase10$Context;Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;)Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lorg/webrtc/EglBase10;->eglContext:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private checkIsNotReleased()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_DISPLAY:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglContext:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_CONTEXT:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglConfig:Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
const-string v1, "This object has been released"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private createEglContext(Lorg/webrtc/EglBase10$Context;Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;)Ljavax/microedition/khronos/egl/EGLContext;
|
|
.locals 3
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-static {p1}, Lorg/webrtc/EglBase10$Context;->access$000(Lorg/webrtc/EglBase10$Context;)Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_CONTEXT:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "Invalid sharedContext"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 v0, 0x3
|
|
|
|
new-array v0, v0, [I
|
|
|
|
fill-array-data v0, :array_0
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
sget-object p1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_CONTEXT:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-static {p1}, Lorg/webrtc/EglBase10$Context;->access$000(Lorg/webrtc/EglBase10$Context;)Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_1
|
|
sget-object v1, Lorg/webrtc/EglBase;->lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v1
|
|
|
|
:try_start_0
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v2, p2, p3, p1, v0}, Ljavax/microedition/khronos/egl/EGL10;->eglCreateContext(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;Ljavax/microedition/khronos/egl/EGLContext;[I)Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
move-result-object p1
|
|
|
|
monitor-exit v1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
sget-object p2, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_CONTEXT:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
if-eq p1, p2, :cond_3
|
|
|
|
return-object p1
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "Failed to create EGL context: 0x"
|
|
|
|
invoke-static {p2}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p2
|
|
|
|
iget-object p3, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {p3}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result p3
|
|
|
|
invoke-static {p3}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
:try_start_1
|
|
monitor-exit v1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw p1
|
|
|
|
nop
|
|
|
|
:array_0
|
|
.array-data 4
|
|
0x3098
|
|
0x2
|
|
0x3038
|
|
.end array-data
|
|
.end method
|
|
|
|
.method private createSurfaceInternal(Ljava/lang/Object;)V
|
|
.locals 4
|
|
|
|
instance-of v0, p1, Landroid/view/SurfaceHolder;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
instance-of v0, p1, Landroid/graphics/SurfaceTexture;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v0, "Input must be either a SurfaceHolder or SurfaceTexture"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-direct {p0}, Lorg/webrtc/EglBase10;->checkIsNotReleased()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-ne v0, v1, :cond_3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/16 v2, 0x3038
|
|
|
|
aput v2, v0, v1
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->eglConfig:Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
invoke-interface {v1, v2, v3, p1, v0}, Ljavax/microedition/khronos/egl/EGL10;->eglCreateWindowSurface(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;Ljava/lang/Object;[I)Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
iget-object p1, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v0, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-eq p1, v0, :cond_2
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string v0, "Failed to create window surface: 0x"
|
|
|
|
invoke-static {v0}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v1}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string v0, "Already has an EGLSurface"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private getEglConfig(Ljavax/microedition/khronos/egl/EGLDisplay;[I)Ljavax/microedition/khronos/egl/EGLConfig;
|
|
.locals 8
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v7, v0, [Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
new-array v0, v0, [I
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
array-length v5, v7
|
|
|
|
move-object v2, p1
|
|
|
|
move-object v3, p2
|
|
|
|
move-object v4, v7
|
|
|
|
move-object v6, v0
|
|
|
|
invoke-interface/range {v1 .. v6}, Ljavax/microedition/khronos/egl/EGL10;->eglChooseConfig(Ljavax/microedition/khronos/egl/EGLDisplay;[I[Ljavax/microedition/khronos/egl/EGLConfig;I[I)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
const/4 p1, 0x0
|
|
|
|
aget p2, v0, p1
|
|
|
|
if-lez p2, :cond_1
|
|
|
|
aget-object p1, v7, p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "eglChooseConfig returned null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "Unable to find any matching EGL config"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "eglChooseConfig failed: 0x"
|
|
|
|
invoke-static {p2}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p2
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v0}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private getEglDisplay()Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_DEFAULT_DISPLAY:Ljava/lang/Object;
|
|
|
|
invoke-interface {v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglGetDisplay(Ljava/lang/Object;)Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_DISPLAY:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
new-array v1, v1, [I
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v2, v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglInitialize(Ljavax/microedition/khronos/egl/EGLDisplay;[I)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
const-string v1, "Unable to initialize EGL10: 0x"
|
|
|
|
invoke-static {v1}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v2}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result v2
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
const-string v1, "Unable to get EGL10 display: 0x"
|
|
|
|
invoke-static {v1}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v2}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result v2
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public createDummyPbufferSurface()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-virtual {p0, v0, v0}, Lorg/webrtc/EglBase10;->createPbufferSurface(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public createPbufferSurface(II)V
|
|
.locals 4
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/EglBase10;->checkIsNotReleased()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-ne v0, v1, :cond_1
|
|
|
|
const/4 v0, 0x5
|
|
|
|
new-array v0, v0, [I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/16 v2, 0x3057
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
aput p1, v0, v1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
const/16 v2, 0x3056
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v1, 0x3
|
|
|
|
aput p2, v0, v1
|
|
|
|
const/4 v1, 0x4
|
|
|
|
const/16 v2, 0x3038
|
|
|
|
aput v2, v0, v1
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->eglConfig:Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
invoke-interface {v1, v2, v3, v0}, Ljavax/microedition/khronos/egl/EGL10;->eglCreatePbufferSurface(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;[I)Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
const-string v1, "Failed to create pixel buffer surface with size "
|
|
|
|
const-string v2, "x"
|
|
|
|
const-string v3, ": 0x"
|
|
|
|
invoke-static {v1, p1, v2, p2, v3}, Le/e/b/a/a;->b(Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p2, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {p2}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "Already has an EGLSurface"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public createSurface(Landroid/graphics/SurfaceTexture;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lorg/webrtc/EglBase10;->createSurfaceInternal(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public createSurface(Landroid/view/Surface;)V
|
|
.locals 1
|
|
|
|
new-instance v0, Lorg/webrtc/EglBase10$1FakeSurfaceHolder;
|
|
|
|
invoke-direct {v0, p0, p1}, Lorg/webrtc/EglBase10$1FakeSurfaceHolder;-><init>(Lorg/webrtc/EglBase10;Landroid/view/Surface;)V
|
|
|
|
invoke-direct {p0, v0}, Lorg/webrtc/EglBase10;->createSurfaceInternal(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public detachCurrent()V
|
|
.locals 6
|
|
|
|
sget-object v0, Lorg/webrtc/EglBase;->lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
sget-object v3, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v4, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v5, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_CONTEXT:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
invoke-interface {v1, v2, v3, v4, v5}, Ljavax/microedition/khronos/egl/EGL10;->eglMakeCurrent(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLSurface;Ljavax/microedition/khronos/egl/EGLSurface;Ljavax/microedition/khronos/egl/EGLContext;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v1, Ljava/lang/RuntimeException;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "eglDetachCurrent failed: 0x"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v3}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public getEglBaseContext()Lorg/webrtc/EglBase$Context;
|
|
.locals 2
|
|
|
|
new-instance v0, Lorg/webrtc/EglBase10$Context;
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->eglContext:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
invoke-direct {v0, v1}, Lorg/webrtc/EglBase10$Context;-><init>(Ljavax/microedition/khronos/egl/EGLContext;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public hasSurface()Z
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public makeCurrent()V
|
|
.locals 6
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/EglBase10;->checkIsNotReleased()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
sget-object v0, Lorg/webrtc/EglBase;->lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
iget-object v4, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
iget-object v5, p0, Lorg/webrtc/EglBase10;->eglContext:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
invoke-interface {v1, v2, v3, v4, v5}, Ljavax/microedition/khronos/egl/EGL10;->eglMakeCurrent(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLSurface;Ljavax/microedition/khronos/egl/EGLSurface;Ljavax/microedition/khronos/egl/EGLContext;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v1, Ljava/lang/RuntimeException;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "eglMakeCurrent failed: 0x"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
invoke-interface {v3}, Ljavax/microedition/khronos/egl/EGL10;->eglGetError()I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v1
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
const-string v1, "No EGLSurface - can\'t make current"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public release()V
|
|
.locals 3
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/EglBase10;->checkIsNotReleased()V
|
|
|
|
invoke-virtual {p0}, Lorg/webrtc/EglBase10;->releaseSurface()V
|
|
|
|
invoke-virtual {p0}, Lorg/webrtc/EglBase10;->detachCurrent()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglContext:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
invoke-interface {v0, v1, v2}, Ljavax/microedition/khronos/egl/EGL10;->eglDestroyContext(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLContext;)Z
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
invoke-interface {v0, v1}, Ljavax/microedition/khronos/egl/EGL10;->eglTerminate(Ljavax/microedition/khronos/egl/EGLDisplay;)Z
|
|
|
|
sget-object v0, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_CONTEXT:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->eglContext:Ljavax/microedition/khronos/egl/EGLContext;
|
|
|
|
sget-object v0, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_DISPLAY:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->eglConfig:Ljavax/microedition/khronos/egl/EGLConfig;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public releaseSurface()V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
invoke-interface {v1, v2, v0}, Ljavax/microedition/khronos/egl/EGL10;->eglDestroySurface(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLSurface;)Z
|
|
|
|
sget-object v0, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
iput-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public surfaceHeight()I
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [I
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
const/16 v4, 0x3056
|
|
|
|
invoke-interface {v1, v2, v3, v4, v0}, Ljavax/microedition/khronos/egl/EGL10;->eglQuerySurface(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLSurface;I[I)Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aget v0, v0, v1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public surfaceWidth()I
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [I
|
|
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
const/16 v4, 0x3057
|
|
|
|
invoke-interface {v1, v2, v3, v4, v0}, Ljavax/microedition/khronos/egl/EGL10;->eglQuerySurface(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLSurface;I[I)Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aget v0, v0, v1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public swapBuffers()V
|
|
.locals 4
|
|
|
|
invoke-direct {p0}, Lorg/webrtc/EglBase10;->checkIsNotReleased()V
|
|
|
|
iget-object v0, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
sget-object v1, Ljavax/microedition/khronos/egl/EGL10;->EGL_NO_SURFACE:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
sget-object v0, Lorg/webrtc/EglBase;->lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Lorg/webrtc/EglBase10;->egl:Ljavax/microedition/khronos/egl/EGL10;
|
|
|
|
iget-object v2, p0, Lorg/webrtc/EglBase10;->eglDisplay:Ljavax/microedition/khronos/egl/EGLDisplay;
|
|
|
|
iget-object v3, p0, Lorg/webrtc/EglBase10;->eglSurface:Ljavax/microedition/khronos/egl/EGLSurface;
|
|
|
|
invoke-interface {v1, v2, v3}, Ljavax/microedition/khronos/egl/EGL10;->eglSwapBuffers(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLSurface;)Z
|
|
|
|
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
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
const-string v1, "No EGLSurface - can\'t swap buffers"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public swapBuffers(J)V
|
|
.locals 0
|
|
|
|
invoke-virtual {p0}, Lorg/webrtc/EglBase10;->swapBuffers()V
|
|
|
|
return-void
|
|
.end method
|