.class Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread; .super Landroid/os/HandlerThread; .source "SourceFile" # interfaces .implements Landroid/os/Handler$Callback; # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x9 name = "DummySurfaceThread" .end annotation # static fields .field private static final MSG_INIT:I = 0x1 .field private static final MSG_RELEASE:I = 0x2 # instance fields .field private eglSurfaceTexture:Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private handler:Landroid/os/Handler; .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private initError:Ljava/lang/Error; .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private initException:Ljava/lang/RuntimeException; .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private surface:Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; .annotation build Landroidx/annotation/Nullable; .end annotation .end field # direct methods .method public constructor ()V .locals 1 const-string v0, "dummySurface" .line 131 invoke-direct {p0, v0}, Landroid/os/HandlerThread;->(Ljava/lang/String;)V return-void .end method .method private initInternal(I)V .locals 3 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->eglSurfaceTexture:Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; .line 200 invoke-static {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Assertions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->eglSurfaceTexture:Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; .line 201 invoke-virtual {v0, p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture;->init(I)V .line 202 new-instance v0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->eglSurfaceTexture:Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; .line 204 invoke-virtual {v1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture;->getSurfaceTexture()Landroid/graphics/SurfaceTexture; move-result-object v1 if-eqz p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 const/4 p1, 0x0 :goto_0 const/4 v2, 0x0 invoke-direct {v0, p0, v1, p1, v2}, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface;->(Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;Landroid/graphics/SurfaceTexture;ZLcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$1;)V iput-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->surface:Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; return-void .end method .method private releaseInternal()V .locals 1 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->eglSurfaceTexture:Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; .line 208 invoke-static {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Assertions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->eglSurfaceTexture:Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; .line 209 invoke-virtual {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture;->release()V return-void .end method # virtual methods .method public handleMessage(Landroid/os/Message;)Z .locals 3 .line 169 iget v0, p1, Landroid/os/Message;->what:I const/4 v1, 0x1 if-eq v0, v1, :cond_1 const/4 p1, 0x2 if-eq v0, p1, :cond_0 return v1 .line 187 :cond_0 :try_start_0 invoke-direct {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->releaseInternal()V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 191 :goto_0 invoke-virtual {p0}, Landroid/os/HandlerThread;->quit()Z goto :goto_1 :catchall_0 move-exception p1 :try_start_1 const-string v0, "DummySurface" const-string v2, "Failed to release dummy surface" .line 189 invoke-static {v0, v2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_1 goto :goto_0 :goto_1 return v1 :catchall_1 move-exception p1 .line 191 invoke-virtual {p0}, Landroid/os/HandlerThread;->quit()Z .line 192 throw p1 .line 172 :cond_1 :try_start_2 iget p1, p1, Landroid/os/Message;->arg1:I invoke-direct {p0, p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->initInternal(I)V :try_end_2 .catch Ljava/lang/RuntimeException; {:try_start_2 .. :try_end_2} :catch_1 .catch Ljava/lang/Error; {:try_start_2 .. :try_end_2} :catch_0 .catchall {:try_start_2 .. :try_end_2} :catchall_3 .line 180 monitor-enter p0 .line 181 :try_start_3 invoke-virtual {p0}, Ljava/lang/Object;->notify()V .line 182 monitor-exit p0 goto :goto_4 :catchall_2 move-exception p1 monitor-exit p0 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_2 throw p1 :catchall_3 move-exception p1 goto :goto_5 :catch_0 move-exception p1 goto :goto_2 :catch_1 move-exception p1 goto :goto_3 :goto_2 :try_start_4 const-string v0, "DummySurface" const-string v2, "Failed to initialize dummy surface" .line 177 invoke-static {v0, v2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I iput-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->initError:Ljava/lang/Error; :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_3 .line 180 monitor-enter p0 .line 181 :try_start_5 invoke-virtual {p0}, Ljava/lang/Object;->notify()V .line 182 monitor-exit p0 goto :goto_4 :catchall_4 move-exception p1 monitor-exit p0 :try_end_5 .catchall {:try_start_5 .. :try_end_5} :catchall_4 throw p1 :goto_3 :try_start_6 const-string v0, "DummySurface" const-string v2, "Failed to initialize dummy surface" .line 174 invoke-static {v0, v2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I iput-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->initException:Ljava/lang/RuntimeException; :try_end_6 .catchall {:try_start_6 .. :try_end_6} :catchall_3 .line 180 monitor-enter p0 .line 181 :try_start_7 invoke-virtual {p0}, Ljava/lang/Object;->notify()V .line 182 monitor-exit p0 :goto_4 return v1 :catchall_5 move-exception p1 monitor-exit p0 :try_end_7 .catchall {:try_start_7 .. :try_end_7} :catchall_5 throw p1 .line 180 :goto_5 monitor-enter p0 .line 181 :try_start_8 invoke-virtual {p0}, Ljava/lang/Object;->notify()V .line 182 monitor-exit p0 :try_end_8 .catchall {:try_start_8 .. :try_end_8} :catchall_6 .line 183 throw p1 :catchall_6 move-exception p1 .line 182 :try_start_9 monitor-exit p0 :try_end_9 .catchall {:try_start_9 .. :try_end_9} :catchall_6 throw p1 .end method .method public init(I)Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; .locals 3 .line 135 invoke-virtual {p0}, Ljava/lang/Thread;->start()V .line 136 new-instance v0, Landroid/os/Handler; invoke-virtual {p0}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper; move-result-object v1 invoke-direct {v0, v1, p0}, Landroid/os/Handler;->(Landroid/os/Looper;Landroid/os/Handler$Callback;)V iput-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->handler:Landroid/os/Handler; .line 137 new-instance v0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->handler:Landroid/os/Handler; invoke-direct {v0, v1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture;->(Landroid/os/Handler;)V iput-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->eglSurfaceTexture:Lcom/mbridge/msdk/playercommon/exoplayer2/util/EGLSurfaceTexture; .line 139 monitor-enter p0 :try_start_0 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->handler:Landroid/os/Handler; const/4 v1, 0x1 const/4 v2, 0x0 .line 140 invoke-virtual {v0, v1, p1, v2}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message; move-result-object p1 invoke-virtual {p1}, Landroid/os/Message;->sendToTarget()V :goto_0 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->surface:Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; if-nez p1, :cond_0 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->initException:Ljava/lang/RuntimeException; if-nez p1, :cond_0 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->initError:Ljava/lang/Error; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-nez p1, :cond_0 .line 143 :try_start_1 invoke-virtual {p0}, Ljava/lang/Object;->wait()V :try_end_1 .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0 .catchall {:try_start_1 .. :try_end_1} :catchall_0 goto :goto_0 :catchall_0 move-exception p1 goto :goto_1 :catch_0 move v2, v1 goto :goto_0 .line 148 :cond_0 :try_start_2 monitor-exit p0 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 if-eqz v2, :cond_1 .line 151 invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object p1 invoke-virtual {p1}, Ljava/lang/Thread;->interrupt()V :cond_1 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->initException:Ljava/lang/RuntimeException; if-nez p1, :cond_3 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->initError:Ljava/lang/Error; if-nez p1, :cond_2 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->surface:Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; .line 158 invoke-static {p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Assertions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 check-cast p1, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface; return-object p1 .line 156 :cond_2 throw p1 .line 154 :cond_3 throw p1 .line 148 :goto_1 :try_start_3 monitor-exit p0 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_0 throw p1 .end method .method public release()V .locals 2 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->handler:Landroid/os/Handler; .line 163 invoke-static {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Assertions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/video/DummySurface$DummySurfaceThread;->handler:Landroid/os/Handler; const/4 v1, 0x2 .line 164 invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z return-void .end method