MediaCodecVideoEncoder$1.smali

.class Lorg/webrtc/ali/MediaCodecVideoEncoder$1;
.super Ljava/lang/Object;
.source "MediaCodecVideoEncoder.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lorg/webrtc/ali/MediaCodecVideoEncoder;->release()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lorg/webrtc/ali/MediaCodecVideoEncoder;

.field final synthetic val$caughtException:Lorg/webrtc/ali/MediaCodecVideoEncoder$1CaughtException;

.field final synthetic val$releaseDone:Ljava/util/concurrent/CountDownLatch;


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

    return-void
.end method

.method constructor <init>(Lorg/webrtc/ali/MediaCodecVideoEncoder;Lorg/webrtc/ali/MediaCodecVideoEncoder$1CaughtException;Ljava/util/concurrent/CountDownLatch;)V
    .registers 4
    .param p1, "this$0"    # Lorg/webrtc/ali/MediaCodecVideoEncoder;

    .line 616
    iput-object p1, p0, Lorg/webrtc/ali/MediaCodecVideoEncoder$1;->this$0:Lorg/webrtc/ali/MediaCodecVideoEncoder;

    iput-object p2, p0, Lorg/webrtc/ali/MediaCodecVideoEncoder$1;->val$caughtException:Lorg/webrtc/ali/MediaCodecVideoEncoder$1CaughtException;

    iput-object p3, p0, Lorg/webrtc/ali/MediaCodecVideoEncoder$1;->val$releaseDone:Ljava/util/concurrent/CountDownLatch;

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

    return-void
.end method


# virtual methods
.method public run()V
    .registers 4

    .line 619
    const-string v0, "MediaCodecVideoEncoder"

    const-string v1, "Java releaseEncoder on release thread"

    invoke-static {v0, v1}, Lorg/webrtc/ali/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 621
    :try_start_7
    iget-object v1, p0, Lorg/webrtc/ali/MediaCodecVideoEncoder$1;->this$0:Lorg/webrtc/ali/MediaCodecVideoEncoder;

    # getter for: Lorg/webrtc/ali/MediaCodecVideoEncoder;->mediaCodec:Landroid/media/MediaCodec;
    invoke-static {v1}, Lorg/webrtc/ali/MediaCodecVideoEncoder;->access$000(Lorg/webrtc/ali/MediaCodecVideoEncoder;)Landroid/media/MediaCodec;

    move-result-object v1

    invoke-virtual {v1}, Landroid/media/MediaCodec;->stop()V
    :try_end_10
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_10} :catch_11

    .line 624
    goto :goto_17

    .line 622
    :catch_11
    move-exception v1

    .line 623
    .local v1, "e":Ljava/lang/Exception;
    const-string v2, "Media encoder stop failed"

    invoke-static {v0, v2, v1}, Lorg/webrtc/ali/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 626
    .end local v1    # "e":Ljava/lang/Exception;
    :goto_17
    :try_start_17
    iget-object v1, p0, Lorg/webrtc/ali/MediaCodecVideoEncoder$1;->this$0:Lorg/webrtc/ali/MediaCodecVideoEncoder;

    # getter for: Lorg/webrtc/ali/MediaCodecVideoEncoder;->mediaCodec:Landroid/media/MediaCodec;
    invoke-static {v1}, Lorg/webrtc/ali/MediaCodecVideoEncoder;->access$000(Lorg/webrtc/ali/MediaCodecVideoEncoder;)Landroid/media/MediaCodec;

    move-result-object v1

    invoke-virtual {v1}, Landroid/media/MediaCodec;->release()V
    :try_end_20
    .catch Ljava/lang/Exception; {:try_start_17 .. :try_end_20} :catch_21

    .line 630
    goto :goto_2b

    .line 627
    :catch_21
    move-exception v1

    .line 628
    .restart local v1    # "e":Ljava/lang/Exception;
    const-string v2, "Media encoder release failed"

    invoke-static {v0, v2, v1}, Lorg/webrtc/ali/Logging;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 629
    iget-object v2, p0, Lorg/webrtc/ali/MediaCodecVideoEncoder$1;->val$caughtException:Lorg/webrtc/ali/MediaCodecVideoEncoder$1CaughtException;

    iput-object v1, v2, Lorg/webrtc/ali/MediaCodecVideoEncoder$1CaughtException;->e:Ljava/lang/Exception;

    .line 631
    .end local v1    # "e":Ljava/lang/Exception;
    :goto_2b
    const-string v1, "Java releaseEncoder on release thread done"

    invoke-static {v0, v1}, Lorg/webrtc/ali/Logging;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 633
    iget-object v0, p0, Lorg/webrtc/ali/MediaCodecVideoEncoder$1;->val$releaseDone:Ljava/util/concurrent/CountDownLatch;

    invoke-virtual {v0}, Ljava/util/concurrent/CountDownLatch;->countDown()V

    .line 634
    return-void
.end method