EGLSurfaceTexture.smali

.class public final Lcom/mmc/player/videoRender/EGLSurfaceTexture;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;
.implements Ljava/lang/Runnable;


# annotations
.annotation build Landroid/annotation/TargetApi;
    value = 0x11
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;,
        Lcom/mmc/player/videoRender/EGLSurfaceTexture$SecureMode;,
        Lcom/mmc/player/videoRender/EGLSurfaceTexture$TextureImageListener;
    }
.end annotation


# static fields
.field private static final EGL_CONFIG_ATTRIBUTES:[I

.field private static final EGL_PROTECTED_CONTENT_EXT:I = 0x32c0

.field private static final EGL_SURFACE_HEIGHT:I = 0x1

.field private static final EGL_SURFACE_WIDTH:I = 0x1

.field public static final SECURE_MODE_NONE:I = 0x0

.field public static final SECURE_MODE_PROTECTED_PBUFFER:I = 0x2

.field public static final SECURE_MODE_SURFACELESS_CONTEXT:I = 0x1


# instance fields
.field private final callback:Lcom/mmc/player/videoRender/EGLSurfaceTexture$TextureImageListener;

.field private context:Landroid/opengl/EGLContext;

.field private display:Landroid/opengl/EGLDisplay;

.field private final handler:Landroid/os/Handler;

.field private surface:Landroid/opengl/EGLSurface;

.field private texture:Landroid/graphics/SurfaceTexture;

.field private final textureIdHolder:[I


# direct methods
.method public static constructor <clinit>()V
    .registers 1

    const/16 v0, 0x11

    new-array v0, v0, [I

    fill-array-data v0, :array_a

    sput-object v0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->EGL_CONFIG_ATTRIBUTES:[I

    return-void

    :array_a
    .array-data 4
        0x3040
        0x4
        0x3024
        0x8
        0x3023
        0x8
        0x3022
        0x8
        0x3021
        0x8
        0x3025
        0x0
        0x3027
        0x3038
        0x3033
        0x4
        0x3038
    .end array-data
.end method

.method public constructor <init>(Landroid/os/Handler;)V
    .registers 3

    const/4 v0, 0x0

    .line 1
    invoke-direct {p0, p1, v0}, Lcom/mmc/player/videoRender/EGLSurfaceTexture;-><init>(Landroid/os/Handler;Lcom/mmc/player/videoRender/EGLSurfaceTexture$TextureImageListener;)V

    return-void
.end method

.method public constructor <init>(Landroid/os/Handler;Lcom/mmc/player/videoRender/EGLSurfaceTexture$TextureImageListener;)V
    .registers 3

    .line 2
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 3
    iput-object p1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->handler:Landroid/os/Handler;

    .line 4
    iput-object p2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->callback:Lcom/mmc/player/videoRender/EGLSurfaceTexture$TextureImageListener;

    const/4 p1, 0x1

    new-array p1, p1, [I

    .line 5
    iput-object p1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->textureIdHolder:[I

    return-void
.end method

.method private static chooseEGLConfig(Landroid/opengl/EGLDisplay;)Landroid/opengl/EGLConfig;
    .registers 12

    const/4 v0, 0x1

    new-array v9, v0, [Landroid/opengl/EGLConfig;

    new-array v10, v0, [I

    .line 1
    sget-object v2, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->EGL_CONFIG_ATTRIBUTES:[I

    const/4 v3, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x1

    const/4 v8, 0x0

    move-object v1, p0

    move-object v4, v9

    move-object v7, v10

    .line 2
    invoke-static/range {v1 .. v8}, Landroid/opengl/EGL14;->eglChooseConfig(Landroid/opengl/EGLDisplay;[II[Landroid/opengl/EGLConfig;II[II)Z

    move-result p0

    const/4 v1, 0x0

    if-eqz p0, :cond_20

    aget v2, v10, v1

    if-lez v2, :cond_20

    aget-object v2, v9, v1

    if-eqz v2, :cond_20

    aget-object p0, v9, v1

    return-object p0

    .line 3
    :cond_20
    new-instance v2, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;

    sget-object v3, Ljava/util/Locale;->US:Ljava/util/Locale;

    const/4 v4, 0x3

    new-array v4, v4, [Ljava/lang/Object;

    .line 4
    invoke-static {p0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object p0

    aput-object p0, v4, v1

    aget p0, v10, v1

    invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p0

    aput-object p0, v4, v0

    const/4 p0, 0x2

    aget-object v0, v9, v1

    aput-object v0, v4, p0

    const-string p0, "eglChooseConfig failed: success=%b, numConfigs[0]=%d, configs[0]=%s"

    .line 5
    invoke-static {v3, p0, v4}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p0

    const/4 v0, 0x0

    invoke-direct {v2, p0, v0}, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;-><init>(Ljava/lang/String;Lcom/mmc/player/videoRender/EGLSurfaceTexture$1;)V

    throw v2
.end method

.method private static createEGLContext(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;I)Landroid/opengl/EGLContext;
    .registers 5

    if-nez p2, :cond_9

    const/4 p2, 0x3

    new-array p2, p2, [I

    .line 1
    fill-array-data p2, :array_22

    goto :goto_f

    :cond_9
    const/4 p2, 0x5

    new-array p2, p2, [I

    .line 2
    fill-array-data p2, :array_2c

    .line 3
    :goto_f
    sget-object v0, Landroid/opengl/EGL14;->EGL_NO_CONTEXT:Landroid/opengl/EGLContext;

    const/4 v1, 0x0

    .line 4
    invoke-static {p0, p1, v0, p2, v1}, Landroid/opengl/EGL14;->eglCreateContext(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;Landroid/opengl/EGLContext;[II)Landroid/opengl/EGLContext;

    move-result-object p0

    if-eqz p0, :cond_19

    return-object p0

    .line 5
    :cond_19
    new-instance p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;

    const/4 p1, 0x0

    const-string p2, "eglCreateContext failed"

    invoke-direct {p0, p2, p1}, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;-><init>(Ljava/lang/String;Lcom/mmc/player/videoRender/EGLSurfaceTexture$1;)V

    throw p0

    :array_22
    .array-data 4
        0x3098
        0x2
        0x3038
    .end array-data

    :array_2c
    .array-data 4
        0x3098
        0x2
        0x32c0
        0x1
        0x3038
    .end array-data
.end method

.method private static createEGLSurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;Landroid/opengl/EGLContext;I)Landroid/opengl/EGLSurface;
    .registers 6

    const/4 v0, 0x0

    const/4 v1, 0x1

    if-ne p3, v1, :cond_7

    .line 1
    sget-object p1, Landroid/opengl/EGL14;->EGL_NO_SURFACE:Landroid/opengl/EGLSurface;

    goto :goto_1e

    :cond_7
    const/4 v1, 0x2

    if-ne p3, v1, :cond_11

    const/4 p3, 0x7

    new-array p3, p3, [I

    .line 2
    fill-array-data p3, :array_36

    goto :goto_17

    :cond_11
    const/4 p3, 0x5

    new-array p3, p3, [I

    .line 3
    fill-array-data p3, :array_48

    :goto_17
    const/4 v1, 0x0

    .line 4
    invoke-static {p0, p1, p3, v1}, Landroid/opengl/EGL14;->eglCreatePbufferSurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;

    move-result-object p1

    if-eqz p1, :cond_2d

    .line 5
    :goto_1e
    invoke-static {p0, p1, p1, p2}, Landroid/opengl/EGL14;->eglMakeCurrent(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;Landroid/opengl/EGLSurface;Landroid/opengl/EGLContext;)Z

    move-result p0

    if-eqz p0, :cond_25

    return-object p1

    .line 6
    :cond_25
    new-instance p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;

    const-string p1, "eglMakeCurrent failed"

    invoke-direct {p0, p1, v0}, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;-><init>(Ljava/lang/String;Lcom/mmc/player/videoRender/EGLSurfaceTexture$1;)V

    throw p0

    .line 7
    :cond_2d
    new-instance p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;

    const-string p1, "eglCreatePbufferSurface failed"

    invoke-direct {p0, p1, v0}, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;-><init>(Ljava/lang/String;Lcom/mmc/player/videoRender/EGLSurfaceTexture$1;)V

    throw p0

    nop

    :array_36
    .array-data 4
        0x3057
        0x1
        0x3056
        0x1
        0x32c0
        0x1
        0x3038
    .end array-data

    :array_48
    .array-data 4
        0x3057
        0x1
        0x3056
        0x1
        0x3038
    .end array-data
.end method

.method private dispatchOnFrameAvailable()V
    .registers 2

    .line 1
    iget-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->callback:Lcom/mmc/player/videoRender/EGLSurfaceTexture$TextureImageListener;

    if-eqz v0, :cond_7

    .line 2
    invoke-interface {v0}, Lcom/mmc/player/videoRender/EGLSurfaceTexture$TextureImageListener;->onFrameAvailable()V

    :cond_7
    return-void
.end method

.method private static generateTextureIds([I)V
    .registers 3

    const/4 v0, 0x1

    const/4 v1, 0x0

    .line 1
    invoke-static {v0, p0, v1}, Landroid/opengl/GLES20;->glGenTextures(I[II)V

    .line 2
    invoke-static {}, Lcom/mmc/player/utils/GlUtil;->checkGlError()V

    return-void
.end method

.method private static getDefaultDisplay()Landroid/opengl/EGLDisplay;
    .registers 5

    const/4 v0, 0x0

    .line 1
    invoke-static {v0}, Landroid/opengl/EGL14;->eglGetDisplay(I)Landroid/opengl/EGLDisplay;

    move-result-object v1

    const/4 v2, 0x0

    if-eqz v1, :cond_1b

    const/4 v3, 0x2

    new-array v3, v3, [I

    const/4 v4, 0x1

    .line 2
    invoke-static {v1, v3, v0, v3, v4}, Landroid/opengl/EGL14;->eglInitialize(Landroid/opengl/EGLDisplay;[II[II)Z

    move-result v0

    if-eqz v0, :cond_13

    return-object v1

    .line 3
    :cond_13
    new-instance v0, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;

    const-string v1, "eglInitialize failed"

    invoke-direct {v0, v1, v2}, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;-><init>(Ljava/lang/String;Lcom/mmc/player/videoRender/EGLSurfaceTexture$1;)V

    throw v0

    .line 4
    :cond_1b
    new-instance v0, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;

    const-string v1, "eglGetDisplay failed"

    invoke-direct {v0, v1, v2}, Lcom/mmc/player/videoRender/EGLSurfaceTexture$GlException;-><init>(Ljava/lang/String;Lcom/mmc/player/videoRender/EGLSurfaceTexture$1;)V

    throw v0
.end method


# virtual methods
.method public getSurfaceTexture()Landroid/graphics/SurfaceTexture;
    .registers 2

    iget-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->texture:Landroid/graphics/SurfaceTexture;

    return-object v0
.end method

.method public init(I)V
    .registers 5

    .line 1
    invoke-static {}, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->getDefaultDisplay()Landroid/opengl/EGLDisplay;

    move-result-object v0

    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    .line 2
    invoke-static {v0}, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->chooseEGLConfig(Landroid/opengl/EGLDisplay;)Landroid/opengl/EGLConfig;

    move-result-object v0

    .line 3
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    invoke-static {v1, v0, p1}, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->createEGLContext(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;I)Landroid/opengl/EGLContext;

    move-result-object v1

    iput-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->context:Landroid/opengl/EGLContext;

    .line 4
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    invoke-static {v2, v0, v1, p1}, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->createEGLSurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;Landroid/opengl/EGLContext;I)Landroid/opengl/EGLSurface;

    move-result-object p1

    iput-object p1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->surface:Landroid/opengl/EGLSurface;

    .line 5
    iget-object p1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->textureIdHolder:[I

    invoke-static {p1}, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->generateTextureIds([I)V

    .line 6
    new-instance p1, Landroid/graphics/SurfaceTexture;

    iget-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->textureIdHolder:[I

    const/4 v1, 0x0

    aget v0, v0, v1

    invoke-direct {p1, v0}, Landroid/graphics/SurfaceTexture;-><init>(I)V

    iput-object p1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->texture:Landroid/graphics/SurfaceTexture;

    .line 7
    invoke-virtual {p1, p0}, Landroid/graphics/SurfaceTexture;->setOnFrameAvailableListener(Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;)V

    return-void
.end method

.method public onFrameAvailable(Landroid/graphics/SurfaceTexture;)V
    .registers 2

    iget-object p1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->handler:Landroid/os/Handler;

    invoke-virtual {p1, p0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public release()V
    .registers 6

    .line 1
    iget-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->handler:Landroid/os/Handler;

    invoke-virtual {v0, p0}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    const/4 v0, 0x0

    .line 2
    :try_start_6
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->texture:Landroid/graphics/SurfaceTexture;

    if-eqz v1, :cond_14

    .line 3
    invoke-virtual {v1}, Landroid/graphics/SurfaceTexture;->release()V

    const/4 v1, 0x1

    .line 4
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->textureIdHolder:[I

    const/4 v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/opengl/GLES20;->glDeleteTextures(I[II)V
    :try_end_14
    .catchall {:try_start_6 .. :try_end_14} :catchall_62

    .line 5
    :cond_14
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    if-eqz v1, :cond_29

    sget-object v2, Landroid/opengl/EGL14;->EGL_NO_DISPLAY:Landroid/opengl/EGLDisplay;

    invoke-virtual {v1, v2}, Landroid/opengl/EGLDisplay;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_29

    .line 6
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    sget-object v2, Landroid/opengl/EGL14;->EGL_NO_SURFACE:Landroid/opengl/EGLSurface;

    sget-object v3, Landroid/opengl/EGL14;->EGL_NO_CONTEXT:Landroid/opengl/EGLContext;

    invoke-static {v1, v2, v2, v3}, Landroid/opengl/EGL14;->eglMakeCurrent(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;Landroid/opengl/EGLSurface;Landroid/opengl/EGLContext;)Z

    .line 7
    :cond_29
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->surface:Landroid/opengl/EGLSurface;

    if-eqz v1, :cond_3c

    sget-object v2, Landroid/opengl/EGL14;->EGL_NO_SURFACE:Landroid/opengl/EGLSurface;

    invoke-virtual {v1, v2}, Landroid/opengl/EGLSurface;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_3c

    .line 8
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->surface:Landroid/opengl/EGLSurface;

    invoke-static {v1, v2}, Landroid/opengl/EGL14;->eglDestroySurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;)Z

    .line 9
    :cond_3c
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->context:Landroid/opengl/EGLContext;

    if-eqz v1, :cond_45

    .line 10
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    invoke-static {v2, v1}, Landroid/opengl/EGL14;->eglDestroyContext(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLContext;)Z

    .line 11
    :cond_45
    invoke-static {}, Landroid/opengl/EGL14;->eglReleaseThread()Z

    .line 12
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    if-eqz v1, :cond_59

    sget-object v2, Landroid/opengl/EGL14;->EGL_NO_DISPLAY:Landroid/opengl/EGLDisplay;

    invoke-virtual {v1, v2}, Landroid/opengl/EGLDisplay;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_59

    .line 13
    iget-object v1, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    invoke-static {v1}, Landroid/opengl/EGL14;->eglTerminate(Landroid/opengl/EGLDisplay;)Z

    .line 14
    :cond_59
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    .line 15
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->context:Landroid/opengl/EGLContext;

    .line 16
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->surface:Landroid/opengl/EGLSurface;

    .line 17
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->texture:Landroid/graphics/SurfaceTexture;

    return-void

    :catchall_62
    move-exception v1

    .line 18
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    if-eqz v2, :cond_78

    sget-object v3, Landroid/opengl/EGL14;->EGL_NO_DISPLAY:Landroid/opengl/EGLDisplay;

    invoke-virtual {v2, v3}, Landroid/opengl/EGLDisplay;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_78

    .line 19
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    sget-object v3, Landroid/opengl/EGL14;->EGL_NO_SURFACE:Landroid/opengl/EGLSurface;

    sget-object v4, Landroid/opengl/EGL14;->EGL_NO_CONTEXT:Landroid/opengl/EGLContext;

    invoke-static {v2, v3, v3, v4}, Landroid/opengl/EGL14;->eglMakeCurrent(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;Landroid/opengl/EGLSurface;Landroid/opengl/EGLContext;)Z

    .line 20
    :cond_78
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->surface:Landroid/opengl/EGLSurface;

    if-eqz v2, :cond_8b

    sget-object v3, Landroid/opengl/EGL14;->EGL_NO_SURFACE:Landroid/opengl/EGLSurface;

    invoke-virtual {v2, v3}, Landroid/opengl/EGLSurface;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_8b

    .line 21
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    iget-object v3, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->surface:Landroid/opengl/EGLSurface;

    invoke-static {v2, v3}, Landroid/opengl/EGL14;->eglDestroySurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;)Z

    .line 22
    :cond_8b
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->context:Landroid/opengl/EGLContext;

    if-eqz v2, :cond_94

    .line 23
    iget-object v3, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    invoke-static {v3, v2}, Landroid/opengl/EGL14;->eglDestroyContext(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLContext;)Z

    .line 24
    :cond_94
    invoke-static {}, Landroid/opengl/EGL14;->eglReleaseThread()Z

    .line 25
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    if-eqz v2, :cond_a8

    sget-object v3, Landroid/opengl/EGL14;->EGL_NO_DISPLAY:Landroid/opengl/EGLDisplay;

    invoke-virtual {v2, v3}, Landroid/opengl/EGLDisplay;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_a8

    .line 26
    iget-object v2, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    invoke-static {v2}, Landroid/opengl/EGL14;->eglTerminate(Landroid/opengl/EGLDisplay;)Z

    .line 27
    :cond_a8
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->display:Landroid/opengl/EGLDisplay;

    .line 28
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->context:Landroid/opengl/EGLContext;

    .line 29
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->surface:Landroid/opengl/EGLSurface;

    .line 30
    iput-object v0, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->texture:Landroid/graphics/SurfaceTexture;

    .line 31
    throw v1
.end method

.method public run()V
    .registers 6

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v1

    if-ne v0, v1, :cond_c

    const/4 v0, 0x1

    goto :goto_d

    :cond_c
    const/4 v0, 0x0

    :goto_d
    const-string v1, "runnable"

    const-string v2, "com/mmc/player/videoRender/EGLSurfaceTexture"

    const-string v3, "run"

    if-eqz v0, :cond_18

    invoke-static {v3, v2, v1}, Lcom/shopee/monitor/trace/c;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 1
    :cond_18
    invoke-direct {p0}, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->dispatchOnFrameAvailable()V

    .line 2
    iget-object v4, p0, Lcom/mmc/player/videoRender/EGLSurfaceTexture;->texture:Landroid/graphics/SurfaceTexture;

    if-eqz v4, :cond_24

    .line 3
    :try_start_1f
    invoke-virtual {v4}, Landroid/graphics/SurfaceTexture;->updateTexImage()V
    :try_end_22
    .catch Ljava/lang/RuntimeException; {:try_start_1f .. :try_end_22} :catch_23

    goto :goto_24

    :catch_23
    nop

    :cond_24
    :goto_24
    if-eqz v0, :cond_29

    .line 4
    invoke-static {v3, v2, v1}, Lcom/shopee/monitor/trace/c;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    :cond_29
    return-void
.end method